| <?xml version="1.0" encoding="UTF-8"?> |
| <project |
| name="runbuild" |
| default="runbuild" |
| basedir="."> |
| |
| <!-- = = = standard properties pattern = = = --> |
| <!-- |
| Note to be cross-platform, "environment variables" are only |
| appropriate for some variables, e.g. ones we set, since |
| properties are case sensitive, even if the environment variables |
| on your operating system are not, e.g. it will be ${env.Path} |
| not ${env.PATH} on Windows |
| --> |
| <property |
| environment="env"/> |
| <!-- |
| Let users override standard properties, if desired. If |
| directory, file, or some properties do not exist, then standard |
| properties will be used. |
| --> |
| <property |
| file="${env.LOCAL_BUILD_PROPERTIES_DIR}/${ant.project.name}.properties"/> |
| |
| <!-- = = = end standard properties pattern = = = --> |
| <fail |
| unless="env.BUILD_HOME" |
| message="all scripts need a BUILD_HOME"/> |
| <echo |
| level="info" |
| message="buildDirectory: ${buildDirectory}"/> |
| <property |
| name="keyCfgFile" |
| value="${env.PROJECT_BUILDERS}/${projectname}/${env.RELENG}/maps/build.cfg"/> |
| <echo |
| level="debug" |
| message="keyCfgFile: ${keyCfgFile}"/> |
| <property |
| file="${keyCfgFile}"/> |
| <fail |
| unless="builderVersion" |
| message="Could not get builderVersion. Probably could not checkout build.cfg?"/> |
| <fail |
| unless="eclipse.builder.version" |
| message="Could not get eclipse.builder.version. Perhaps an old format build.cfg?"/> |
| <property |
| name="basebuilder.path" |
| value="${env.BASE_BUILDERS}/${eclipse.builder.version}"/> |
| <!-- |
| if not explicitly set by caller, we'll assume we should fail |
| here on errors. In some cases, such as JUnit test compiles, or |
| even leaf components, the caller may want to set to false, so |
| that some part of the build is still made available |
| --> |
| <property |
| name="eclipseBuildFailOnError" |
| value="true"/> |
| <!-- |
| We should not always normalize ("-repack") jars by default, |
| since in production we sign the jars (which does the -repack for |
| us) and not in production we don't really care so why spend the |
| extra time. For jars which are not supposed to be normalized, |
| such as pre-existing jars, they need to be added to the |
| pack.properties file (see the updatePackProperties task). Note: |
| signing does the -repack when we sign. This can be over-ridden |
| by the caller setting normalize to true, but there are know |
| known cases where we want to normalize (and eventually pack) the |
| jar files but not sign them. |
| --> |
| <property |
| name="normalizeJarFiles" |
| value="false"/> |
| |
| <!-- main --> |
| <target |
| name="runbuild"> |
| <dirname |
| file="${ant.file}" |
| property="scripts.build.dir"/> |
| <property |
| name="wtp.builder.home" |
| value="${scripts.build.dir}/../../.."/> |
| |
| <!-- invoke runEclipseBuild to build --> |
| <antcall |
| target="runEclipseBuild"/> |
| </target> |
| <target |
| name="build" |
| depends="init" |
| if="doBuild"> |
| <!-- |
| this property required as of Eclipse 3.0 stream builds > |
| 20031126 |
| --> |
| <property |
| name="buildingOSGi" |
| value="true"/> |
| <!-- |
| this generateFeatureVersionSuffix property causes feature |
| suffixes to be calcuated based on their own CVS tag, plus |
| the qualifier of their contained plugins |
| --> |
| <!-- |
| https://bugs.eclipse.org/bugs/show_bug.cgi?id=138825 false |
| for builds intended for 3.1.2, since can generate |
| underscores true for builds instended for 3.2 |
| --> |
| <property |
| name="generateFeatureVersionSuffix" |
| value="true"/> |
| <property |
| name="outputUpdateJars" |
| value="true"/> |
| <property |
| name="runPackager" |
| value="true"/> |
| |
| <!--run the build for the specified component--> |
| <echo |
| level="debug" |
| message="basedir: ${basedir}"/> |
| <echo |
| level="debug" |
| message="component: ${component}"/> |
| <echo |
| level="debug" |
| message="buildDirectory: ${buildDirectory}"/> |
| <echo |
| level="debug" |
| message="wtp.builder.home: ${wtp.builder.home}"/> |
| <echo |
| level="debug" |
| message="buildBranch: ${buildBranch}"/> |
| <fail |
| unless="buildBranch"/> |
| <ant |
| antfile="build.xml" |
| dir="${pde.build.scripts}"> |
| <property |
| name="builder" |
| value="${wtp.builder.home}/components/${component}"/> |
| <property |
| name="wtp.builder.home" |
| value="${wtp.builder.home}"/> |
| <property |
| name="buildBranch" |
| value="${buildBranch}"/> |
| <property |
| name="dependencyTargets" |
| value="${wtp.builder.home}/scripts/dependency/build.xml"/> |
| <property |
| name="local.cache.dir" |
| value="${env.LOCAL_PREREQS_CACHE}"/> |
| <property |
| name="baseLocation" |
| value="${env.PROJECT_PROJECTS}/${projectname}/eclipse"/> |
| <property |
| name="buildRoot" |
| value="${env.PROJECT_PROJECTS}/${projectname}"/> |
| <property |
| name="testRoot" |
| value="${env.PROJECT_TESTS}/${projectname}"/> |
| </ant> |
| </target> |
| |
| <!-- check if PDE basebuilder and WTP builder is present --> |
| <target |
| name="checkBaseBuilder" |
| depends="checkWTPBaseBuilder"> |
| <!-- |
| we just check if both base, and our wtp specific one are |
| current, if either is not, we'll get them both |
| --> |
| <condition |
| property="basebuilderlocal"> |
| <and> |
| <available |
| file="${pde.builder.path}"/> |
| <!-- |
| should we check explicitly for "true" instead of |
| just isset? either should work for this case, but |
| which is better ant style? |
| --> |
| <isset |
| property="wtpBuilderPresent"/> |
| </and> |
| </condition> |
| <echo |
| message="basebuilderlocal: ${basebuilderlocal}"/> |
| <echo |
| message="wtpBuilderPresent: ${wtpBuilderPresent}"/> |
| </target> |
| <!-- |
| 1)init -> set buildBranch, and create label.properties |
| 2)checkBaseBuilder -> check is baseBuilder exists, if not |
| retrieve from CVS org.eclipse.releg.basebuilder 3)invoke |
| getWTPBaseBuilder -> checks if |
| org.eclipse.wtp.releng.tools_version.jar exist, if not download |
| from WTP build site |
| --> |
| <target |
| name="getBaseBuilder" |
| depends="init,checkBaseBuilder" |
| unless="basebuilderlocal"> |
| <!-- *** change the repo info --> |
| <property |
| name="builderCvsRoot" |
| value=":pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse"/> |
| <!-- |
| note: untagged or some default version of base builder is |
| not good to use. in some cases, won't run at all, in the |
| best of cases, will simply be unstable, so we'll fail if we |
| forgot to specify it |
| --> |
| <fail |
| unless="eclipse.builder.version"/> |
| <mkdir |
| dir="${env.BASE_BUILDERS}/${eclipse.builder.version}"/> |
| <cvs |
| quiet="${env.CVS_QUIET}" |
| reallyquiet="${env.CVS_REALLY_QUIET}" |
| cvsRoot="${builderCvsRoot}" |
| package="${eclipse.builder}" |
| dest="${basebuilder.path}" |
| tag="${eclipse.builder.version}"/> |
| <fail |
| unless="wtpBuildTools.url"/> |
| |
| <!-- now add our WTP base builder if not there --> |
| <antcall |
| target="getWTPBaseBuilder"/> |
| </target> |
| <!-- |
| check wtpBulderPresent property if false, download WTP builder |
| file org.eclipse.wtp.releng.tools_version.jar into baseBuiders |
| --> |
| <target |
| name="getWTPBaseBuilder" |
| depends="checkWTPBaseBuilder" |
| unless="wtpBuilderPresent"> |
| <get |
| dest="${basebuilder.path}/org.eclipse.releng.basebuilder/plugins/${wtpBuildTools.file}" |
| src="${wtpBuildTools.url}/${wtpBuildTools.file}" |
| usetimestamp="true"/> |
| </target> |
| <!-- |
| check if WTP builder exists |
| org.eclipse.wtp.releng.tools_version.jar exist in basebuilder |
| set wtpBuilderPresent property |
| --> |
| <target |
| name="checkWTPBaseBuilder"> |
| <condition |
| property="wtpBuilderPresent"> |
| <available |
| file="${basebuilder.path}/org.eclipse.releng.basebuilder/plugins/${wtpBuildTools.file}"/> |
| </condition> |
| </target> |
| |
| <!-- set buildBranch, and create label.properties--> |
| <target |
| name="init"> |
| <condition |
| property="buildBranch" |
| value="R3.0.1"> |
| <equals |
| arg1="${mapVersionTag}" |
| arg2="R3_0_1_patches"/> |
| </condition> |
| <condition |
| property="buildBranch" |
| value="R3.1"> |
| <equals |
| arg1="${mapVersionTag}" |
| arg2="HEAD"/> |
| </condition> |
| <condition |
| property="buildBranch" |
| value="R3.0"> |
| <equals |
| arg1="${mapVersionTag}" |
| arg2="R3_0_maintenance"/> |
| </condition> |
| <condition |
| property="buildBranch" |
| value="R0.7"> |
| <equals |
| arg1="${mapVersionTag}" |
| arg2="R0_7_maintenance"/> |
| </condition> |
| <condition |
| property="buildBranch" |
| value="R1.0"> |
| <equals |
| arg1="${mapVersionTag}" |
| arg2="R1_0_maintenance"/> |
| </condition> |
| <condition |
| property="buildBranch" |
| value="R1.5"> |
| <equals |
| arg1="${mapVersionTag}" |
| arg2="R1_5_maintenance"/> |
| </condition> |
| <condition |
| property="buildBranch" |
| value="R1.5.5"> |
| <equals |
| arg1="${mapVersionTag}" |
| arg2="R1_5_5_patches"/> |
| </condition> |
| <condition |
| property="buildBranch" |
| value="R2.0"> |
| <equals |
| arg1="${mapVersionTag}" |
| arg2="R2_0_maintenance"/> |
| </condition> |
| <condition |
| property="buildBranch" |
| value="R2.0.2"> |
| <equals |
| arg1="${mapVersionTag}" |
| arg2="R2_0_2_patches"/> |
| </condition> |
| <!-- if not set above, assume R3.0 --> |
| <!-- this happens, for example, when using a "tempTest" branch --> |
| <property |
| name="buildBranch" |
| value="R3.1"/> |
| <!-- |
| strip trailing blanks. Seems either Eclipse, or CVS make it |
| hard to not have trailing spaces |
| --> |
| <replaceregexp |
| flags="gm" |
| file="${wtp.builder.home}/build.properties" |
| match=" *$" |
| replace=""/> |
| <property |
| file="${wtp.builder.home}/build.properties"/> |
| <ant |
| antfile="${wtp.builder.home}/scripts/build/label.xml"/> |
| <property |
| file="${buildDirectory}/label.properties"/> |
| <!-- |
| fetch the HEAD stream of all projects if build type |
| specified as N |
| --> |
| <condition |
| property="fetchTag" |
| value="HEAD"> |
| <equals |
| arg1="${buildType}" |
| arg2="N"/> |
| </condition> |
| <!-- |
| exit if the component directory doesn't exist (for example, |
| may not always be an "sdk" component, but we often generate |
| calls to it) |
| --> |
| <condition |
| property="doBuild"> |
| <available |
| file="${wtp.builder.home}/components/${component}" |
| type="dir"/> |
| </condition> |
| </target> |
| <target |
| name="runEclipseBuild" |
| if="buildId"> |
| <fail |
| unless="eclipse.builder.version"/> |
| <fail |
| message="dependency.properties must be specified by distribution script" |
| unless="dependency.properties"/> |
| <!-- |
| if not otherwise set "externally", set the classpath jars |
| for the Execution Envirnonments we need in WTP. And other |
| parameters we need set. To successfully do local builds, |
| most of these do have to be provided externally, such as in |
| "localbuildproperties" directory |
| --> |
| <property |
| name="J2SE-1.4" |
| value="${env.JAVA_4_HOME}/jre/lib/core.jar:${env.JAVA_4_HOME}/jre/lib/xml.jar:${env.JAVA_4_HOME}/jre/lib/graphics.jar:${env.JAVA_4_HOME}/jre/lib/server.jar:${env.JAVA_4_HOME}/jre/lib/ibmorbapi.jar:${env.JAVA_4_HOME}/jre/lib/security.jar:${env.JAVA_4_HOME}/jre/lib/ibmpkcs.jar:${env.JAVA_4_HOME}/jre/lib/ibmjcefw.jar"/> |
| <property |
| name="J2SE-1.5" |
| value="${env.JAVA_5_HOME}/jre/lib/core.jar:${env.JAVA_5_HOME}/jre/lib/vm.jar:${env.JAVA_5_HOME}/jre/lib/xml.jar:${env.JAVA_5_HOME}/jre/lib/graphics.jar:${env.JAVA_5_HOME}/jre/lib/server.jar:${env.JAVA_5_HOME}/jre/lib/ibmorbapi.jar:${env.JAVA_5_HOME}/jre/lib/security.jar:${env.JAVA_4_HOME}/jre/lib/ibmpkcs.jar:${env.JAVA_5_HOME}/jre/lib/ibmjcefw.jar"/> |
| <property |
| name="JavaSE-1.6" |
| value="${env.JAVA_6_HOME}/jre/lib/core.jar:${env.JAVA_6_HOME}/jre/lib/vm.jar:${env.JAVA_6_HOME}/jre/lib/xml.jar:${env.JAVA_6_HOME}/jre/lib/graphics.jar:${env.JAVA_6_HOME}/jre/lib/server.jar:${env.JAVA_6_HOME}/jre/lib/ibmorbapi.jar:${env.JAVA_6_HOME}/jre/lib/security.jar:${env.JAVA_4_HOME}/jre/lib/ibmpkcs.jar:${env.JAVA_6_HOME}/jre/lib/ibmjcefw.jar"/> |
| <!-- |
| local builds must set build.donottagmaps to true, in |
| runbuild.properties, to avoid erroneous time stamps |
| --> |
| <property |
| name="build.donottagmaps" |
| value="false"/> |
| <fail |
| unless="JavaSE-1.6" |
| message="classpath to JavaSE-1.6 Execution Environment must be set"/> |
| <fail |
| unless="J2SE-1.5" |
| message="classpath to J2SE-1.5 Execution Environment must be set"/> |
| <fail |
| unless="J2SE-1.4" |
| message="classpath to J2SE-1.4 Execution Environment must be set"/> |
| <!-- |
| we read these in as ant properties, so in java call below, |
| we convert them to system (environment) properties, which is |
| where PDE expects to find them |
| --> |
| <echo |
| message="JavaSE-1.6=${JavaSE-1.6}"/> |
| <echo |
| message="J2SE-1.5=${J2SE-1.5}"/> |
| <echo |
| message="J2SE-1.4=${J2SE-1.4}"/> |
| <mkdir |
| dir="${buildDirectory}/${buildLabel}"/> |
| <java |
| taskname="build-${build.distribution}-${component}" |
| jar="${eclipse.launcher}" |
| fork="true" |
| failonerror="${eclipseBuildFailOnError}"> |
| <jvmarg |
| value="-Djava.protocol.handler.pkgs=com.ibm.etools.www.protocol"/> |
| <jvmarg |
| value="-DurlLogLocation=${buildDirectory}/${buildLabel}/outgoinghttplogfromcodebuild.log"/> |
| <jvmarg |
| value="-Dosgi.ws=${env.BASEWS}"/> |
| <jvmarg |
| value="-Dosgi.os=${env.BASEOS}"/> |
| <jvmarg |
| value="-Dosgi.arch=${env.BASEARCH}"/> |
| <jvmarg |
| value="-Dbuild.home=${env.BUILD_HOME}"/> |
| <jvmarg |
| value="-DJAVA_6_HOME=${env.JAVA_6_HOME}"/> |
| <jvmarg |
| value="-DJAVA_5_HOME=${env.JAVA_5_HOME}"/> |
| <jvmarg |
| value="-DJAVA_4_HOME=${env.JAVA_4_HOME}"/> |
| <jvmarg |
| value="-DJavaSE-1.6=${JavaSE-1.6}"/> |
| <jvmarg |
| value="-DJ2SE-1.5=${J2SE-1.5}"/> |
| <jvmarg |
| value="-DJ2SE-1.4=${J2SE-1.4}"/> |
| <jvmarg |
| value="-Dbuild.donottagmaps=${build.donottagmaps}"/> |
| <jvmarg |
| value="-DbuildType=${buildType}"/> |
| <jvmarg |
| value="-DbuildId=${buildId}"/> |
| <jvmarg |
| value="-DmapVersionTag=${mapVersionTag}"/> |
| <jvmarg |
| value="-Declipse.builder.version=${eclipse.builder.version}"/> |
| <jvmarg |
| value="-Declipse.builder=${eclipse.builder}"/> |
| <jvmarg |
| value="-Dprojectname=${projectname}"/> |
| <jvmarg |
| value="-DbuildLabel=${buildLabel}"/> |
| <jvmarg |
| value="-Dreleng.jsf-mapVersionTag=${releng.jsf-mapVersionTag}"/> |
| <jvmarg |
| value="-Dreleng.dali-mapVersionTag=${releng.dali-mapVersionTag}"/> |
| <jvmarg |
| value="-Dwtp.builder.home=${wtp.builder.home}"/> |
| <jvmarg |
| value="-Dbuild.distribution=${build.distribution}"/> |
| <jvmarg |
| value="-Dcomponent=${component}"/> |
| <jvmarg |
| value="-Ddependency.properties=${dependency.properties}"/> |
| <jvmarg |
| value="-DwtpBuildTools.file=${wtpBuildTools.file}"/> |
| <jvmarg |
| value="-Djava.io.tmpdir=${env.RECOMMENDED_TMP_DIR}"/> |
| <jvmarg |
| value="-DSKIP_JAR_SIGNING=${SKIP_JAR_SIGNING}"/> |
| <jvmarg |
| value="-DnormalizeJarFiles=${normalizeJarFiles}"/> |
| <jvmarg |
| value="-Dosgi.instance.area=${buildDirectory}/${buildLabel}/runbuild-workspace-${component}"/> |
| <arg |
| value="-application"/> |
| <arg |
| value="org.eclipse.ant.core.antRunner"/> |
| <arg |
| value="-buildfile"/> |
| <arg |
| value="${ant.file}"/> |
| <arg |
| value="build"/> |
| </java> |
| </target> |
| </project> |