| <project name="com.android.eclipse.rcp.build" default="build"> |
| |
| <!-- Set QUALIFIER to ADT_IDE_QUALIFIER if defined, otherwise use a date timestamp. --> |
| <tstamp> |
| <format property="defaultQualifier" pattern="yyyyMMddHHmm"/> |
| </tstamp> |
| |
| <condition property="QUALIFIER" value="v${defaultQualifier}" else="${ADT_IDE_QUALIFIER}"> |
| <equals arg1="${ADT_IDE_QUALIFIER}" arg2="" /> |
| </condition> |
| |
| <echo message="## ADT IDE Build Qualifier: ${QUALIFIER}"/> |
| |
| <!-- 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="deltaPackTargetSrcDir" value="${ANDROID_SRC}/prebuilts/eclipse/" /> |
| <property name="targetSrcDir" value="${ANDROID_SRC}/prebuilts/eclipse-build-deps/" /> |
| |
| <!-- Location where build happens and resulting binaries are generated --> |
| <property name="outDir" value="${ANDROID_SRC}/out/host/eclipse/adtproduct/" /> |
| |
| <!-- Location where the target platform is created --> |
| <property name="targetDir" value="${outDir}/target" /> |
| |
| <!-- Location where ADT feature build is performed --> |
| <property name="featureBuildDir" value="${outDir}/fbuild" /> |
| |
| <!-- Location where ADT feature build is performed --> |
| <property name="productBuildDir" value="${outDir}/pbuild" /> |
| |
| <!-- Location of the sources --> |
| <property name="srcDir" value="${ANDROID_SRC}/sdk/eclipse/" /> |
| |
| <!-- Identify configurations to build --> |
| <condition property="buildconfigs" value="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_64"> |
| <equals arg1="${buildFor}" arg2="windows" /> |
| </condition> |
| |
| <!-- if no platforms are provided, then build for all platforms --> |
| <property name="buildconfigs" value="linux,gtk,x86 & linux,gtk,x86_64 & win32,win32,x86 & win32,win32,x86_64 & 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="${featureBuildDir}" /> |
| <copy todir="${featureBuildDir}" preservelastmodified="true"> |
| <fileset dir="${srcDir}/"> |
| <include name="plugins/**" /> |
| <include name="features/**" /> |
| <exclude name="plugins/*/bin/**" /> |
| </fileset> |
| </copy> |
| <mkdir dir="${productBuildDir}" /> |
| <copy todir="${productBuildDir}" preservelastmodified="true"> |
| <fileset dir="${srcDir}/"> |
| <include name="features/com.android.ide.eclipse.adt.package/**" /> |
| </fileset> |
| </copy> |
| </target> |
| |
| <property name="GooglePlayTranslation.zip" value="${ANDROID_SRC}/tools/vendor/google/TranslationPluginForEclipse/ADT_Translation_Manager_plugin.zip" /> |
| <available file="${GooglePlayTranslation.zip}" property="translation.plugin.present" /> |
| |
| <!-- Add localization plugin to the list of features if necessary --> |
| <target name="update-features" if="translation.plugin.present"> |
| <replace file="${productBuildDir}/features/com.android.ide.eclipse.adt.package/feature.xml" |
| token='!--import feature="com.google.i18n.inkstone.eclipse.localization" --' |
| value='import feature="com.google.i18n.inkstone.eclipse.localization" /' /> |
| </target> |
| |
| <!-- create target platform --> |
| <target name="create-target"> |
| <mkdir dir="${targetDir}" /> |
| <mkdir dir="${targetDir}/deltapack" /> |
| <mkdir dir="${targetDir}/repos" /> |
| |
| <unzip src="${deltaPackTargetSrcDir}/deltapack/eclipse-4.3.1-delta-pack.zip" dest="${targetDir}/deltapack" overwrite="false" /> |
| <unzip src="${targetSrcDir}/platform/org.eclipse.platform-4.3.1.zip" dest="${targetDir}/repos/platform" overwrite="false" /> |
| <unzip src="${targetSrcDir}/cdt/cdt-master-8.2.1.zip" dest="${targetDir}/repos/cdt" overwrite="false" /> |
| <unzip src="${targetSrcDir}/emf/emf-xsd-SDK-2.9.1.zip" dest="${targetDir}/repos/emf" overwrite="false" /> |
| <unzip src="${targetSrcDir}/jdt/org.eclipse.jdt.source-4.3.1.zip" dest="${targetDir}/repos/jdt" overwrite="false" /> |
| <unzip src="${targetSrcDir}/wtp/wtp4x-repo-R-3.5.1-20130913223750.zip" dest="${targetDir}/repos/wtp" overwrite="false" /> |
| <unzip src="${targetSrcDir}/gef/GEF-SDK-3.9.1RC1.zip" dest="${targetDir}/repos/gef" overwrite="false" /> |
| <unzip src="${targetSrcDir}/pde/org.eclipse.pde-4.3.1.zip" dest="${targetDir}/repos/pde" overwrite="false" /> |
| <unzip src="${targetSrcDir}/egit/org.eclipse.egit.repository-3.1.0.201310021548-r.zip" dest="${targetDir}/repos/egit" overwrite="false" /> |
| </target> |
| |
| <target name="create-translation-target" if="translation.plugin.present"> |
| <unzip src="${GooglePlayTranslation.zip}" dest="${targetDir}/repos/tpe" overwrite="false" /> |
| </target> |
| |
| <!-- Launch pde build to build the adtpackage product --> |
| <target name="feature-build" depends="copy_srcs, update-features, create-target, create-translation-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/build.xml" /> |
| <arg value="-data" /> |
| <arg value="${featureBuildDir}/workspace" /> |
| <arg value="-configuration" /> |
| <arg value="${featureBuildDir}/configuration" /> |
| <arg value="-Dtimestamp=${timestamp}" /> |
| <arg value="-DeclipseLocation=${baseBuilder}" /> |
| <arg value="-DbuildDirectory=${featureBuildDir}" /> |
| <arg value="-Dbuilder=${ANDROID_SRC}/sdk/eclipse/buildConfig" /> |
| <arg value="-DbaseLocation=${targetDir}/deltapack/eclipse" /> |
| <arg value="-DrepoBaseLocation=${targetDir}/repos/" /> |
| <arg value="-DtransformedRepoLocation=${targetDir}/transformedRepos/" /> |
| <arg value="-DupdateSiteSource=${ANDROID_SRC}/sdk/eclipse/sites/external" /> |
| <arg value="-DupdateSiteRoot=${targetDir}/repos/" /> |
| <arg value="-DforceContextQualifier=${QUALIFIER}" /> |
| <classpath> |
| <pathelement location="${equinox.launcher}" /> |
| </classpath> |
| </java> |
| </target> |
| |
| <!-- Launch pde build to build the adtpackage product --> |
| <target name="product-build" depends="feature-build"> |
| <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="${productBuildDir}/workspace" /> |
| <arg value="-configuration" /> |
| <arg value="${productBuildDir}/configuration" /> |
| <arg value="-Dtimestamp=${timestamp}" /> |
| <arg value="-DeclipseLocation=${baseBuilder}" /> |
| <arg value="-DbuildDirectory=${productBuildDir}" /> |
| <arg value="-DbaseLocation=${targetDir}/deltapack/eclipse" /> |
| <arg value="-DrepoBaseLocation=${targetDir}/repos/" /> |
| <arg value="-DtransformedRepoLocation=${targetDir}/transformedRepos/" /> |
| <arg value="-Dconfigs=${buildconfigs}" /> |
| <arg value="-DforceContextQualifier=${QUALIFIER}" /> |
| <classpath> |
| <pathelement location="${equinox.launcher}" /> |
| </classpath> |
| </java> |
| </target> |
| |
| <target name="clean"> |
| <delete dir="${outDir}" /> |
| <delete dir="${targetDir}" /> |
| </target> |
| |
| <!-- Make sure that earlier build results are not present in the repository --> |
| <target name="clean-features"> |
| <delete dir="${featureBuildDir}" /> |
| <delete dir="${productBuildDir}" /> |
| <delete dir="${targetDir}/repos/android-eclipse" /> |
| <delete dir="${targetDir}/transformedRepos" /> |
| </target> |
| |
| <target name="build" depends="clean-features, product-build" /> |
| </project> |