aboutsummaryrefslogtreecommitdiffstats
path: root/monitor/build.xml
blob: d3c2d94c94819c126d1481ff9648661c243cea95 (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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<project name="com.android.eclipse.rcp.build" default="build">
    <!-- Root of Android Source Tree -->
    <property name="ANDROID_SRC" location="../../" />

    <!-- Host Eclipse used for building the RCP -->
    <property name="basebuilder" value="${ANDROID_SRC}/external/eclipse-basebuilder/basebuilder-3.6.2/org.eclipse.releng.basebuilder/" />

    <!-- Source for target prebuilts -->
    <property name="targetSrcDir" value="${ANDROID_SRC}/prebuilts/eclipse/" />

    <!-- Location where build happens and resulting binaries are generated -->
    <property name="outDir" value="${ANDROID_SRC}/out/host/eclipse/rcp/" />

    <!-- Location where the target platform is created -->
    <property name="targetDir" value="${outDir}/target" />

    <!-- Location where the target platform is created -->
    <property name="buildDir" value="${outDir}/build" />

    <!-- Location of the sources -->
    <property name="srcDir" value="${ANDROID_SRC}/sdk/eclipse/" />

    <!-- Identify configurations to build -->
    <condition property="buildconfigs" value="linux,gtk,x86 &amp; linux,gtk,x86_64">
        <equals arg1="${buildFor}" arg2="linux" />
    </condition>
    <condition property="buildconfigs" value="macosx,cocoa,x86_64">
        <equals arg1="${buildFor}" arg2="darwin" />
    </condition>
    <condition property="buildconfigs" value="win32,win32,x86 &amp; win32,win32,x86_64">
        <equals arg1="${buildFor}" arg2="windows" />
    </condition>

    <!-- if no platforms are provided, then build for all platforms -->
    <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" />

    <!-- locate launcher plugin inside eclipse -->
    <path id="equinox.launcher.path">
        <fileset dir="${basebuilder}/plugins">
            <include name="org.eclipse.equinox.launcher_*.jar" />
        </fileset>
    </path>
    <property name="equinox.launcher" refid="equinox.launcher.path" />

    <!-- locate pde build plugin inside eclipse -->
    <path id="pde.build.dir.path">
        <dirset dir="${basebuilder}/plugins">
            <include name="org.eclipse.pde.build_*" />
        </dirset>
    </path>
    <property name="pde.build.dir" refid="pde.build.dir.path" />

    <!-- create the build directory, copy plugins and features into it -->
    <target name="copy_srcs">
        <mkdir dir="${buildDir}" />
        <copy todir="${buildDir}" preservelastmodified="true">
            <fileset dir="${srcDir}/">
                <include name="plugins/**" />
                <include name="features/**" />
                <exclude name="plugins/*/bin/**" />
            </fileset>
        </copy>
    </target>

    <!-- create target platform -->
    <target name="create-target">
        <mkdir dir="${targetDir}" />
        <mkdir dir="${targetDir}/deltapack" />
        <mkdir dir="${targetDir}/repos" />

        <unzip src="${targetSrcDir}/deltapack/eclipse-3.7.2-delta-pack.zip" dest="${targetDir}/deltapack" overwrite="false" />
        <unzip src="${targetSrcDir}/platform/org.eclipse.platform-3.7.2.zip" dest="${targetDir}/repos/platform" overwrite="false" />
    </target>

    <!-- Launch pde build -->
    <target name="pde-build" depends="copy_srcs, create-target">
        <java classname="org.eclipse.equinox.launcher.Main" fork="true" failonerror="true">
            <arg value="-application" />
            <arg value="org.eclipse.ant.core.antRunner" />
            <arg value="-buildfile" />
            <arg value="${pde.build.dir}/scripts/productBuild/productBuild.xml" />
            <arg value="-data" />
            <arg value="${buildDir}/workspace" />
            <arg value="-configuration" />
            <arg value="${buildDir}/configuration" />
            <arg value="-Dtimestamp=${timestamp}" />
            <arg value="-DeclipseLocation=${baseBuilder}" />
            <arg value="-DbuildDirectory=${buildDir}" />
            <arg value="-DbaseLocation=${targetDir}/deltapack/eclipse" />
            <arg value="-DrepoBaseLocation=${targetDir}/repos/" />
            <arg value="-DtransformedRepoLocation=${targetDir}/transformedRepos/" />
            <arg value="-Dconfigs=${buildconfigs}" />
            <classpath>
                <pathelement location="${equinox.launcher}" />
            </classpath>
        </java>
    </target>

    <target name="clean">
        <delete dir="${outDir}" />
        <delete dir="${targetDir}" />
    </target>

    <target name="build" depends="pde-build" />
</project>