Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: e2ca9c7966
Fetching contributors…

Cannot retrieve contributors at this time

file 237 lines (199 sloc) 9.877 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237
<!-- This script will not be uploaded to the server.
PLEASE DO NOT MODIFY
If you modify this script it is likely that the build will not work on the server
-->
<project name="Build Facade" default="main">
<taskdef resource="org/pluginbuilder/anttasks/pluginbuildertasks.properties" classpath="build-files/pluginbuilder-anttasks.jar" />

<GetHostName />
<property file="build_${hostname}.properties" />
<property file="build_local.properties" />
<property name="eclipse.installation.dir" value="${eclipseDir}"/>
<import file="build-files/build_shared.xml"/>

<target name="-properties">

<!-- versioning -->
<property name="build.version" value="HEAD"/>
<property file="releases/${build.version}.properties" />
<tstamp>
<format property="version.qualifier" pattern="yyyyMMddHHmm" timezone="GMT" unit="minute"/>
</tstamp>

<property name="buildTypePresentation" value=""/>
<property name="version.full" value="${version}.${version.qualifier}${buildTypePresentation}"/>

<!-- includes -->
<GetHostName />
<property file="build_${hostname}.properties" />
<property file="build_local.properties" />
<property file="pluginbuilder.config" />

<!-- set defaults -->
<property name="buildTarget" value="main"/>
<property name="verboseAnt" value="-Ddummy=true"/>

<!-- check if clean should be called -->
<condition property="is.clean">
<or>
<equals arg1="main" arg2="${buildTarget}" trim="true"/>
<equals arg1="fetch" arg2="${buildTarget}" trim="true"/>
</or>
</condition>

<condition property="no.rcp.build" value="true">
<not>
<equals arg1="${pluginbuilder.is.rcpbuild}" arg2="true"/>
</not>
</condition>

</target>

<target name="-prepare.build.host">

<antcall target="unpack.eclipse"/>

<available type="dir" file="${eclipseDir}/plugins" property="eclipseDir.plugins.exists"/>
<fail message="Could not find directory ${eclipseDir}/plugins. Please check eclipseDir in build_local.properties" unless="eclipseDir.plugins.exists"/>

<!-- determine buildfiles -->
<BundleFileLocator eclipseInstallationRoot="${eclipseDir}" bundleId="org.eclipse.pde.build" filePath="scripts/build.xml" property="regularbuildfile" />
<dirname file="${regularbuildfile}" property="scriptdir"/>
<property name="productbuildfile" value="${scriptdir}/productBuild/productBuild.xml"/>

<!-- determine launcher -->
<BundleFileLocator eclipseInstallationRoot="${eclipseDir}" bundleId="org.eclipse.equinox.launcher" property="equinoxjar" />

</target>

<target name="-clean" if="is.clean">
<echo level="info" message="Cleaning directory ${buildDirectory}"/>
<delete dir="${buildDirectory}" verbose="false"/>
<mkdir dir="${buildDirectory}"/>
</target>

<target name="-build" depends="-properties,-clean,-prepare.build.host">
<condition property="no.rcp.build" value="true">
<not>
<equals arg1="${pluginbuilder.is.rcpbuild}" arg2="true"/>
</not>
</condition>
<antcall target="-build.internal">
<param name="buildfile" value="${regularbuildfile}"/>
</antcall>
<!-- build rcp omitting fetch -->
<property name="buildSystemProperty.skipFetch" value="true"/>
<antcall target="-build.rcp.internal"/>
</target>

<target name="-build.rcp.internal" unless="no.rcp.build">
<property prefix="buildSystemProperty." file="${buildHome}/build-files/build_rcp.properties"/>
<antcall target="-checkProductProperty"/>
<antcall target="-build.internal">
<param name="buildfile" value="${productbuildfile}"/>
</antcall>
</target>

<target name="-checkProductProperty">
<condition property="isProductSet">
<and>
<isset property="buildSystemProperty.product"/>
<not><equals arg1="${product}" arg2=""/></not>
</and>
</condition>
<fail message="Building an RCP application requires a Product Configuration file to be specified ('product' property)." unless="isProductSet"/>
</target>

<target name="rcp" depends="-properties,-clean,-prepare.build.host" description="Build RCP only">
<fail message="Please enable and configure an RCP build in the Plug-in Builder Editor before calling this target." if="no.rcp.build"/>
<antcall target="-build.rcp.internal"/>
</target>

<target name="-build.internal">
<property name="buildResultsDirectory" value="${buildDirectory}/results" />

