Commit 75b558c7 authored by torne@chromium.org's avatar torne@chromium.org

Android: remove ant environment dependencies.

The logic to calculate where the SDK should be is already done by
envsetup and made available to gyp as a variable, so just have gyp pass
this as a command line argument to ant. The behaviour is identical.

This change is to move toward making it possible to build the Android
port without having envsetup.sh sourced at build time (only at
gyp-generation time), making it more like other platforms. It also
simplifies the ant buildfiles.


Review URL: https://chromiumcodereview.appspot.com/10821105

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149400 0039d316-1c4b-4281-b951-d872f2087c98
parent edaf596d
......@@ -3,11 +3,6 @@
building base java source code with ant
</description>
<!-- Set global properties for this build -->
<property environment="env"/>
<property name="sdk.dir" location="${env.ANDROID_SDK_ROOT}"/>
<!-- TODO(jrg): The apk-runner's version is hardcoded to SDK version 14. These
two should be unified. -->
<property name="sdk.version" value="${env.ANDROID_SDK_VERSION}"/>
<property name="src" location="src"/>
<property name="dist" location="dist"/>
<property name="out.dir" location="${PRODUCT_DIR}/lib.java"/>
......@@ -16,15 +11,6 @@
like this are androidified -->
<property name="dest.dir" location="${PRODUCT_DIR}/java/base"/>
<!-- Set path depending on the type of repository. If ANDROID_BUILD_TOP is
set then build using the provided location. Otherwise, assume the build
is using the released SDK and set the path accordingly. -->
<condition property="location.base"
value="${sdk.dir}"
else="${sdk.dir}/platforms/android-${sdk.version}">
<isset property="env.ANDROID_BUILD_TOP"/>
</condition>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
......@@ -44,7 +30,7 @@
-->
<javac srcdir="${src}" destdir="${dest.dir}" debug="true" includeantruntime="false">
<classpath>
<path location="${location.base}/android.jar"/>
<path location="${ANDROID_SDK}/android.jar"/>
</classpath>
</javac>
</target>
......
......@@ -3,11 +3,6 @@
building base java tests source code with ant
</description>
<!-- Set global properties for this build -->
<property environment="env"/>
<property name="sdk.dir" location="${env.ANDROID_SDK_ROOT}"/>
<!-- TODO(jrg): The apk-runner's version is hardcoded to SDK version 14. These
two should be unified. -->
<property name="sdk.version" value="${env.ANDROID_SDK_VERSION}"/>
<property name="src" location="src"/>
<property name="dist" location="dist"/>
<property name="out.dir" location="${PRODUCT_DIR}/lib.java"/>
......@@ -16,15 +11,6 @@
like this are androidified -->
<property name="dest.dir" location="${PRODUCT_DIR}/java/base_javatests"/>
<!-- Set path depending on the type of repository. If ANDROID_BUILD_TOP is
set then build using the provided location. Otherwise, assume the build
is using the released SDK and set the path accordingly. -->
<condition property="location.base"
value="${sdk.dir}"
else="${sdk.dir}/platforms/android-${sdk.version}">
<isset property="env.ANDROID_BUILD_TOP"/>
</condition>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
......@@ -44,7 +30,7 @@
-->
<javac srcdir="${src}" destdir="${dest.dir}" debug="true" includeantruntime="false">
<classpath>
<path location="${location.base}/android.jar"/>
<path location="${ANDROID_SDK}/android.jar"/>
</classpath>
</javac>
</target>
......
......@@ -46,6 +46,7 @@
'ant',
'-DPRODUCT_DIR=<(ant_build_out)',
'-DPACKAGE_NAME=<(package_name)',
'-DANDROID_SDK=<(android_sdk)',
'-buildfile',
'<(java_in_dir)/<(package_name).xml',
]
......
......@@ -8,20 +8,11 @@
building content java source code with ant
</description>
<!-- set global properties for this build -->
<property environment="env"/>
<property name="sdk.dir" location="${env.ANDROID_SDK_ROOT}"/>
<property name="sdk.version" value="${env.ANDROID_SDK_VERSION}"/>
<property name="src" location="src"/>
<property name="out.dir" location="${PRODUCT_DIR}/lib.java"/>
<property name="classes.dir" location="${PRODUCT_DIR}/java/${PACKAGE_NAME}"/>
<property name="jar.dir" location="${out.dir}"/>
<condition property="location.base"
value="${sdk.dir}"
else="${sdk.dir}/platforms/android-${sdk.version}">
<isset property="env.ANDROID_BUILD_TOP"/>
</condition>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
......@@ -39,7 +30,7 @@
lib.jar (see content.gyp:common_aidl). -->
<javac srcdir="${src}:${out.dir}" destdir="${classes.dir}" debug="true" includeantruntime="false">
<classpath>
<pathelement path="${location.base}/android.jar" />
<pathelement path="${ANDROID_SDK}/android.jar" />
<pathelement path="${jar.dir}/chromium_base.jar" />
<pathelement path="${jar.dir}/chromium_net.jar" />
</classpath>
......
......@@ -8,20 +8,11 @@
building content-only instrumentation tests with ant
</description>
<!-- set global properties for this build -->
<property environment="env"/>
<property name="sdk.dir" location="${env.ANDROID_SDK_ROOT}"/>
<property name="sdk.version" value="${env.ANDROID_SDK_VERSION}"/>
<property name="src" location="src"/>
<property name="out.dir" location="${PRODUCT_DIR}/lib.java"/>
<property name="classes.dir" location="${PRODUCT_DIR}/java/${PACKAGE_NAME}"/>
<property name="jar.dir" location="${out.dir}"/>
<condition property="location.base"
value="${sdk.dir}"
else="${sdk.dir}/platforms/android-${sdk.version}">
<isset property="env.ANDROID_BUILD_TOP"/>
</condition>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
......@@ -39,7 +30,7 @@
lib.jar (see content.gyp:common_aidl). -->
<javac srcdir="${src}" destdir="${classes.dir}" debug="true" includeantruntime="false">
<classpath>
<pathelement path="${location.base}/android.jar" />
<pathelement path="${ANDROID_SDK}/android.jar" />
<pathelement path="${jar.dir}/chromium_base.jar" />
<pathelement path="${jar.dir}/chromium_base_javatests.jar" />
<pathelement path="${jar.dir}/chromium_content.jar" />
......
......@@ -8,21 +8,12 @@
building media java source code with ant
</description>
<!-- set global properties for this build -->
<property environment="env"/>
<property name="sdk.dir" location="${env.ANDROID_SDK_ROOT}"/>
<property name="sdk.version" value="${env.ANDROID_SDK_VERSION}"/>
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<property name="out.dir" location="${PRODUCT_DIR}/lib.java"/>
<property name="dest.dir" location="${PRODUCT_DIR}/java/media"/>
<condition property="location.base"
value="${sdk.dir}"
else="${sdk.dir}/platforms/android-${sdk.version}">
<isset property="env.ANDROID_BUILD_TOP"/>
</condition>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
......@@ -36,7 +27,7 @@
<!-- Compile the java code from ${src} into ${dest.dir} -->
<javac srcdir="${src}" destdir="${dest.dir}" debug="true" includeantruntime="false">
<classpath>
<pathelement path="${location.base}/android.jar" />
<pathelement path="${ANDROID_SDK}/android.jar" />
<pathelement path="${out.dir}/chromium_base.jar" />
</classpath>
</javac>
......
......@@ -3,11 +3,6 @@
Building net/ java source code with ant.
</description>
<!-- Set global properties for this build -->
<property environment="env"/>
<property name="sdk.dir" location="${env.ANDROID_SDK_ROOT}"/>
<!-- TODO(jrg): The apk-runner's version is hardcoded to SDK version 14. These
two should be unified. -->
<property name="sdk.version" value="${env.ANDROID_SDK_VERSION}"/>
<property name="src" location="src"/>
<property name="dist" location="dist"/>
<property name="out.dir" location="${PRODUCT_DIR}/lib.java"/>
......@@ -16,15 +11,6 @@
like this are androidified -->
<property name="dest.dir" location="${PRODUCT_DIR}/java/net"/>
<!-- Set path depending on the type of repository. If ANDROID_BUILD_TOP is
set then build using the provided location. Otherwise, assume the build
is using the released SDK and set the path accordingly. -->
<condition property="location.base"
value="${sdk.dir}"
else="${sdk.dir}/platforms/android-${sdk.version}">
<isset property="env.ANDROID_BUILD_TOP"/>
</condition>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
......@@ -37,7 +23,7 @@
description="compile the source " >
<javac srcdir="${src}" destdir="${dest.dir}" debug="true" includeantruntime="false">
<classpath>
<path location="${location.base}/android.jar"/>
<path location="${ANDROID_SDK}/android.jar"/>
<path location="${out.dir}/chromium_base.jar"/>
</classpath>
</javac>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment