diff options
author | Jani Honkonen <jani.honkonen@digia.com> | 2012-09-07 16:27:12 +0300 |
---|---|---|
committer | Jani Honkonen <jani.honkonen@digia.com> | 2012-09-07 16:28:02 +0300 |
commit | f16c119125f6f9f6e881461f2aea357f79cec644 (patch) | |
tree | 1d672496cb3788cbee46d12cb30a8ec68e77324f | |
parent | 14e68f99d8d529f68216b3c0cab82f9d813ac2f3 (diff) |
remove tools from release
-rw-r--r-- | tools/Jobs.pm | 33 | ||||
-rw-r--r-- | tools/Tiny.pm | 280 | ||||
-rw-r--r-- | tools/build.pl | 97 | ||||
-rw-r--r-- | tools/build_win_mingw.bat | 8 | ||||
-rw-r--r-- | tools/build_win_vs2005.bat | 10 | ||||
-rw-r--r-- | tools/build_win_vs2008.bat | 8 | ||||
-rw-r--r-- | tools/build_win_vs2010.bat | 8 | ||||
-rw-r--r-- | tools/build_win_vs2010_64bit.bat | 8 | ||||
-rw-r--r-- | tools/jobs.ini | 131 | ||||
-rw-r--r-- | tools/run_tests.pl | 95 |
10 files changed, 0 insertions, 678 deletions
diff --git a/tools/Jobs.pm b/tools/Jobs.pm deleted file mode 100644 index e2021daf..00000000 --- a/tools/Jobs.pm +++ /dev/null @@ -1,33 +0,0 @@ -package Jobs; -use File::Basename; -use Tiny; - -sub get { - my $inifile = shift; - my $jobname = shift; - - # Strip the prefix from job name when using ${bamboo.buildPlanName} - my $prefix = "Digia Qt Commercial - Chart component - "; - $jobname =~ s/$prefix//; - - # read ini file - my $cfg = Config::Tiny->read( $inifile ); - - # get section from ini by jobname - my %job = %{$cfg->{$jobname}}; - if (!%job) { - die ("Unknown jobname! Check $inifile and bamboo job name."); - } - - # print out the ini settings - print "\n\nini file: $inifile\n"; - print "[$jobname]\n"; - foreach (keys %job) { - print $_ . "=" . $job{$_} . "\n"; - } - print "\n"; - - return %job; -} - -1;
\ No newline at end of file diff --git a/tools/Tiny.pm b/tools/Tiny.pm deleted file mode 100644 index 24961295..00000000 --- a/tools/Tiny.pm +++ /dev/null @@ -1,280 +0,0 @@ -package Config::Tiny; - -# If you thought Config::Simple was small... - -use strict; -BEGIN { - require 5.004; - $Config::Tiny::VERSION = '2.14'; - $Config::Tiny::errstr = ''; -} - -# Create an empty object -sub new { bless {}, shift } - -# Create an object from a file -sub read { - my $class = ref $_[0] ? ref shift : shift; - - # Check the file - my $file = shift or return $class->_error( 'You did not specify a file name' ); - return $class->_error( "File '$file' does not exist" ) unless -e $file; - return $class->_error( "'$file' is a directory, not a file" ) unless -f _; - return $class->_error( "Insufficient permissions to read '$file'" ) unless -r _; - - # Slurp in the file - local $/ = undef; - open( CFG, $file ) or return $class->_error( "Failed to open file '$file': $!" ); - my $contents = <CFG>; - close( CFG ); - - $class->read_string( $contents ); -} - -# Create an object from a string -sub read_string { - my $class = ref $_[0] ? ref shift : shift; - my $self = bless {}, $class; - return undef unless defined $_[0]; - - # Parse the file - my $ns = '_'; - my $counter = 0; - foreach ( split /(?:\015{1,2}\012|\015|\012)/, shift ) { - $counter++; - - # Skip comments and empty lines - next if /^\s*(?:\#|\;|$)/; - - # Remove inline comments - s/\s\;\s.+$//g; - - # Handle section headers - if ( /^\s*\[\s*(.+?)\s*\]\s*$/ ) { - # Create the sub-hash if it doesn't exist. - # Without this sections without keys will not - # appear at all in the completed struct. - $self->{$ns = $1} ||= {}; - next; - } - - # Handle properties - if ( /^\s*([^=]+?)\s*=\s*(.*?)\s*$/ ) { - $self->{$ns}->{$1} = $2; - next; - } - - return $self->_error( "Syntax error at line $counter: '$_'" ); - } - - $self; -} - -# Save an object to a file -sub write { - my $self = shift; - my $file = shift or return $self->_error( - 'No file name provided' - ); - - # Write it to the file - my $string = $self->write_string; - return undef unless defined $string; - open( CFG, '>' . $file ) or return $self->_error( - "Failed to open file '$file' for writing: $!" - ); - print CFG $string; - close CFG; -} - -# Save an object to a string -sub write_string { - my $self = shift; - - my $contents = ''; - foreach my $section ( sort { (($b eq '_') <=> ($a eq '_')) || ($a cmp $b) } keys %$self ) { - # Check for several known-bad situations with the section - # 1. Leading whitespace - # 2. Trailing whitespace - # 3. Newlines in section name - return $self->_error( - "Illegal whitespace in section name '$section'" - ) if $section =~ /(?:^\s|\n|\s$)/s; - my $block = $self->{$section}; - $contents .= "\n" if length $contents; - $contents .= "[$section]\n" unless $section eq '_'; - foreach my $property ( sort keys %$block ) { - return $self->_error( - "Illegal newlines in property '$section.$property'" - ) if $block->{$property} =~ /(?:\012|\015)/s; - $contents .= "$property=$block->{$property}\n"; - } - } - - $contents; -} - -# Error handling -sub errstr { $Config::Tiny::errstr } -sub _error { $Config::Tiny::errstr = $_[1]; undef } - -1; - -__END__ - -=pod - -=head1 NAME - -Config::Tiny - Read/Write .ini style files with as little code as possible - -=head1 SYNOPSIS - - # In your configuration file - rootproperty=blah - - [section] - one=twp - three= four - Foo =Bar - empty= - - # In your program - use Config::Tiny; - - # Create a config - my $Config = Config::Tiny->new; - - # Open the config - $Config = Config::Tiny->read( 'file.conf' ); - - # Reading properties - my $rootproperty = $Config->{_}->{rootproperty}; - my $one = $Config->{section}->{one}; - my $Foo = $Config->{section}->{Foo}; - - # Changing data - $Config->{newsection} = { this => 'that' }; # Add a section - $Config->{section}->{Foo} = 'Not Bar!'; # Change a value - delete $Config->{_}; # Delete a value or section - - # Save a config - $Config->write( 'file.conf' ); - -=head1 DESCRIPTION - -C<Config::Tiny> is a perl class to read and write .ini style configuration -files with as little code as possible, reducing load time and memory -overhead. Most of the time it is accepted that Perl applications use a lot -of memory and modules. The C<::Tiny> family of modules is specifically -intended to provide an ultralight alternative to the standard modules. - -This module is primarily for reading human written files, and anything we -write shouldn't need to have documentation/comments. If you need something -with more power move up to L<Config::Simple>, L<Config::General> or one of -the many other C<Config::> modules. To rephrase, L<Config::Tiny> does B<not> -preserve your comments, whitespace, or the order of your config file. - -=head1 CONFIGURATION FILE SYNTAX - -Files are the same format as for windows .ini files. For example: - - [section] - var1=value1 - var2=value2 - -If a property is outside of a section at the beginning of a file, it will -be assigned to the C<"root section">, available at C<$Config-E<gt>{_}>. - -Lines starting with C<'#'> or C<';'> are considered comments and ignored, -as are blank lines. - -When writing back to the config file, all comments, custom whitespace, -and the ordering of your config file elements is discarded. If you need -to keep the human elements of a config when writing back, upgrade to -something better, this module is not for you. - -=head1 METHODS - -=head2 new - -The constructor C<new> creates and returns an empty C<Config::Tiny> object. - -=head2 read $filename - -The C<read> constructor reads a config file, and returns a new -C<Config::Tiny> object containing the properties in the file. - -Returns the object on success, or C<undef> on error. - -When C<read> fails, C<Config::Tiny> sets an error message internally -you can recover via C<Config::Tiny-E<gt>errstr>. Although in B<some> -cases a failed C<read> will also set the operating system error -variable C<$!>, not all errors do and you should not rely on using -the C<$!> variable. - -=head2 read_string $string; - -The C<read_string> method takes as argument the contents of a config file -as a string and returns the C<Config::Tiny> object for it. - -=head2 write $filename - -The C<write> method generates the file content for the properties, and -writes it to disk to the filename specified. - -Returns true on success or C<undef> on error. - -=head2 write_string - -Generates the file content for the object and returns it as a string. - -=head2 errstr - -When an error occurs, you can retrieve the error message either from the -C<$Config::Tiny::errstr> variable, or using the C<errstr()> method. - -=head1 CAVEATS - -=head2 Unsupported Section Headers - -Some edge cases in section headers are not support, and additionally may not -be detected when writing the config file. - -Specifically, section headers with leading whitespace, trailing whitespace, -or newlines anywhere in the section header, will not be written correctly -to the file and may cause file corruption. - -=head1 SUPPORT - -Bugs should be reported via the CPAN bug tracker at - -L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Config-Tiny> - -For other issues, or commercial enhancement or support, contact the author. - -=head1 AUTHOR - -Adam Kennedy E<lt>adamk@cpan.orgE<gt> - -=head1 ACKNOWLEGEMENTS - -Thanks to Sherzod Ruzmetov E<lt>sherzodr@cpan.orgE<gt> for -L<Config::Simple>, which inspired this module by being not quite -"simple" enough for me :) - -=head1 SEE ALSO - -L<Config::Simple>, L<Config::General>, L<ali.as> - -=head1 COPYRIGHT - -Copyright 2002 - 2011 Adam Kennedy. - -This program is free software; you can redistribute -it and/or modify it under the same terms as Perl itself. - -The full text of the license can be found in the -LICENSE file included with this module. - -=cut diff --git a/tools/build.pl b/tools/build.pl deleted file mode 100644 index 3379db74..00000000 --- a/tools/build.pl +++ /dev/null @@ -1,97 +0,0 @@ -use File::Basename; -use feature "switch"; -use lib 'tools'; -use Jobs; - -# read command line params -my $jobname = shift; - -# get script directory -my $scriptdir = File::Basename::dirname($0); - -# read ini file -my $inifile = $scriptdir . "/jobs.ini"; -my %job = Jobs::get($inifile, $jobname); - -# examine the platform -given ($job{'Platform'}) { - - when ("Win7") { - - $scriptdir =~ s/\//\\/g; # replace / -> \ - - # construct a build command - if ($job{'ToolChain'} eq "mingw") { - run($scriptdir . "\\build_win_mingw.bat", $job{'QtDir'}, $job{'Config'}, $job{'MinGWDir'}); - } - elsif ($job{'ToolChain'} eq "vs2005") { - run($scriptdir . "\\build_win_vs2005.bat", $job{'QtDir'}, $job{'Config'}); - } - elsif ($job{'ToolChain'} eq "vs2008") { - run($scriptdir . "\\build_win_vs2008.bat", $job{'QtDir'}, $job{'Config'}); - } - elsif ($job{'ToolChain'} eq "vs2010") { - run($scriptdir . "\\build_win_vs2010.bat", $job{'QtDir'}, $job{'Config'}); - } - elsif ($job{'ToolChain'} eq "vs2010-64bit") { - run($scriptdir . "\\build_win_vs2010_64bit.bat", $job{'QtDir'}, $job{'Config'}); - } - else { - die "Unknown toolchain!"; - } - } - - when ("Mac") { - - # setup build environment - $ENV{'QTDIR'} = $job{'QtDir'}; - $ENV{'PATH'} = $job{'QtDir'} . "/bin:" . $ENV{'PATH'}; - - # run qmake - my $cmd; - if ($job{'ToolChain'} eq "clang") { - run("qmake -r -spec unsupported/macx-clang CONFIG+=" . $job{'Config'}); - } - elsif ($job{'ToolChain'} eq "gcc") { - run("qmake -r CONFIG+=" . $job{'Config'}); - } - else { - die "Unknown toolchain!"; - } - - # run make - run("make"); - } - - when ("Linux") { - - # setup build environment - $ENV{'QTDIR'} = $job{'QtDir'}; - $ENV{'PATH'} = $job{'QtDir'} . "/bin:" . $ENV{'PATH'}; - - # run qmake - my $cmd; - if ($job{'ToolChain'} eq "gcc") { - run("qmake -r CONFIG+=" . $job{'Config'}); - } - else { - die "Unknown toolchain!"; - } - - # run make - run("make -j 4"); - } - - default { - die "Unknown platform " . $job{'Platform'}; - } -} - -sub run { - my $cmd; - foreach (@_) { - $cmd .= "$_ "; - } - print "running : $cmd\n"; - system(@_) == 0 or die "system \"$cmd\" failed: $?"; -}
\ No newline at end of file diff --git a/tools/build_win_mingw.bat b/tools/build_win_mingw.bat deleted file mode 100644 index 54212cd1..00000000 --- a/tools/build_win_mingw.bat +++ /dev/null @@ -1,8 +0,0 @@ -set QTDIR=%1 -set PATH=%1\bin; -set PATH=%PATH%;%3\bin -set PATH=%PATH%;%SystemRoot%\System32 -set QMAKESPEC=win32-g++ -qmake -r charts.pro CONFIG+=%2 -@echo on -mingw32-make
\ No newline at end of file diff --git a/tools/build_win_vs2005.bat b/tools/build_win_vs2005.bat deleted file mode 100644 index 9642ba25..00000000 --- a/tools/build_win_vs2005.bat +++ /dev/null @@ -1,10 +0,0 @@ -set QTDIR=%1 -set PATH=%1\bin;%PATH%; -set QMAKESPEC=win32-msvc2005 -call "C:\Program Files (x86)\Microsoft Visual Studio 8\VC\vcvarsall.bat" x86 -@echo on -set INCLUDE=%INCLUDE%;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include -set LIB=%LIB%;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib -qmake -r charts.pro CONFIG+=%2 -@echo on -nmake diff --git a/tools/build_win_vs2008.bat b/tools/build_win_vs2008.bat deleted file mode 100644 index 4edcefc2..00000000 --- a/tools/build_win_vs2008.bat +++ /dev/null @@ -1,8 +0,0 @@ -set QTDIR=%1 -set PATH=%1\bin;%PATH%; -set QMAKESPEC=win32-msvc2008 -call "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86 -@echo on -qmake -r charts.pro CONFIG+=%2 -@echo on -nmake diff --git a/tools/build_win_vs2010.bat b/tools/build_win_vs2010.bat deleted file mode 100644 index 690dabf6..00000000 --- a/tools/build_win_vs2010.bat +++ /dev/null @@ -1,8 +0,0 @@ -set QTDIR=%1 -set PATH=%1\bin;%PATH%; -set QMAKESPEC=win32-msvc2010 -call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86 -@echo on -qmake -r charts.pro CONFIG+=%2 -@echo on -nmake diff --git a/tools/build_win_vs2010_64bit.bat b/tools/build_win_vs2010_64bit.bat deleted file mode 100644 index e89af2c8..00000000 --- a/tools/build_win_vs2010_64bit.bat +++ /dev/null @@ -1,8 +0,0 @@ -set QTDIR=%1 -set PATH=%1\bin;%PATH%; -set QMAKESPEC=win32-msvc2010 -call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" amd64 -@echo on -qmake -r charts.pro CONFIG+=%2 -@echo on -nmake diff --git a/tools/jobs.ini b/tools/jobs.ini deleted file mode 100644 index d29aea7a..00000000 --- a/tools/jobs.ini +++ /dev/null @@ -1,131 +0,0 @@ - -; How to use -; ---------- -; - Section name must match to "Job Name" in Bamboo. -; * See ${bamboo.buildPlanName} in bamboo. -; * Case sensitive. -; - The parameters given can be anything you need for that particular build. -; * Implement your special parameter handling in the perl scripts. - - -[Win7 MinGW debug QtC v4.8.0 (Jani's machine)] -Platform=Win7 -QtDir=D:\Qt\4.8.0-MinGW-Commercial -ToolChain=mingw -Config=debug -MinGWDir=D:\Qt\mingw - -[Win7 MinGW release QtC v4.8.0 (Jani's machine)] -Platform=Win7 -QtDir=D:\Qt\4.8.0-MinGW-Commercial -ToolChain=mingw -Config=release -MinGWDir=D:\Qt\mingw - -[Win7 vs2005 debug QtC v4.7.5 (Jani's machine)] -Platform=Win7 -QtDir=D:\Qt\qt-win-commercial-4.7.5-vs2005 -ToolChain=vs2005 -Config=debug - -[Win7 vs2005 release QtC v4.7.5 (Jani's machine)] -Platform=Win7 -QtDir=D:\Qt\qt-win-commercial-4.7.5-vs2005 -ToolChain=vs2005 -Config=release - -[Win7 vs2008 debug QtC v4.8.2 (Jani's machine)] -Platform=Win7 -QtDir=D:\Qt\qt-win-commercial-4.8.2-vs2008 -ToolChain=vs2008 -Config=debug - -[Win7 vs2008 release QtC v4.8.2 (Jani's machine)] -Platform=Win7 -QtDir=D:\Qt\qt-win-commercial-4.8.2-vs2008 -ToolChain=vs2008 -Config=release - -[Win7 vs2010 debug QtC v4.8.3 (Jani's machine)] -Platform=Win7 -QtDir=D:\Qt\qt-win-commercial-4.8.3-vs2010-2012-09-01 -ToolChain=vs2010 -Config=debug - -[Win7 vs2010 release QtC v4.8.3 (Jani's machine)] -Platform=Win7 -QtDir=D:\Qt\qt-win-commercial-4.8.3-vs2010-2012-09-01 -ToolChain=vs2010 -Config=release - -[Win7 vs2010 debug QtC v4.8.0 (Jani's machine)] -Platform=Win7 -QtDir=D:\Qt\qt-win-commercial-4.8.0-vs2010 -ToolChain=vs2010 -Config=debug - -[Win7 vs2010 release QtC v4.8.0 (Jani's machine)] -Platform=Win7 -QtDir=D:\Qt\qt-win-commercial-4.8.0-vs2010 -ToolChain=vs2010 -Config=release - -[Win7 vs2010-64bit debug QtC v4.8.1] -Platform=Win7 -QtDir=C:\Qt\4.8.1 -ToolChain=vs2010-64bit -Config=debug - -[Win7 vs2010-64bit release QtC v4.8.1] -Platform=Win7 -QtDir=C:\Qt\4.8.1 -ToolChain=vs2010-64bit -Config=release - -[Mac 10.7 Cocoa clang debug QtC v4.8.0 (Tero's iMac)] -Platform=Mac -QtDir=/Users/teahola/QtCommercialSdk/Desktop/480/cocoa_gcc -ToolChain=clang -Config=debug - -[Mac 10.7 Cocoa clang release QtC v4.8.0 (Tero's iMac)] -Platform=Mac -QtDir=/Users/teahola/QtCommercialSdk/Desktop/480/cocoa_gcc -ToolChain=clang -Config=release - -[Mac 10.7 Cocoa gcc debug QtC v4.8.0 (Tero's iMac)] -Platform=Mac -QtDir=/Users/teahola/QtCommercialSdk/Desktop/480/cocoa_gcc -ToolChain=gcc -Config=debug - -[Mac 10.7 Cocoa gcc release QtC v4.8.0 (Tero's iMac)] -Platform=Mac -QtDir=/Users/teahola/QtCommercialSdk/Desktop/480/cocoa_gcc -ToolChain=gcc -Config=release - -[Ubuntu 10.10 x86 debug QtC v4.8.1] -Platform=Linux -QtDir=/usr/local/Trolltech/Qt-4.8.1 -ToolChain=gcc -Config=debug - -[Ubuntu 10.10 x86 release QtC v4.8.1] -Platform=Linux -QtDir=/usr/local/Trolltech/Qt-4.8.1 -ToolChain=gcc -Config=release - -[Ubuntu 10.10 x86_64 debug QtC v4.8.1] -Platform=Linux -QtDir=/usr/local/Trolltech/Qt-4.8.1 -ToolChain=gcc -Config=debug - -[Ubuntu 10.10 x86_64 release QtC v4.8.1] -Platform=Linux -QtDir=/usr/local/Trolltech/Qt-4.8.1 -ToolChain=gcc -Config=release diff --git a/tools/run_tests.pl b/tools/run_tests.pl deleted file mode 100644 index f71fb304..00000000 --- a/tools/run_tests.pl +++ /dev/null @@ -1,95 +0,0 @@ -use Cwd; -use Cwd 'abs_path'; -use File::Basename; -use File::Copy; -use feature "switch"; -use lib 'tools'; -use Jobs; - -# read command line params -my $jobname = shift; - -# read ini file -my $inifile = File::Basename::dirname($0) . "/jobs.ini"; -my %job = Jobs::get($inifile, $jobname); - -# set/get paths -my $root_path = abs_path(); -my $bin_path = "$root_path/bin/" . $job{'Config'} . "/"; -my $reports_path = "test-reports"; - -# create reports path -mkdir $reports_path; - -# setup environment for running tests -given ($job{'Platform'}) { - - when ("Win7") { - # Add qtdir to path - $ENV{'PATH'} .= ";" . $job{'QtDir'} . "\\bin"; - - # replace / -> \ - $ENV{'PATH'} =~ s/\//\\/g; - } - - when ("Linux") { - # Add qtdir to path - $ENV{'PATH'} = $job{'QtDir'} . "/bin:" . $ENV{'PATH'}; - - # If this is not set we get "cannot connect to X server" errors - $ENV{'DISPLAY'} = ":0.0"; - } - - when ("Mac") { - # Set QML_IMPORT_PATH point to QML plugin dir - $ENV{'QML_IMPORT_PATH'} = $bin_path; - } -} - -# Go through all the files in the test folder -# autotest is an executable beginning with "tst_" -my $script_exit_status = 0; -opendir (TESTAPPDIR, "$bin_path") or die "Couldn't open test app dir"; -@files = <TESTAPPDIR>; -while ($testapp = readdir TESTAPPDIR) { - if (index($testapp, "tst_") == 0) { - if (-x "$bin_path$testapp") { - my $status = executeTestApp($testapp); - if ($status != 0) { - $script_exit_status = $status; - } - } else { - #print "file $testapp not executable\n"; - } - } -} -closedir TESTAPPDIR; - -print "\n*** script exit status : $script_exit_status ***\n\n"; -exit($script_exit_status); - - -sub executeTestApp($) { - my $testapp = $_[0]; - - # On OSX the actual test binary is in a sub folder - my $cmd_postfix = ""; - if ($^O eq "darwin") { - $cmd_postfix = "/Contents/MacOS/$testapp"; - $cmd_postfix = substr($cmd_postfix, 0, rindex($cmd_postfix, ".app")); - } - - my $cmd = "$bin_path$testapp$cmd_postfix -xunitxml -o $reports_path/$testapp.xml"; - print "executing: $cmd\n"; - system($cmd); - - # From http://perldoc.perl.org/perlvar.html about $?: - # The upper eight bits reflect specific error conditions encountered by the - # program (the program's exit() value). The lower eight bits reflect - # mode of failure, like signal death and core dump information. - # See wait(2) for details. - my $exit_status = $? >> 8; - print "\texit status: $exit_status\n"; - - return $exit_status; -} |