Project spec and config to be taken from a dir instead of from a repo
authordarios@symbian.org
Fri, 29 May 2009 16:03:16 +0100
changeset 16 e1b9f78cef38
parent 15 45ed0efeb8a4
child 17 d75feffe620f
Project spec and config to be taken from a dir instead of from a repo
bootstrap.xml
build_package.pl
--- a/bootstrap.xml	Thu May 28 15:03:22 2009 +0100
+++ b/bootstrap.xml	Fri May 29 16:03:16 2009 +0100
@@ -35,29 +35,51 @@
   </target>
 
   <target name="get-sf-config">
-    <echo message="Getting sf helium configuration from repository ${sf.config.repo}"/>
-    <hlm:scm verbose="true" scmUrl="scm:hg:${sf.config.repo}">
-      <hlm:checkout basedir="${sf.target.dir}/sf-config"/>
-      <hlm:tags basedir="${sf.target.dir}/sf-config" reference="hg.tags.id${refid}"/>
-      <hlm:update basedir="${sf.target.dir}/sf-config">
-        <hlm:latestTag pattern="${sf.config.rev}">
-          <hlm:tagSet refid="hg.tags.id${refid}"/> 
-        </hlm:latestTag>
-      </hlm:update>
-    </hlm:scm>
+    <if>
+      <isset property="sf.config.dir"/>
+      <then>
+        <echo message="Getting FBF configuration from dir ${sf.config.dir}"/>
+        <copy todir="${sf.target.dir}/sf-config">
+          <fileset dir="${sf.config.dir}"/>
+        </copy>
+      </then>
+      <else>
+        <echo message="Getting FBF configuration from repository ${sf.config.repo}"/>
+        <hlm:scm verbose="true" scmUrl="scm:hg:${sf.config.repo}">
+          <hlm:checkout basedir="${sf.target.dir}/sf-config"/>
+          <hlm:tags basedir="${sf.target.dir}/sf-config" reference="hg.tags.id${refid}"/>
+          <hlm:update basedir="${sf.target.dir}/sf-config">
+            <hlm:latestTag pattern="${sf.config.rev}">
+              <hlm:tagSet refid="hg.tags.id${refid}"/> 
+            </hlm:latestTag>
+          </hlm:update>
+        </hlm:scm>
+      </else>
+    </if>
   </target>
 
   <target name="get-sf-project">
-    <echo message="Getting project configuration${sf.project.repo}"/>
-    <hlm:scm verbose="true" scmUrl="scm:hg:${sf.project.repo}">
-      <hlm:checkout basedir="${sf.target.dir}/build/config"/>
-      <hlm:tags basedir="${sf.target.dir}/build/config" reference="hg.tags.id${refid}"/>
-      <hlm:update basedir="${sf.target.dir}/build/config">
-        <hlm:latestTag pattern="${sf.project.rev}">
-          <hlm:tagSet refid="hg.tags.id${refid}"/>
-        </hlm:latestTag>
-      </hlm:update>
-    </hlm:scm>
+    <if>
+      <isset property="sf.project.dir"/>
+      <then>
+        <echo message="Getting FBF project from dir ${sf.config.dir}"/>
+        <copy todir="${sf.target.dir}/build/config">
+          <fileset dir="${sf.config.dir}"/>
+        </copy>
+      </then>
+      <else>
+        <echo message="Getting FBF project from repository ${sf.project.repo}"/>
+        <hlm:scm verbose="true" scmUrl="scm:hg:${sf.project.repo}">
+          <hlm:checkout basedir="${sf.target.dir}/build/config"/>
+          <hlm:tags basedir="${sf.target.dir}/build/config" reference="hg.tags.id${refid}"/>
+          <hlm:update basedir="${sf.target.dir}/build/config">
+            <hlm:latestTag pattern="${sf.project.rev}">
+              <hlm:tagSet refid="hg.tags.id${refid}"/>
+            </hlm:latestTag>
+          </hlm:update>
+        </hlm:scm>
+      </else>
+    </if>
   </target>
 
 
--- a/build_package.pl	Thu May 28 15:03:22 2009 +0100
+++ b/build_package.pl	Fri May 29 16:03:16 2009 +0100
@@ -18,23 +18,26 @@
 use Getopt::Long;
 use File::Path;
 
