build_package.pl
changeset 75 2a106c5499cb
parent 74 72cc60784b23
child 76 fe2cee402e0a
equal deleted inserted replaced
74:72cc60784b23 75:2a106c5499cb
    28 
    28 
    29 my $sFbfProjectRepo = "http://developer.symbian.org/oss/MCL/sftools/fbf/projects/packages";
    29 my $sFbfProjectRepo = "http://developer.symbian.org/oss/MCL/sftools/fbf/projects/packages";
    30 my $sFbfProjectDir = '';
    30 my $sFbfProjectDir = '';
    31 my $sSubProject = '';
    31 my $sSubProject = '';
    32 my $sSubprojVariant = '';
    32 my $sSubprojVariant = '';
       
    33 my $sSourcesRevision = '';
    33 my $sSBSConfig = '';
    34 my $sSBSConfig = '';
    34 #my $sSourcesFile = '';
    35 #my $sSourcesFile = '';
    35 #my $sModelFile = '';
    36 #my $sModelFile = '';
    36 my $sFbfConfigRepo="http://developer.symbian.org/oss/MCL/sftools/fbf/configs/default";
    37 my $sFbfConfigRepo="http://developer.symbian.org/oss/MCL/sftools/fbf/configs/default";
    37 my $sFbfConfigDir = '';
    38 my $sFbfConfigDir = '';
    48 	'configdir=s' => \$sFbfConfigDir,
    49 	'configdir=s' => \$sFbfConfigDir,
    49 	'projectrepo=s' => \$sFbfProjectRepo,
    50 	'projectrepo=s' => \$sFbfProjectRepo,
    50 	'projectdir=s' => \$sFbfProjectDir,
    51 	'projectdir=s' => \$sFbfProjectDir,
    51 	'subproj=s' => \$sSubProject,
    52 	'subproj=s' => \$sSubProject,
    52 	'variant=s' => \$sSubprojVariant,
    53 	'variant=s' => \$sSubprojVariant,
       
    54 	'sourcesrev' => \$sSourcesRevision,
    53 	'sbsconfig=s' => \$sSBSConfig,
    55 	'sbsconfig=s' => \$sSBSConfig,
    54 	#'sources=s' => \$sSourcesFile,
    56 	#'sources=s' => \$sSourcesFile,
    55 	#'model=s' => \$sModelFile,
    57 	#'model=s' => \$sModelFile,
    56 	'number=s' => \$nCmdLineNumber,
    58 	'number=s' => \$nCmdLineNumber,
    57 	'tag=s' => \$sDiamondsTag,
    59 	'tag=s' => \$sDiamondsTag,
    68 	print "Usage: build_package.pl --subproj=RELPATH [OPTIONS]\n";
    70 	print "Usage: build_package.pl --subproj=RELPATH [OPTIONS]\n";
    69 	print "       build_package.pl --projectrepo=REPO [OPTIONS]\n";
    71 	print "       build_package.pl --projectrepo=REPO [OPTIONS]\n";
    70 	print "where OPTIONS are:\n";
    72 	print "where OPTIONS are:\n";
    71 	print "\t--subproj=RELPATH Select subproject located at RELPATH (relative to the root of the project repository)\n";
    73 	print "\t--subproj=RELPATH Select subproject located at RELPATH (relative to the root of the project repository)\n";
    72 	print "\t--variant=VARIANT If specified use sources_VARIANT.csv instead of sources.csv and add \"VARIANT\" as tag for this build\n";
    74 	print "\t--variant=VARIANT If specified use sources_VARIANT.csv instead of sources.csv and add \"VARIANT\" as tag for this build\n";
       
    75 	print "\t--sourcesrev=REV Sync source repos at revision REV (overrides the revision specified in sources.csv). Note this is the same for all source repos.\n";
    73 	print "\t--sbsconfig=CONFIG Pass on CONFIG as configuration to SBS (can also be a comma separated list, e.g. 'armv5,winscw')\n";
    76 	print "\t--sbsconfig=CONFIG Pass on CONFIG as configuration to SBS (can also be a comma separated list, e.g. 'armv5,winscw')\n";
    74 	print "\t--projectrepo=REPO[#REV] Use repository REPO at revision REV for the project (instead of http://developer.symbian.org/oss/MCL/sftools/fbf/projects/packages)\n";
    77 	print "\t--projectrepo=REPO[#REV] Use repository REPO at revision REV for the project (instead of http://developer.symbian.org/oss/MCL/sftools/fbf/projects/packages)\n";
    75 	print "\t--projectdir=DIR Use DIR location for the project (exclusive with --projectrepo).\n";
    78 	print "\t--projectdir=DIR Use DIR location for the project (exclusive with --projectrepo).\n";
    76 	#print "\t--sources=FILE ...\n";
    79 	#print "\t--sources=FILE ...\n";
    77 	#print "\t--model=FILE ...\n";
    80 	#print "\t--model=FILE ...\n";
   239 
   242 
   240 my $sSubProjArg = '';
   243 my $sSubProjArg = '';
   241 $sSubProjArg = "-Dsf.subproject.path=$sSubProject" if ($sSubProject);
   244 $sSubProjArg = "-Dsf.subproject.path=$sSubProject" if ($sSubProject);
   242 my $sVariantArg = '';
   245 my $sVariantArg = '';
   243 $sVariantArg = "-Dsf.spec.sourcesync.sourcespecfile=sources_$sSubprojVariant.csv" if ($sSubprojVariant);
   246 $sVariantArg = "-Dsf.spec.sourcesync.sourcespecfile=sources_$sSubprojVariant.csv" if ($sSubprojVariant);
       
   247 my $sSourcesRevisionArg = '';
       
   248 $sSourcesRevisionArg = "-Dsf.spec.sources.revision=\"$sSourcesRevision\"" if ($sSourcesRevision);
   244 my $sSBSConfigArg = '';
   249 my $sSBSConfigArg = '';
   245 $sSBSConfigArg = "-Dsf.spec.sbs.config=\"$sSBSConfig\"" if ($sSBSConfig);
   250 $sSBSConfigArg = "-Dsf.spec.sbs.config=\"$sSBSConfig\"" if ($sSBSConfig);
   246 my $sAllTags = '';
   251 my $sAllTags = '';
   247 $sAllTags = $sDiamondsTag if ($sDiamondsTag);
   252 $sAllTags = $sDiamondsTag if ($sDiamondsTag);
   248 $sAllTags .= ',' if ($sAllTags and $sSubprojVariant);
   253 $sAllTags .= ',' if ($sAllTags and $sSubprojVariant);
   250 my $sTagsArg = "";
   255 my $sTagsArg = "";
   251 $sTagsArg = "-Dsf.spec.publish.diamonds.tag=\"$sAllTags\"" if ($sAllTags);
   256 $sTagsArg = "-Dsf.spec.publish.diamonds.tag=\"$sAllTags\"" if ($sAllTags);
   252 print("cd $sJobDir\\sf-config\n");
   257 print("cd $sJobDir\\sf-config\n");
   253 chdir("$sJobDir\\sf-config");
   258 chdir("$sJobDir\\sf-config");
   254 print "###### BUILD PREPARATION ######\n";
   259 print "###### BUILD PREPARATION ######\n";
   255 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 $sSBSConfigArg";
   260 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 $sSourcesRevisionArg $sSBSConfigArg";
   256 print("$sPreparationCmd\n");
   261 print("$sPreparationCmd\n");
   257 system($sPreparationCmd);
   262 system($sPreparationCmd);
   258 
   263 
   259 print "###### EXECUTE BUILD ######\n";
   264 print "###### EXECUTE BUILD ######\n";
   260 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 $sSBSConfigArg";
   265 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 $sSourcesRevisionArg $sSBSConfigArg";
   261 print("$sBuildallCmd\n");
   266 print("$sBuildallCmd\n");
   262 system($sBuildallCmd);
   267 system($sBuildallCmd);
   263 
   268 
   264 print("cd $sBOOTSTRAP_DIR\n");
   269 print("cd $sBOOTSTRAP_DIR\n");
   265 chdir("$sBOOTSTRAP_DIR");
   270 chdir("$sBOOTSTRAP_DIR");