<java classname="org.eclipse.equinox.launcher.Main" fork="true"
failonerror="true" errorproperty="build.stderr">
<arg value="-ws" />
<arg value="${ws}" />
<arg value="-os" />
<arg value="${os}" />
<arg value="-application" />
<arg value="org.eclipse.ant.core.antRunner" />
<arg value="-buildfile" />
<arg value="${buildfile}" />
<arg value="${buildTarget}" />
<arg value="-data" />
<arg value="${buildDirectory}/workspace" />
<arg value="${verboseAnt}"/>
<jvmarg value="-Dbasews=${ws}" />
<jvmarg value="-Dbaseos=${os}" />
<jvmarg value="-Dbasearch=${arch}" />
<jvmarg value="-Dbuilder=${buildHome}/build-files" />
<jvmarg value="-DjavacFailOnError=true"/>
<jvmarg value="-DbuildDirectory=${buildDirectory}"/>
<jvmarg value="-DbuildResultsDirectory=${buildResultsDirectory}"/>
<jvmarg value="-DbaseLocation=${eclipseDir}"/>
<jvmarg value="-DbuildHome=${buildHome}"/>
<jvmarg value="-Dversion.full=${version.full}"/>
<jvmarg value="-Dversion.qualifier=${version.qualifier}${buildTypePresentation}"/>
<jvmarg value="-DbuildType=${buildType}"/>
<jvmarg value="-DfetchTag=${fetchTag}"/>
<jvmarg value="-DbuildProperties=${buildHome}/build-files/build.properties"/>

<classpath>
<pathelement location="${equinoxjar}" />
</classpath>

<syspropertyset>
<propertyset>
<propertyref prefix="buildSystemProperty"/>
<mapper type="glob" from="buildSystemProperty.*" to="*"/>
</propertyset>
</syspropertyset>
</java>

<!-- save stderr for scrutinizing later -->
<echo file="${buildDirectory}/stderr.txt" append="true">${build.stderr}</echo>

<echo taskname="stderr">${build.stderr}</echo>

<condition property="is.build.error" value="true">
<contains string="${build.stderr}" substring="BUILD FAILED"/>
</condition>
<!-- Note that the fail task throws an exception which will be intercepted
from calling antcalls. During that processing the status will
be lost and set to 1. Therefor ethe processing of TESTS FAILED which should
return an exit status of 2 can only take place in main targets. -->
<fail message="PDE Build failed" if="is.build.error" status="1"/>

</target>

<target name="main-cc"
description="This target is suited to be run from cruisecontrol. The property 'label' is expected to be set from cruisecontrol.">
<!-- Note that pluginbuilder also provides an EclipseLabelIncrementer which creates Eclipse version labels.
see http://www.pluginbuilder.org/faq.html -->
<property name="version.full" value="${label}"/>
<SetRegex input="${label}" match=".+\..+\..+\.(.*)" property="version.qualifier" value="\1" />
<antcall target="-build"/>
</target>

<target name="main" description="Run the main target of customTargets.xml. Return status 0,1,2 for Success, Build Failure and Test Failure">
<property name="buildTarget" value="main"/>
<antcall target="-build"/>

<!-- this must be done in a top level target because otherwise the
status would not get throuhg. If fail is called somewhere within
an antcall the created exception will be caught which would result
in a return status of 1 -->
<loadfile srcFile="${buildDirectory}/stderr.txt" property="build.stderr"/>
<condition property="is.tests.failed" value="true">
<contains string="${build.stderr}" substring="TESTS FAILED"/>
</condition>
<fail message="Tests failed" if="is.tests.failed" status="2"/>
</target>

<target name="fetch" description="Run the fetch target of customTargets.xml.">
<property name="buildTarget" value="fetch"/>
<antcall target="-build"/>
</target>

<target name="generate" description="Run the generate target of customTargets.xml.">
<property name="buildTarget" value="generate"/>
<antcall target="-build"/>
</target>

<target name="process" description="Run the process target of customTargets.xml.">
<property name="buildTarget" value="process"/>
<antcall target="-build"/>
</target>

<target name="assemble" description="Run the assemble target of customTargets.xml.">
<property name="buildTarget" value="assemble"/>
<antcall target="-build"/>
</target>

<target name="postBuild" description="Run the postBuild target of customTargets.xml.">
<property name="buildTarget" value="postBuild"/>
<antcall target="-build"/>
<!-- see main for a description why this must take place here. It is very ugly -->
<loadfile srcFile="${buildDirectory}/stderr.txt" property="build.stderr"/>
<condition property="is.tests.failed" value="true">
<contains string="${build.stderr}" substring="TESTS FAILED"/>
</condition>
<fail message="Tests failed" if="is.tests.failed" status="2"/>
</target>

<target name="buildProperties" description="Print out derived properties for the current build." depends="-properties">
<fail message="You have to set the property 'buildPropertiesFile' if calling buildProperties" unless="buildPropertiesFile"/>
<condition property="subdir" value="nightly" else="releases">
<equals arg1="${buildType}" arg2="N"/>
</condition>
<echo file="${buildPropertiesFile}">relativeServerResultsDir: ${subdir}
version.full: ${version.full}
version.qualifier: ${version.qualifier}</echo>
</target>

</project>
Something went wrong with that request. Please try again.