Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 1 | <!-- |
| 2 | Copyright (c) 2010 Stephan Herrmann and others. |
| 3 | All rights reserved. This program and the accompanying materials |
| 4 | are made available under the terms of the Eclipse Public License v1.0 |
| 5 | which accompanies this distribution, and is available at |
| 6 | http://www.eclipse.org/legal/epl-v10.html |
| 7 | |
| 8 | Contributors: |
| 9 | Stephan Herrmann - initial API and implementation |
| 10 | --> |
| 11 | <project default="main"> |
| 12 | |
| 13 | <!-- |
| 14 | Expected args: |
| 15 | |
| 16 | component.short:what's building? Defined by where build.properties and customTargets.xml are found |
| 17 | |
| 18 | OTScriptDir: where most build scripts are found (build) |
| 19 | |
| 20 | build.root.dir: (testrun/build-root) |
| 21 | baseLocation: from where eclipse is running (testrun/build-root/eclipse) |
| 22 | run.eclipseScriptDir: relative location of pde.build's scripts |
| 23 | buildDirectory: where sources shall be built (testrun/build-root/src) |
| 24 | |
| 25 | configs: what to build |
| 26 | baseos, basews, basearch: what platform we're on |
| 27 | |
| 28 | --> |
| 29 | <loadproperties srcfile="${OTScriptDir}/buildVersions.properties" /> |
| 30 | <loadproperties srcfile="${builder}/build.properties" /> |
| 31 | |
| 32 | <target name="main"> |
| 33 | <!--Default values for required properties--> |
| 34 | <property name="buildDirectory" value="${build.root.dir}/src" /> |
| 35 | <echo message="BUILDDIR: ${buildDirectory}" /> |
| 36 | <delete failonerror="true" dir="${buildDirectory}" /> |
| 37 | <antcall target="create.label.properties" /> |
| 38 | <property file="${buildDirectory}/label.properties" /> |
| 39 | |
| 40 | <!--fetch the HEAD stream of all projects if build type specified as N--> |
| 41 | <condition property="fetchTag" value="HEAD"> |
| 42 | <equals arg1="${buildType}" arg2="N" /> |
| 43 | </condition> |
| 44 | <property name="fetchTag" value="" /> |
| 45 | |
| 46 | <!--set the compiler and compiler arguments--> |
| 47 | <!--the default compiler is set to the one used by eclipse rel. eng. --> |
| 48 | <loadproperties srcfile="${OTScriptDir}/compiler.${component.short}.properties" /> |
Stephan Herrmann | b105b08 | 2011-05-15 00:39:56 +0000 | [diff] [blame] | 49 | <echo message="javacSource=${javacSource}" /> |
| 50 | |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 51 | <!--this property required as of Eclipse 3.0 stream builds > 20031126 --> |
| 52 | <property name="buildingOSGi" value="true" /> |
| 53 | |
| 54 | <!--run the pde-build for the specified ${builder} (OT-Compiler or OTDT-Build) --> |
| 55 | <ant antfile="build.xml" dir="${baseLocation}/${run.eclipseScriptDir}" /> |
| 56 | |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 57 | </target> |
| 58 | |
| 59 | <target name="create.label.properties" unless="label.properties.exists"> |
| 60 | <mkdir dir="${buildDirectory}" /> |
| 61 | <tstamp/> |
| 62 | <property name="date" value="${DSTAMP}" /> |
| 63 | <property name="time" value="${TSTAMP}" /> |
| 64 | <property name="timestamp" value="${date}${time}" /> |
| 65 | <property name="buildId" value="${buildType}${date}" /> |
| 66 | |
| 67 | <!--this naming convention used by php scripts on download server--> |
| 68 | <property name="buildLabel" value="${buildType}-${buildId}-${timestamp}" /> |
| 69 | |
| 70 | <!--store the build label information in a file--> |
| 71 | <echo file="${buildDirectory}/label.properties" append="true" > |
| 72 | buildType=${buildType} |
| 73 | </echo> |
| 74 | <echo file="${buildDirectory}/label.properties" append="true" > |
| 75 | buildId=${buildId} |
| 76 | </echo> |
| 77 | <echo file="${buildDirectory}/label.properties" append="true" > |
| 78 | timestamp=${timestamp} |
| 79 | </echo> |
| 80 | <echo file="${buildDirectory}/label.properties" append="true" > |
| 81 | buildLabel=${buildLabel} |
| 82 | </echo> |
| 83 | |
| 84 | <available file="${buildDirectory}/label.properties" property="label.properties.exists" /> |
| 85 | </target> |
| 86 | |
| 87 | </project> |