build_package.pl
changeset 55 0d56e5b89632
parent 53 ae4992ce7268
child 56 05cec3e671db
equal deleted inserted replaced
54:e643758258cb 55:0d56e5b89632
    27 my $nMAX_LETTER_AGE_SECONDS = 86400; # max number of seconds after which the letter is forcibly released
    27 my $nMAX_LETTER_AGE_SECONDS = 86400; # max number of seconds after which the letter is forcibly released
    28 
    28 
    29 my $sFbfProjectRepo = "\\\\bishare\\mercurial_development\\oss\\FCL\\interim\\fbf\\projects\\packages";
    29 my $sFbfProjectRepo = "\\\\bishare\\mercurial_development\\oss\\FCL\\interim\\fbf\\projects\\packages";
    30 my $sFbfProjectDir = '';
    30 my $sFbfProjectDir = '';
    31 my $sSubProject = '';
    31 my $sSubProject = '';
       
    32 my $sSubprojVariant = '';
       
    33 my $bRVCT4 = 0;
    32 #my $sSourcesFile = '';
    34 #my $sSourcesFile = '';
    33 #my $sModelFile = '';
    35 #my $sModelFile = '';
    34 my $sFbfConfigRepo="\\\\bishare\\mercurial_development\\oss\\FCL\\interim\\fbf\\configs\\default";
    36 my $sFbfConfigRepo="\\\\bishare\\mercurial_development\\oss\\FCL\\interim\\fbf\\configs\\default";
    35 my $sFbfConfigDir = '';
    37 my $sFbfConfigDir = '';
    36 my $nCmdLineNumber;
    38 my $nCmdLineNumber;
    43 	'configrepo=s' => \$sFbfConfigRepo,
    45 	'configrepo=s' => \$sFbfConfigRepo,
    44 	'configdir=s' => \$sFbfConfigDir,
    46 	'configdir=s' => \$sFbfConfigDir,
    45 	'projectrepo=s' => \$sFbfProjectRepo,
    47 	'projectrepo=s' => \$sFbfProjectRepo,
    46 	'projectdir=s' => \$sFbfProjectDir,
    48 	'projectdir=s' => \$sFbfProjectDir,
    47 	'subproj=s' => \$sSubProject,
    49 	'subproj=s' => \$sSubProject,
       
    50 	'variant=s' => \$sSubprojVariant,
       
    51 	'rvct4!' => \$bRVCT4,
    48 	#'sources=s' => \$sSourcesFile,
    52 	#'sources=s' => \$sSourcesFile,
    49 	#'model=s' => \$sModelFile,
    53 	#'model=s' => \$sModelFile,
    50 	'number=s' => \$nCmdLineNumber,
    54 	'number=s' => \$nCmdLineNumber,
    51 	'tag=s' => \$sDiamondsTag,
    55 	'tag=s' => \$sDiamondsTag,
    52 	'hudson!' => \$bHudson,
    56 	'hudson!' => \$bHudson,
    59 {
    63 {
    60 	print "Usage: build_package.pl --subproj=RELPATH [OPTIONS]\n";
    64 	print "Usage: build_package.pl --subproj=RELPATH [OPTIONS]\n";
    61 	print "       build_package.pl --projectrepo=REPO [OPTIONS]\n";
    65 	print "       build_package.pl --projectrepo=REPO [OPTIONS]\n";
    62 	print "where OPTIONS are:\n";
    66 	print "where OPTIONS are:\n";
    63 	print "\t--subproj=RELPATH Select subproject located at RELPATH (relative to the root of the project repository)\n";
    67 	print "\t--subproj=RELPATH Select subproject located at RELPATH (relative to the root of the project repository)\n";
       
    68 	print "\t--variant=VARIANT If specified use sources_VARIANT.csv instead of sources.csv and add \"VARIANT\" as tag for this build\n";
       
    69 	print "\t--rvct4 Enable build with RVCT4 on top of the other targets\n";
    64 	print "\t--projectrepo=REPO[#REV] Use repository REPO at revision REV for the project (instead of \\\\bishare\\mercurial_internal\\fbf\\projects\\packages)\n";
    70 	print "\t--projectrepo=REPO[#REV] Use repository REPO at revision REV for the project (instead of \\\\bishare\\mercurial_internal\\fbf\\projects\\packages)\n";
    65 	print "\t--projectdir=DIR Use DIR location for the project (exclusive with --projectrepo).\n";
    71 	print "\t--projectdir=DIR Use DIR location for the project (exclusive with --projectrepo).\n";
    66 	#print "\t--sources=FILE ...\n";
    72 	#print "\t--sources=FILE ...\n";
    67 	#print "\t--model=FILE ...\n";
    73 	#print "\t--model=FILE ...\n";
    68 	print "\t--configrepo=REPO[#REV] Use repository REPO at revision REV for the config (instead of \\\\bishare\\mercurial_internal\\fbf\\config\\default)\n";
    74 	print "\t--configrepo=REPO[#REV] Use repository REPO at revision REV for the config (instead of \\\\bishare\\mercurial_internal\\fbf\\config\\default)\n";
   122 for (keys %hHlmDefines)
   128 for (keys %hHlmDefines)
   123 {
   129 {
   124 	$sHlmDefineOpt .= "-D$_=$hHlmDefines{$_} ";
   130 	$sHlmDefineOpt .= "-D$_=$hHlmDefines{$_} ";
   125 }
   131 }
   126 
   132 
   127 my $sTestBuildOpt = "";
       
   128 $sTestBuildOpt = "-Dsf.spec.publish.diamonds.tag=\"$sDiamondsTag\"" if ( $sDiamondsTag );
       
   129 my $sNoPublishOpt = "";
   133 my $sNoPublishOpt = "";
   130 $sNoPublishOpt = "-Dsf.spec.publish.enable=false" if ( !$bPublish );
   134 $sNoPublishOpt = "-Dsf.spec.publish.enable=false" if ( !$bPublish );
   131 $sNUMBERS_FILE = "$sWORKING_DRIVE\\numbers_test.txt" if ( !$bPublish );
   135 $sNUMBERS_FILE = "$sWORKING_DRIVE\\numbers_test.txt" if ( !$bPublish );
   132 
   136 
   133 my $sJobLabel = 'job';
   137 my $sJobLabel = 'job';
   222 
   226 
   223 my $sJobRootDirArg = "-Dsf.spec.job.rootdir=$sWORKING_DRIVE\\fbf_job";
   227 my $sJobRootDirArg = "-Dsf.spec.job.rootdir=$sWORKING_DRIVE\\fbf_job";
   224 
   228 
   225 my $sSubProjArg = '';
   229 my $sSubProjArg = '';
   226 $sSubProjArg = "-Dsf.subproject.path=$sSubProject" if ($sSubProject);
   230 $sSubProjArg = "-Dsf.subproject.path=$sSubProject" if ($sSubProject);
       
   231 my $sVariantArg = '';
       
   232 $sVariantArg = "-Dsf.spec.sourcesync.sourcespecfile=sources_$sSubprojVariant.csv" if ($sSubprojVariant);
       
   233 my $sRVCT4Arg = '';
       
   234 $sRVCT4Arg = "-Dsf.spec.sbs.config=tools2_rel.whatlog,tools2_rel.whatlog.rvct4,winscw.whatlog,winscw.whatlog.rvct4,armv5.whatlog,armv5.whatlog.rvct4" if ($bRVCT4);
       
   235 my $sAllTags = '';
       
   236 $sAllTags = $sDiamondsTag if ($sDiamondsTag);
       
   237 $sAllTags .= ',' if ($sAllTags and $sSubprojVariant);
       
   238 $sAllTags .= $sSubprojVariant if ($sSubprojVariant);
       
   239 my $sTagsArg = "";
       
   240 $sTagsArg = "-Dsf.spec.publish.diamonds.tag=\"$sAllTags\"" if ($sAllTags);
   227 print("cd $sJobDir\\sf-config\n");
   241 print("cd $sJobDir\\sf-config\n");
   228 chdir("$sJobDir\\sf-config");
   242 chdir("$sJobDir\\sf-config");
   229 print "###### BUILD PREPARATION ######\n";
   243 print "###### BUILD PREPARATION ######\n";
   230 my $sPreparationCmd = "hlm sf-prep -Dsf.project.type=package $sSubProjArg -Dsf.spec.job.number=$nJobNumber -Dsf.spec.job.drive=$sDriveLetter: $sTestBuildOpt $sNoPublishOpt $sJobRootDirArg $sHlmDefineOpt";
   244 my $sPreparationCmd = "hlm sf-prep -Dsf.project.type=package $sSubProjArg -Dsf.spec.job.number=$nJobNumber -Dsf.spec.job.drive=$sDriveLetter: $sTagsArg $sNoPublishOpt $sJobRootDirArg $sHlmDefineOpt $sVariantArg $sRVCT4Arg";
   231 print("$sPreparationCmd\n");
   245 print("$sPreparationCmd\n");
   232 system($sPreparationCmd);
   246 system($sPreparationCmd);
   233 
   247 
   234 print "###### EXECUTE BUILD ######\n";
   248 print "###### EXECUTE BUILD ######\n";
   235 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";
   249 my $sBuildallCmd = "hlm sf-build-all -Dsf.project.type=package $sSubProjArg -Dsf.spec.job.number=$nJobNumber -Dsf.spec.job.drive=$sDriveLetter: $sTagsArg $sNoPublishOpt $sJobRootDirArg $sHlmDefineOpt $sVariantArg $sRVCT4Arg";
   236 print("$sBuildallCmd\n");
   250 print("$sBuildallCmd\n");
   237 system($sBuildallCmd);
   251 system($sBuildallCmd);
   238 
   252 
   239 print("cd $sBOOTSTRAP_DIR\n");
   253 print("cd $sBOOTSTRAP_DIR\n");
   240 chdir("$sBOOTSTRAP_DIR");
   254 chdir("$sBOOTSTRAP_DIR");