1 <project name="com.android.eclipse.rcp.build" default="build"> 2 3 <!-- Set QUALIFIER to ADT_IDE_QUALIFIER if defined, otherwise use a date timestamp. --> 4 <tstamp> 5 <format property="defaultQualifier" pattern="yyyyMMddHHmm"/> 6 </tstamp> 7 8 <condition property="QUALIFIER" value="v${defaultQualifier}" else="${ADT_IDE_QUALIFIER}"> 9 <equals arg1="${ADT_IDE_QUALIFIER}" arg2="" /> 10 </condition> 11 12 <echo message="## ADT IDE Build Qualifier: ${QUALIFIER}"/> 13 14 <!-- Root of Android Source Tree --> 15 <property name="ANDROID_SRC" location="../../" /> 16 17 <!-- Host Eclipse used for building the RCP --> 18 <property name="basebuilder" value="${ANDROID_SRC}/external/eclipse-basebuilder/basebuilder-3.6.2/org.eclipse.releng.basebuilder/" /> 19 20 <!-- Source for target prebuilts --> 21 <property name="deltaPackTargetSrcDir" value="${ANDROID_SRC}/prebuilts/eclipse/" /> 22 <property name="targetSrcDir" value="${ANDROID_SRC}/prebuilts/eclipse-build-deps/" /> 23 24 <!-- Location where build happens and resulting binaries are generated --> 25 <property name="outDir" value="${ANDROID_SRC}/out/host/eclipse/adtproduct/" /> 26 27 <!-- Location where the target platform is created --> 28 <property name="targetDir" value="${outDir}/target" /> 29 30 <!-- Location where ADT feature build is performed --> 31 <property name="featureBuildDir" value="${outDir}/fbuild" /> 32 33 <!-- Location where ADT feature build is performed --> 34 <property name="productBuildDir" value="${outDir}/pbuild" /> 35 36 <!-- Location of the sources --> 37 <property name="srcDir" value="${ANDROID_SRC}/sdk/eclipse/" /> 38 39 <!-- Identify configurations to build --> 40 <condition property="buildconfigs" value="linux,gtk,x86_64"> 41 <equals arg1="${buildFor}" arg2="linux" /> 42 </condition> 43 <condition property="buildconfigs" value="macosx,cocoa,x86_64"> 44 <equals arg1="${buildFor}" arg2="darwin" /> 45 </condition> 46 <condition property="buildconfigs" value="win32,win32,x86_64"> 47 <equals arg1="${buildFor}" arg2="windows" /> 48 </condition> 49 50 <!-- if no platforms are provided, then build for all platforms --> 51 <property name="buildconfigs" value="linux,gtk,x86 & linux,gtk,x86_64 & win32,win32,x86 & win32,win32,x86_64 & macosx,cocoa,x86_64" /> 52 53 <!-- locate launcher plugin inside eclipse --> 54 <path id="equinox.launcher.path"> 55 <fileset dir="${basebuilder}/plugins"> 56 <include name="org.eclipse.equinox.launcher_*.jar" /> 57 </fileset> 58 </path> 59 <property name="equinox.launcher" refid="equinox.launcher.path" /> 60 61 <!-- locate pde build plugin inside eclipse --> 62 <path id="pde.build.dir.path"> 63 <dirset dir="${basebuilder}/plugins"> 64 <include name="org.eclipse.pde.build_*" /> 65 </dirset> 66 </path> 67 <property name="pde.build.dir" refid="pde.build.dir.path" /> 68 69 <!-- create the build directory, copy plugins and features into it --> 70 <target name="copy_srcs"> 71 <mkdir dir="${featureBuildDir}" /> 72 <copy todir="${featureBuildDir}" preservelastmodified="true"> 73 <fileset dir="${srcDir}/"> 74 <include name="plugins/**" /> 75 <include name="features/**" /> 76 <exclude name="plugins/*/bin/**" /> 77 </fileset> 78 </copy> 79 <mkdir dir="${productBuildDir}" /> 80 <copy todir="${productBuildDir}" preservelastmodified="true"> 81 <fileset dir="${srcDir}/"> 82 <include name="features/com.android.ide.eclipse.adt.package/**" /> 83 </fileset> 84 </copy> 85 </target> 86 87 <property name="GooglePlayTranslation.zip" value="${ANDROID_SRC}/tools/vendor/google/TranslationPluginForEclipse/ADT_Translation_Manager_plugin.zip" /> 88 <available file="${GooglePlayTranslation.zip}" property="translation.plugin.present" /> 89 90 <!-- Add localization plugin to the list of features if necessary --> 91 <target name="update-features" if="translation.plugin.present"> 92 <replace file="${productBuildDir}/features/com.android.ide.eclipse.adt.package/feature.xml" 93 token='!--import feature="com.google.i18n.inkstone.eclipse.localization" --' 94 value='import feature="com.google.i18n.inkstone.eclipse.localization" /' /> 95 </target> 96 97 <!-- create target platform --> 98 <target name="create-target"> 99 <mkdir dir="${targetDir}" /> 100 <mkdir dir="${targetDir}/deltapack" /> 101 <mkdir dir="${targetDir}/repos" /> 102 103 <unzip src="${deltaPackTargetSrcDir}/deltapack/eclipse-4.2.2-delta-pack.zip" dest="${targetDir}/deltapack" overwrite="false" /> 104 <unzip src="${targetSrcDir}/platform/org.eclipse.platform-4.2.2.zip" dest="${targetDir}/repos/platform" overwrite="false" /> 105 <unzip src="${targetSrcDir}/cdt/cdt-master-8.0.2.zip" dest="${targetDir}/repos/cdt" overwrite="false" /> 106 <unzip src="${targetSrcDir}/emf/emf-xsd-SDK-M201201231045.zip" dest="${targetDir}/repos/emf" overwrite="false" /> 107 <unzip src="${targetSrcDir}/jdt/org.eclipse.jdt.source-4.2.2.zip" dest="${targetDir}/repos/jdt" overwrite="false" /> 108 <unzip src="${targetSrcDir}/wtp/wtp-repo-R-3.3.2-20120210195245.zip" dest="${targetDir}/repos/wtp" overwrite="false" /> 109 <unzip src="${targetSrcDir}/gef/GEF-SDK-3.7.2.zip" dest="${targetDir}/repos/gef" overwrite="false" /> 110 <unzip src="${targetSrcDir}/pde/org.eclipse.pde-3.8.zip" dest="${targetDir}/repos/pde" overwrite="false" /> 111 <unzip src="${targetSrcDir}/egit/org.eclipse.egit.repository-2.2.0.201212191850-r.zip" dest="${targetDir}/repos/egit" overwrite="false" /> 112 </target> 113 114 <target name="create-translation-target" if="translation.plugin.present"> 115 <unzip src="${GooglePlayTranslation.zip}" dest="${targetDir}/repos/tpe" overwrite="false" /> 116 </target> 117 118 <!-- Launch pde build to build the adtpackage product --> 119 <target name="feature-build" depends="copy_srcs, update-features, create-target, create-translation-target"> 120 <java classname="org.eclipse.equinox.launcher.Main" fork="true" failonerror="true"> 121 <arg value="-application" /> 122 <arg value="org.eclipse.ant.core.antRunner" /> 123 <arg value="-buildfile" /> 124 <arg value="${pde.build.dir}/scripts/build.xml" /> 125 <arg value="-data" /> 126 <arg value="${featureBuildDir}/workspace" /> 127 <arg value="-configuration" /> 128 <arg value="${featureBuildDir}/configuration" /> 129 <arg value="-Dtimestamp=${timestamp}" /> 130 <arg value="-DeclipseLocation=${baseBuilder}" /> 131 <arg value="-DbuildDirectory=${featureBuildDir}" /> 132 <arg value="-Dbuilder=${ANDROID_SRC}/sdk/eclipse/buildConfig" /> 133 <arg value="-DbaseLocation=${targetDir}/deltapack/eclipse" /> 134 <arg value="-DrepoBaseLocation=${targetDir}/repos/" /> 135 <arg value="-DtransformedRepoLocation=${targetDir}/transformedRepos/" /> 136 <arg value="-DupdateSiteSource=${ANDROID_SRC}/sdk/eclipse/sites/external" /> 137 <arg value="-DupdateSiteRoot=${targetDir}/repos/" /> 138 <arg value="-DforceContextQualifier=${QUALIFIER}" /> 139 <classpath> 140 <pathelement location="${equinox.launcher}" /> 141 </classpath> 142 </java> 143 </target> 144 145 <!-- Launch pde build to build the adtpackage product --> 146 <target name="product-build" depends="feature-build"> 147 <java classname="org.eclipse.equinox.launcher.Main" fork="true" failonerror="true"> 148 <arg value="-application" /> 149 <arg value="org.eclipse.ant.core.antRunner" /> 150 <arg value="-buildfile" /> 151 <arg value="${pde.build.dir}/scripts/productBuild/productBuild.xml" /> 152 <arg value="-data" /> 153 <arg value="${productBuildDir}/workspace" /> 154 <arg value="-configuration" /> 155 <arg value="${productBuildDir}/configuration" /> 156 <arg value="-Dtimestamp=${timestamp}" /> 157 <arg value="-DeclipseLocation=${baseBuilder}" /> 158 <arg value="-DbuildDirectory=${productBuildDir}" /> 159 <arg value="-DbaseLocation=${targetDir}/deltapack/eclipse" /> 160 <arg value="-DrepoBaseLocation=${targetDir}/repos/" /> 161 <arg value="-DtransformedRepoLocation=${targetDir}/transformedRepos/" /> 162 <arg value="-Dconfigs=${buildconfigs}" /> 163 <arg value="-DforceContextQualifier=${QUALIFIER}" /> 164 <classpath> 165 <pathelement location="${equinox.launcher}" /> 166 </classpath> 167 </java> 168 </target> 169 170 <target name="clean"> 171 <delete dir="${outDir}" /> 172 <delete dir="${targetDir}" /> 173 </target> 174 175 <!-- Make sure that earlier build results are not present in the repository --> 176 <target name="clean-features"> 177 <delete dir="${featureBuildDir}" /> 178 <delete dir="${productBuildDir}" /> 179 <delete dir="${targetDir}/repos/android-eclipse" /> 180 <delete dir="${targetDir}/transformedRepos" /> 181 </target> 182 183 <target name="build" depends="clean-features, product-build" /> 184 </project> 185