From 4964a0b8943ddab43e4e02d83c539fa9293edb69 Mon Sep 17 00:00:00 2001
From: Siva Velusamy <vsiva@google.com>
Date: Mon, 10 Jun 2013 18:22:08 -0700
Subject: Install Translation Plugin if available

Change-Id: I8a517c2ced3a0293bb94b9955cad9617f555faa8
---
 adtproductbuild/build.xml | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

(limited to 'adtproductbuild')

diff --git a/adtproductbuild/build.xml b/adtproductbuild/build.xml
index 95e682a..4c5cbb9 100644
--- a/adtproductbuild/build.xml
+++ b/adtproductbuild/build.xml
@@ -84,6 +84,16 @@
         </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}" />
@@ -101,8 +111,12 @@
         <unzip src="${targetSrcDir}/egit/org.eclipse.egit.repository-2.2.0.201212191850-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, create-target">
+    <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" />
-- 
cgit v1.1