build_package.pl
changeset 24 ed4e68942437
parent 22 7a9425957569
child 25 234b5eb2dcfe
equal deleted inserted replaced
22:7a9425957569 24:ed4e68942437
    43 
    43 
    44 if (!$sFbfProjectRepo and !$sFbfProjectDir)
    44 if (!$sFbfProjectRepo and !$sFbfProjectDir)
    45 {
    45 {
    46 	print "Usage: build_package.pl --projectrepo=REPO [OPTIONS]\n";
    46 	print "Usage: build_package.pl --projectrepo=REPO [OPTIONS]\n";
    47 	print "where OPTIONS are:\n";
    47 	print "where OPTIONS are:\n";
    48 	print "\t--projectrepo=REPO Use REPO location for the project.\n";
    48 	print "\t--projectrepo=REPO[#REV] Use repository REPO at revision REV for the project.\n";
    49 	print "\t--projectdir=DIR Use DIR location for the project (exclusive with --projectrepo). Option --testbuild is required.\n";
    49 	print "\t--projectdir=DIR Use DIR location for the project (exclusive with --projectrepo). Option --testbuild is required.\n";
    50 	print "\t--configrepo=REPO Use REPO location for the config instead of \\\\bishare\\mercurial_internal\\fbf\\config\\pkgbuild\n";
    50 	print "\t--configrepo=REPO[#REV] Use repository REPO at revision REV for the config (instead of \\\\bishare\\mercurial_internal\\fbf\\config\\pkgbuild)\n";
    51 	print "\t--configdir=DIR Use DIR location for the config (exclusive with --configrepo). Option --testbuild is required.\n";
    51 	print "\t--configdir=DIR Use DIR location for the config (exclusive with --configrepo). Option --testbuild is required.\n";
    52 	print "\t--number=N Force build number to N\n";
    52 	print "\t--number=N Force build number to N\n";
    53 	print "\t--testbuild Use d:\\numbers_test.txt for numbers and disable publishing\n";
    53 	print "\t--testbuild Use d:\\numbers_test.txt for numbers and disable publishing\n";
    54 	exit(0);
    54 	exit(0);
    55 }
    55 }
    62 
    62 
    63 if ($sFbfConfigDir and !$bTestBuild)
    63 if ($sFbfConfigDir and !$bTestBuild)
    64 {
    64 {
    65 	print "Error: Option --configdir requires --testbuild\n";
    65 	print "Error: Option --configdir requires --testbuild\n";
    66 	exit(0);
    66 	exit(0);
       
    67 }
       
    68 
       
    69 my $sFbfProjectRev = '';
       
    70 if ($sFbfProjectRepo =~ m,(.*)#(.*),)
       
    71 {
       
    72 	$sFbfProjectRepo = $1;
       
    73 	$sFbfProjectRev = $2;
       
    74 }
       
    75 my $sFbfConfigRev = '';
       
    76 if ($sFbfConfigRepo =~ m,(.*)#(.*),)
       
    77 {
       
    78 	$sFbfConfigRepo = $1;
       
    79 	$sFbfConfigRev = $2;
    67 }
    80 }
    68 
    81 
    69 my $sTestBuildOpts = "";
    82 my $sTestBuildOpts = "";
    70 $sTestBuildOpts = "-Dsf.spec.publish.enable=false" if ( $bTestBuild );
    83 $sTestBuildOpts = "-Dsf.spec.publish.enable=false" if ( $bTestBuild );
    71 $sNUMBERS_FILE = "d:\\numbers_test.txt" if ( $bTestBuild );
    84 $sNUMBERS_FILE = "d:\\numbers_test.txt" if ( $bTestBuild );
    80 
    93 
    81 print("cd $sBOOTSTRAP_DIR\n");
    94 print("cd $sBOOTSTRAP_DIR\n");
    82 chdir("$sBOOTSTRAP_DIR");
    95 chdir("$sBOOTSTRAP_DIR");
    83 print "###### BOOTSTRAP ######\n";
    96 print "###### BOOTSTRAP ######\n";
    84 my $sConfigArg = "-Dsf.config.repo=$sFbfConfigRepo";
    97 my $sConfigArg = "-Dsf.config.repo=$sFbfConfigRepo";
       
    98 $sConfigArg .= " -Dsf.config.rev=$sFbfConfigRev" if ($sFbfConfigRev);
    85 $sConfigArg = "-Dsf.config.dir=$sFbfConfigDir" if ($sFbfConfigDir);
    99 $sConfigArg = "-Dsf.config.dir=$sFbfConfigDir" if ($sFbfConfigDir);
    86 my $sProjectArg = "-Dsf.project.repo=$sFbfProjectRepo";
   100 my $sProjectArg = "-Dsf.project.repo=$sFbfProjectRepo";
       
   101 $sProjectArg .= " -Dsf.project.rev=$sFbfProjectRev" if ($sFbfProjectRev);
    87 $sProjectArg = "-Dsf.project.dir=$sFbfProjectDir" if ($sFbfProjectDir);
   102 $sProjectArg = "-Dsf.project.dir=$sFbfProjectDir" if ($sFbfProjectDir);
    88 print("hlm -f bootstrap.xml $sConfigArg $sProjectArg -Dsf.target.dir=$sJobDir\n");
   103 print("hlm -f bootstrap.xml $sConfigArg $sProjectArg -Dsf.target.dir=$sJobDir\n");
    89 system("hlm -f bootstrap.xml $sConfigArg $sProjectArg -Dsf.target.dir=$sJobDir");
   104 system("hlm -f bootstrap.xml $sConfigArg $sProjectArg -Dsf.target.dir=$sJobDir");
    90 
   105 
    91 # check that $sNUMBERS_FILE exists, otherwise create it
   106 # check that $sNUMBERS_FILE exists, otherwise create it