1<!-- 2 * Copyright (C) 2012 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 16*Sample* build.xml for ADT plugin build. Do not use for actual releases. 17 18Note: this uses the target platform from eclipse-build-deps. 19All these are newer than Eclipse 3.6.2 which is our current baseline. 20 21Note: for actual releases, use build_server.sh instead of this. 22 23To build: 24$ cd sdk/eclipse/scripts 25$ ant 26This should create the plugins in $OUT/host/eclipse/adtplugins/build/v<timestamp>-aosp 27 28--> 29<project name="com.android.eclipse.rcp.build" default="build"> 30 <!-- The timestamp for the context qualifier. --> 31 <tstamp> 32 <format property="adt.timestamp" 33 pattern="yyyyMMddHHmmss" /> 34 </tstamp> 35 36 <!-- Root of Android Source Tree --> 37 <property name="ANDROID_SRC" location="../../../" /> 38 39 <!-- Host Eclipse used for building the RCP --> 40 <property name="basebuilder" value="${ANDROID_SRC}/external/eclipse-basebuilder/basebuilder-3.6.2/org.eclipse.releng.basebuilder/" /> 41 42 <!-- Source for target prebuilts --> 43 <property name="targetSrcDir1" value="${ANDROID_SRC}/prebuilts/eclipse/" /> 44 <property name="targetSrcDir2" value="${ANDROID_SRC}/prebuilts/eclipse-build-deps/" /> 45 46 <!-- Location where build happens and resulting binaries are generated --> 47 <property name="outDir" value="${ANDROID_SRC}/out/host/eclipse/adtplugins/" /> 48 49 <!-- Location where the target platform is created --> 50 <property name="targetDir" value="${outDir}/target" /> 51 52 <!-- Location where the target platform is created --> 53 <property name="buildDir" value="${outDir}/build" /> 54 55 <!-- Location of the sources --> 56 <property name="srcDir" value="${ANDROID_SRC}/sdk/eclipse/" /> 57 58 <!-- locate launcher plugin inside eclipse --> 59 <path id="equinox.launcher.path"> 60 <fileset dir="${basebuilder}/plugins"> 61 <include name="org.eclipse.equinox.launcher_*.jar" /> 62 </fileset> 63 </path> 64 <property name="equinox.launcher" refid="equinox.launcher.path" /> 65 66 <!-- locate pde build plugin inside eclipse --> 67 <path id="pde.build.dir.path"> 68 <dirset dir="${basebuilder}/plugins"> 69 <include name="org.eclipse.pde.build_*" /> 70 </dirset> 71 </path> 72 <property name="pde.build.dir" refid="pde.build.dir.path" /> 73 74 <!-- create the build directory, copy plugins and features into it --> 75 <target name="copy_srcs"> 76 <mkdir dir="${buildDir}" /> 77 <copy todir="${buildDir}" preservelastmodified="true"> 78 <fileset dir="${srcDir}/"> 79 <include name="plugins/**" /> 80 <include name="features/**" /> 81 <exclude name="plugins/*/bin/**" /> 82 </fileset> 83 </copy> 84 </target> 85 86 <!-- create target platform --> 87 <target name="create-target"> 88 <mkdir dir="${targetDir}" /> 89 <mkdir dir="${targetDir}/deltapack" /> 90 <mkdir dir="${targetDir}/repos" /> 91 92 <unzip src="${targetSrcDir1}/deltapack/eclipse-3.7.2-delta-pack.zip" dest="${targetDir}/deltapack" overwrite="false" /> 93 <unzip src="${targetSrcDir1}/platform/org.eclipse.platform-3.7.2.zip" dest="${targetDir}/repos/platform" overwrite="false" /> 94 <unzip src="${targetSrcDir2}/cdt/cdt-master-8.0.2.zip" dest="${targetDir}/repos/cdt" overwrite="false" /> 95 <unzip src="${targetSrcDir2}/emf/emf-xsd-SDK-M201201231045.zip" dest="${targetDir}/repos/emf" overwrite="false" /> 96 <unzip src="${targetSrcDir2}/jdt/org.eclipse.jdt.source-3.7.2.zip" dest="${targetDir}/repos/jdt" overwrite="false" /> 97 <unzip src="${targetSrcDir2}/wtp/wtp-repo-R-3.3.2-20120210195245.zip" dest="${targetDir}/repos/wtp" overwrite="false" /> 98 <unzip src="${targetSrcDir2}/gef/GEF-SDK-3.7.2.zip" dest="${targetDir}/repos/gef" overwrite="false" /> 99 </target> 100 101 <!-- Launch pde build --> 102 <target name="pde-build" depends="copy_srcs, create-target"> 103 <java classname="org.eclipse.equinox.launcher.Main" fork="true" failonerror="true"> 104 <arg value="-application" /> 105 <arg value="org.eclipse.ant.core.antRunner" /> 106 <arg value="-buildfile" /> 107 <arg value="${pde.build.dir}/scripts/build.xml" /> 108 <arg value="-data" /> 109 <arg value="${buildDir}/workspace" /> 110 <arg value="-configuration" /> 111 <arg value="${buildDir}/configuration" /> 112 <arg value="-Dbuilder=${srcDir}/buildConfig" /> 113 <arg value="-Dtimestamp=${timestamp}" /> 114 <arg value="-DeclipseLocation=${baseBuilder}" /> 115 <arg value="-DbuildDirectory=${buildDir}" /> 116 <arg value="-DbaseLocation=${targetDir}/deltapack/eclipse" /> 117 <arg value="-DrepoBaseLocation=${targetDir}/repos/" /> 118 <arg value="-DtransformedRepoLocation=${targetDir}/transformedRepos/" /> 119 <arg value="-DupdateSiteSource=${srcDir}/sites/external" /> 120 <arg value="-DforceContextQualifier=v${adt.timestamp}-aosp" /> 121 <classpath> 122 <pathelement location="${equinox.launcher}" /> 123 </classpath> 124 </java> 125 </target> 126 127 <target name="clean"> 128 <delete dir="${outDir}" /> 129 <delete dir="${targetDir}" /> 130 </target> 131 132 <target name="build" depends="pde-build" /> 133</project> 134