blob: d3c2d94c94819c126d1481ff9648661c243cea95 [file] [log] [blame]
Siva Velusamy6ca42e82011-12-08 14:25:37 -08001<project name="com.android.eclipse.rcp.build" default="build">
2 <!-- Root of Android Source Tree -->
Raphael Moll5abe8b22012-03-30 15:50:45 -07003 <property name="ANDROID_SRC" location="../../" />
Siva Velusamy6ca42e82011-12-08 14:25:37 -08004
5 <!-- Host Eclipse used for building the RCP -->
Siva Velusamy07354592012-04-19 14:37:23 -07006 <property name="basebuilder" value="${ANDROID_SRC}/external/eclipse-basebuilder/basebuilder-3.6.2/org.eclipse.releng.basebuilder/" />
Siva Velusamy6ca42e82011-12-08 14:25:37 -08007
8 <!-- Source for target prebuilts -->
Siva Velusamy4ae83cc2012-01-12 14:37:19 -08009 <property name="targetSrcDir" value="${ANDROID_SRC}/prebuilts/eclipse/" />
Siva Velusamy6ca42e82011-12-08 14:25:37 -080010
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
Siva Velusamye63fabc2012-01-26 15:48:45 -080023 <!-- 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
Siva Velusamy6ca42e82011-12-08 14:25:37 -080037 <!-- locate launcher plugin inside eclipse -->
Siva Velusamye63fabc2012-01-26 15:48:45 -080038 <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" />
Siva Velusamy6ca42e82011-12-08 14:25:37 -080044
45 <!-- locate pde build plugin inside eclipse -->
Siva Velusamye63fabc2012-01-26 15:48:45 -080046 <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" />
Siva Velusamy6ca42e82011-12-08 14:25:37 -080052
53 <!-- create the build directory, copy plugins and features into it -->
Siva Velusamye63fabc2012-01-26 15:48:45 -080054 <target name="copy_srcs">
55 <mkdir dir="${buildDir}" />
Siva Velusamyc1c5b542012-05-07 17:02:34 -070056 <copy todir="${buildDir}" preservelastmodified="true">
Siva Velusamye63fabc2012-01-26 15:48:45 -080057 <fileset dir="${srcDir}/">
Siva Velusamy6ca42e82011-12-08 14:25:37 -080058 <include name="plugins/**" />
59 <include name="features/**" />
Siva Velusamyc1c5b542012-05-07 17:02:34 -070060 <exclude name="plugins/*/bin/**" />
Siva Velusamy6ca42e82011-12-08 14:25:37 -080061 </fileset>
Siva Velusamye63fabc2012-01-26 15:48:45 -080062 </copy>
63 </target>
Siva Velusamy6ca42e82011-12-08 14:25:37 -080064
65 <!-- create target platform -->
66 <target name="create-target">
Siva Velusamye63fabc2012-01-26 15:48:45 -080067 <mkdir dir="${targetDir}" />
68 <mkdir dir="${targetDir}/deltapack" />
69 <mkdir dir="${targetDir}/repos" />
Siva Velusamy6ca42e82011-12-08 14:25:37 -080070
Siva Velusamy07354592012-04-19 14:37:23 -070071 <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" />
Siva Velusamy6ca42e82011-12-08 14:25:37 -080073 </target>
Siva Velusamye63fabc2012-01-26 15:48:45 -080074
Siva Velusamy6ca42e82011-12-08 14:25:37 -080075 <!-- Launch pde build -->
Siva Velusamye63fabc2012-01-26 15:48:45 -080076 <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" />
Siva Velusamy6ca42e82011-12-08 14:25:37 -080082 <arg value="-data" />
83 <arg value="${buildDir}/workspace" />
Raphael Moll5abe8b22012-03-30 15:50:45 -070084 <arg value="-configuration" />
85 <arg value="${buildDir}/configuration" />
Siva Velusamye63fabc2012-01-26 15:48:45 -080086 <arg value="-Dtimestamp=${timestamp}" />
Siva Velusamy6ca42e82011-12-08 14:25:37 -080087 <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/" />
Siva Velusamye63fabc2012-01-26 15:48:45 -080092 <arg value="-Dconfigs=${buildconfigs}" />
93 <classpath>
94 <pathelement location="${equinox.launcher}" />
95 </classpath>
96 </java>
97 </target>
Siva Velusamy6ca42e82011-12-08 14:25:37 -080098
Siva Velusamye63fabc2012-01-26 15:48:45 -080099 <target name="clean">
100 <delete dir="${outDir}" />
101 <delete dir="${targetDir}" />
102 </target>
103
104 <target name="build" depends="pde-build" />
Siva Velusamy6ca42e82011-12-08 14:25:37 -0800105</project>