summaryrefslogtreecommitdiffstats
blob: a5e3f2f6eb6ed30d8977bcb7afd4ec3afb38b199 (plain)
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
<!--
 Copyright (c) 2010 Stephan Herrmann and others.
 All rights reserved. This program and the accompanying materials
 are made available under the terms of the Eclipse Public License v1.0
 which accompanies this distribution, and is available at
 http://www.eclipse.org/legal/epl-v10.html

 Contributors:
     Stephan Herrmann - initial API and implementation
-->
<project default="main">
	
	<!--
		Expected args:
		
		component.short:what's building? Defined by where build.properties and customTargets.xml are found
		
		OTScriptDir:	where most build scripts are found (build)
		
		build.root.dir:	(testrun/build-root)
		baseLocation:	from where eclipse is running (testrun/build-root/eclipse)
		run.eclipseScriptDir: relative location of pde.build's scripts
		buildDirectory:	where sources shall be built (testrun/build-root/src)
			
		configs:		what to build
		baseos, basews, basearch: what platform we're on
		
	-->
	<loadproperties srcfile="${OTScriptDir}/buildVersions.properties" />
	<loadproperties srcfile="${builder}/build.properties" />

    <target name="main">
            <!--Default values for required properties-->
            <property name="buildDirectory" value="${build.root.dir}/src" />
            <echo message="BUILDDIR: ${buildDirectory}" />
            <delete failonerror="true" dir="${buildDirectory}" />
            <antcall target="create.label.properties" />
            <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>
            <property name="fetchTag" value="" />

            <!--set the compiler and compiler arguments-->
            <!--the default compiler is set to the one used by eclipse rel. eng. -->
            <loadproperties srcfile="${OTScriptDir}/compiler.${component.short}.properties" />
            <echo message="javacSource=${javacSource}" />

            <!--this property required as of Eclipse 3.0 stream builds > 20031126 -->
            <property name="buildingOSGi" value="true" />

   			<!--let ecotj be generated into a "safe" location: -->
    		<property name="postingDirectory" value="${build.root.dir}/../ecj" />

            <!--run the pde-build for the specified ${builder} (OT-Compiler or OTDT-Build) -->
            <ant antfile="build.xml" dir="${baseLocation}/${run.eclipseScriptDir}" />

    </target>
	

    <target name="create.label.properties" unless="label.properties.exists">
			<mkdir dir="${buildDirectory}" />
			<tstamp/>
			<property name="date" value="${DSTAMP}" />
			<property name="time" value="${TSTAMP}" />
			<property name="timestamp" value="${date}${time}" />
			<property name="buildId" value="${buildType}${date}" />

			<!--this naming convention used by php scripts on download server-->
			<property name="buildLabel" value="${buildType}-${buildId}-${timestamp}" />

			<!--store the build label information in a file-->
			<echo file="${buildDirectory}/label.properties" append="true" >
			buildType=${buildType}
			</echo>
			<echo file="${buildDirectory}/label.properties" append="true" >
			buildId=${buildId}
			</echo>
			<echo file="${buildDirectory}/label.properties" append="true" >
			timestamp=${timestamp}
			</echo>
			<echo file="${buildDirectory}/label.properties" append="true" >
			buildLabel=${buildLabel}
			</echo>

			<available file="${buildDirectory}/label.properties" property="label.properties.exists" />
		</target>

</project>