Support for passing -D options to Helium
authorDario Sestito <darios@symbian.org>
Fri, 09 Oct 2009 12:34:29 +0100
changeset 49 07eb981b2b45
parent 48 5e2200d13067
child 50 e8b76d25d90c
Support for passing -D options to Helium
build_package.pl
--- a/build_package.pl	Mon Oct 05 13:42:08 2009 +0100
+++ b/build_package.pl	Fri Oct 09 12:34:29 2009 +0100
@@ -39,6 +39,7 @@
 my $sDiamondsTag = '';
 my $bHudson = 0;
 my $bPublish = 1;
+my %hHlmDefines = ();
 my $bHelp = 0;
 GetOptions((
 	'configrepo=s' => \$sFbfConfigRepo,
@@ -53,6 +54,7 @@
 	'tag=s' => \$sDiamondsTag,
 	'hudson!' => \$bHudson,
 	'publish!' => \$bPublish,
+	'define=s' => \%hHlmDefines,
 	'help!' => \$bHelp
 ));
 
@@ -73,6 +75,7 @@
 	print "\t--tag=TAG Apply Diamonds tag TAG to this build (exclusive with --production)\n";
 	print "\t--hudson Checks that there is at least NUMBER_OF_PROCESSORS X 10 GB available on the working drive\n";
 	print "\t--nopublish Use \\numbers_test.txt for numbers and disable publishing\n";
+	print "\t--define ATTRIBUTE=VALUE Pass -D statements to the Helium Framework\n";
 	exit(0);
 }
 
@@ -125,6 +128,12 @@
 	$sFbfConfigRev = $2;
 }
 
+my $sHlmDefineOpt = '';
+for (keys %hHlmDefines)
+{
+	$sHlmDefineOpt .= "-D$_=$hHlmDefines{$_} ";
+}
+
 my $sTestBuildOpt = "";
 $sTestBuildOpt = "-Dsf.spec.publish.diamonds.tag=production" if ( $bProduction );
 $sTestBuildOpt = "-Dsf.spec.publish.diamonds.tag=$sDiamondsTag" if ( $sDiamondsTag );
@@ -239,7 +248,7 @@
 print("cd $sJobDir\\sf-config\n");
 chdir("$sJobDir\\sf-config");
 print "###### BUILD PREPARATION ######\n";
-my $sPreparationCmd = "hlm sf-prep -Dsf.project.type=package $sSubProjArg -Dsf.spec.job.number=$nJobNumber -Dsf.spec.job.drive=$sDriveLetter: $sTestBuildOpt $sNoPublishOpt $sJobRootDirArg";
+my $sPreparationCmd = "hlm sf-prep -Dsf.project.type=package $sSubProjArg -Dsf.spec.job.number=$nJobNumber -Dsf.spec.job.drive=$sDriveLetter: $sTestBuildOpt $sNoPublishOpt $sJobRootDirArg $sHlmDefineOpt";
 print("$sPreparationCmd\n");
 open(LOG, ">console_sfprep_$$.txt");
 open(PIPE, "$sPreparationCmd 2>&1 |");
@@ -252,7 +261,7 @@
 close(LOG);
 
 print "###### EXECUTE BUILD ######\n";
-my $sBuildallCmd = "hlm sf-build-all -Dsf.project.type=package $sSubProjArg -Dsf.spec.job.number=$nJobNumber -Dsf.spec.job.drive=$sDriveLetter: $sTestBuildOpt $sNoPublishOpt $sJobRootDirArg";
+my $sBuildallCmd = "hlm sf-build-all -Dsf.project.type=package $sSubProjArg -Dsf.spec.job.number=$nJobNumber -Dsf.spec.job.drive=$sDriveLetter: $sTestBuildOpt $sNoPublishOpt $sJobRootDirArg $sHlmDefineOpt";
 print("$sBuildallCmd\n");
 open(LOG, ">console_sfbuildall_$$.txt");
 open(PIPE, "$sBuildallCmd 2>&1 |");
@@ -265,7 +274,7 @@
 close(LOG);
 
 print "###### GENERATE BUILD SUMMARY ######\n";
-my $sSummaryCmd = "hlm sf-summary -Dsf.project.type=package $sSubProjArg -Dsf.spec.job.number=$nJobNumber -Dsf.spec.job.drive=$sDriveLetter: $sTestBuildOpt $sNoPublishOpt $sJobRootDirArg";
+my $sSummaryCmd = "hlm sf-summary -Dsf.project.type=package $sSubProjArg -Dsf.spec.job.number=$nJobNumber -Dsf.spec.job.drive=$sDriveLetter: $sTestBuildOpt $sNoPublishOpt $sJobRootDirArg $sHlmDefineOpt";
 print("$sSummaryCmd\n");
 open(LOG, ">console_sfsummary_$$.txt");
 open(PIPE, "$sSummaryCmd 2>&1 |");