-my $sBOOTSTRAP_DIR="D:\\Helium\\hlm-apps\\bootstrap";
+my $sBOOTSTRAP_DIR="C:\\Apps\\FBF\\bootstrap";
 my $sJOB_BASE_DIR="D:\\fbf_project";
-my $sCONFIG_REPO="\\\\lon-engbuild87\\d\$\\mercurial_development\\oss\\FCL\\interim\\fbf\\configs\\pkgbuild";
 my $nMAX_JOBDIR_AGE_SECONDS = 86400; # max number of seconds after which the letter is forcibly released
 my $nLOCK_FILE_MAX_ATTEMPTS = 5;
-my $sNUMBERS_FILE="\\\\sym-build01\\f\$\\numbers.txt";
+#my $sNUMBERS_FILE="\\\\sym-build01\\f\$\\numbers.txt";
+my $sNUMBERS_FILE="d:\\numbers.txt";
 my $sLETTERS_FILE="D:\\letters.txt";
 my $nMAX_LETTER_AGE_SECONDS = 86400; # max number of seconds after which the letter is forcibly released
 
-my $sProjectRepo = '';
+my $sFbfProjectRepo = '';
+my $sFbfProjectDir = '';
+my $sFbfConfigRepo="\\\\lon-engbuild87\\d\$\\mercurial_development\\oss\\FCL\\interim\\fbf\\configs\\pkgbuild";
+my $sFbfConfigDir = '';
 my $sJobLabel = '';
 my $nCmdLineNumber;
-GetOptions(('label:s' => \$sJobLabel, 'project:s' => \$sProjectRepo, 'number:s' => \$nCmdLineNumber));
+GetOptions(('label:s' => \$sJobLabel, 'configrepo:s' => \$sFbfConfigRepo, 'configdir:s' => \$sFbfConfigDir, 'projectrepo:s' => \$sFbfProjectRepo, 'projectdir:s' => \$sFbfProjectDir, 'number:s' => \$nCmdLineNumber));
 
-if (!$sJobLabel or !$sProjectRepo)
+if (!$sJobLabel or !$sFbfProjectRepo)
 {
-	print "Usage: build_package.pl --label=<label> --project=<project_repo>\n";
+	print "Usage: build_package.pl --label=<label> --projectrepo=<project repo> | --projectdir=<project dir>\n\t[--configrepo=<config repo> | --configdir=<config dir>]\n";
 	exit(0);
 }
 
@@ -43,8 +46,12 @@
 print("cd $sBOOTSTRAP_DIR\n");
 chdir("$sBOOTSTRAP_DIR");
 print "###### BOOTSTRAP ######\n";
-print("hlm -f bootstrap.xml -Dsf.config.repo=$sCONFIG_REPO -Dsf.project.repo=$sProjectRepo -Dsf.target.dir=$sJobDir\n");
-system("hlm -f bootstrap.xml -Dsf.config.repo=$sCONFIG_REPO -Dsf.project.repo=$sProjectRepo -Dsf.target.dir=$sJobDir");
+my $sConfigArg = "-Dsf.config.repo=$sFbfConfigRepo";
+$sConfigArg = "-Dsf.config.dir=$sFbfConfigDir" if ($sFbfConfigDir);
+my $sProjectArg = "-Dsf.project.repo=$sFbfProjectRepo";
+$sProjectArg = "-Dsf.project.dir=$sFbfProjectDir" if ($sFbfProjectDir);
+print("hlm -f bootstrap.xml $sConfigArg $sProjectArg -Dsf.target.dir=$sJobDir\n");
+system("hlm -f bootstrap.xml $sConfigArg $sProjectArg -Dsf.target.dir=$sJobDir");
 
 # check that $sNUMBERS_FILE exists, otherwise create it
 if (!-f $sNUMBERS_FILE)
@@ -54,7 +61,7 @@
 	close FILE;
 }
 
-my $nUnformattedNumber = ( $nCmdLineNumber ? $nCmdLineNumber : get_job_number($sProjectRepo));
+my $nUnformattedNumber = ( $nCmdLineNumber ? $nCmdLineNumber : get_job_number($sFbfProjectRepo));
 my $nJobNumber = sprintf("%.3d", $nUnformattedNumber);
 
 # check that $sLETTERS_FILE exists, otherwise create it