1<project name="com.android.eclipse.rcp.build" default="build">
2    <!-- Root of Android Source Tree -->
3    <property name="ANDROID_SRC" location="../../" />
4
5    <!-- Host Eclipse used for building the RCP -->
6    <property name="basebuilder" value="${ANDROID_SRC}/external/eclipse-basebuilder/basebuilder-3.6.2/org.eclipse.releng.basebuilder/" />
7
8    <!-- Source for target prebuilts -->
9    <property name="targetSrcDir" value="${ANDROID_SRC}/prebuilts/eclipse/" />
10
11    <!-- Location where build happens and resulting binaries are generated -->
12    <property name="outDir" value="${ANDROID_SRC}/out/host/eclipse/rcp/" />
13
14    <!-- Location where the target platform is created -->
15    <property name="targetDir" value="${outDir}/target" />
16
17    <!-- Location where the target platform is created -->
18    <property name="buildDir" value="${outDir}/build" />
19
20    <!-- Location of the sources -->
21    <property name="srcDir" value="${ANDROID_SRC}/sdk/eclipse/" />
22
23    <!-- Identify configurations to build -->
24    <condition property="buildconfigs" value="linux,gtk,x86 &amp; linux,gtk,x86_64">
25        <equals arg1="${buildFor}" arg2="linux" />
26    </condition>
27    <condition property="buildconfigs" value="macosx,cocoa,x86_64">
28        <equals arg1="${buildFor}" arg2="darwin" />
29    </condition>
30    <condition property="buildconfigs" value="win32,win32,x86 &amp; win32,win32,x86_64">
31        <equals arg1="${buildFor}" arg2="windows" />
32    </condition>
33
34    <!-- if no platforms are provided, then build for all platforms -->
35    <property name="buildconfigs" value="linux,gtk,x86 &amp; linux,gtk,x86_64 &amp; win32,win32,x86 &amp; win32,win32,x86_64 &amp; macosx,cocoa,x86_64" />
36
37    <!-- locate launcher plugin inside eclipse -->
38    <path id="equinox.launcher.path">
39        <fileset dir="${basebuilder}/plugins">
40            <include name="org.eclipse.equinox.launcher_*.jar" />
41        </fileset>
42    </path>
43    <property name="equinox.launcher" refid="equinox.launcher.path" />
44
45    <!-- locate pde build plugin inside eclipse -->
46    <path id="pde.build.dir.path">
47        <dirset dir="${basebuilder}/plugins">
48            <include name="org.eclipse.pde.build_*" />
49        </dirset>
50    </path>
51    <property name="pde.build.dir" refid="pde.build.dir.path" />
52
53    <!-- create the build directory, copy plugins and features into it -->
54    <target name="copy_srcs">
55        <mkdir dir="${buildDir}" />
56        <copy todir="${buildDir}" preservelastmodified="true">
57            <fileset dir="${srcDir}/">
58                <include name="plugins/**" />
59                <include name="features/**" />
60                <exclude name="plugins/*/bin/**" />
61            </fileset>
62        </copy>
63    </target>
64
65    <!-- create target platform -->
66    <target name="create-target">
67        <mkdir dir="${targetDir}" />
68        <mkdir dir="${targetDir}/deltapack" />
69        <mkdir dir="${targetDir}/repos" />
70
71        <unzip src="${targetSrcDir}/deltapack/eclipse-3.7.2-delta-pack.zip" dest="${targetDir}/deltapack" overwrite="false" />
72        <unzip src="${targetSrcDir}/platform/org.eclipse.platform-3.7.2.zip" dest="${targetDir}/repos/platform" overwrite="false" />
73    </target>
74
75    <!-- Launch pde build -->
76    <target name="pde-build" depends="copy_srcs, create-target">
77        <java classname="org.eclipse.equinox.launcher.Main" fork="true" failonerror="true">
78            <arg value="-application" />
79            <arg value="org.eclipse.ant.core.antRunner" />
80            <arg value="-buildfile" />
81            <arg value="${pde.build.dir}/scripts/productBuild/productBuild.xml" />
82            <arg value="-data" />
83            <arg value="${buildDir}/workspace" />
84            <arg value="-configuration" />
85            <arg value="${buildDir}/configuration" />
86            <arg value="-Dtimestamp=${timestamp}" />
87            <arg value="-DeclipseLocation=${baseBuilder}" />
88            <arg value="-DbuildDirectory=${buildDir}" />
89            <arg value="-DbaseLocation=${targetDir}/deltapack/eclipse" />
90            <arg value="-DrepoBaseLocation=${targetDir}/repos/" />
91            <arg value="-DtransformedRepoLocation=${targetDir}/transformedRepos/" />
92            <arg value="-Dconfigs=${buildconfigs}" />
93            <classpath>
94                <pathelement location="${equinox.launcher}" />
95            </classpath>
96        </java>
97    </target>
98
99    <target name="clean">
100        <delete dir="${outDir}" />
101        <delete dir="${targetDir}" />
102    </target>
103
104    <target name="build" depends="pde-build" />
105</project>
106