aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--anttasks/src/anttasks.properties1
-rw-r--r--anttasks/src/com/android/ant/GetTargetTask.java14
-rw-r--r--anttasks/src/com/android/ant/GetUiTargetTask.java153
-rw-r--r--build/tools.atree1
-rw-r--r--common/src/com/android/SdkConstants.java4
-rw-r--r--ddms/app/etc/manifest.txt2
-rw-r--r--files/ant/uibuild.xml259
-rw-r--r--sdkmanager/libs/sdklib/src/com/android/sdklib/IAndroidTarget.java2
-rw-r--r--sdkmanager/libs/sdklib/src/com/android/sdklib/PlatformTarget.java1
-rw-r--r--templates/uibuild.template92
10 files changed, 519 insertions, 10 deletions
diff --git a/anttasks/src/anttasks.properties b/anttasks/src/anttasks.properties
index 78b6513..458f355 100644
--- a/anttasks/src/anttasks.properties
+++ b/anttasks/src/anttasks.properties
@@ -1,6 +1,7 @@
checkenv: com.android.ant.CheckEnvTask
gettype: com.android.ant.GetTypeTask
gettarget: com.android.ant.GetTargetTask
+getuitarget: com.android.ant.GetUiTargetTask
getprojectpaths: com.android.ant.GetProjectPathsTask
getlibpath: com.android.ant.GetLibraryPathTask
dependency: com.android.ant.ComputeDependencyTask
diff --git a/anttasks/src/com/android/ant/GetTargetTask.java b/anttasks/src/com/android/ant/GetTargetTask.java
index ca068fd..ef65e02 100644
--- a/anttasks/src/com/android/ant/GetTargetTask.java
+++ b/anttasks/src/com/android/ant/GetTargetTask.java
@@ -163,7 +163,7 @@ public class GetTargetTask extends Task {
}
System.out.println( "API level: " + androidTarget.getVersion().getApiString());
- antProject.setProperty(mMinSdkVersionOut,
+ antProject.setProperty(mTargetApiOut,
Integer.toString(androidTarget.getVersion().getApiLevel()));
// always check the manifest minSdkVersion.
@@ -195,7 +195,7 @@ public class GetTargetTask extends Task {
visitedJars.add(jarPath);
element = bootclasspath.createPathElement();
- element.setPath(library.getJarPath());
+ element.setPath(jarPath);
}
}
}
@@ -247,9 +247,9 @@ public class GetTargetTask extends Task {
codeName, value));
}
- // set the API level to the previous API level (which is actually the value in
+ // set the minSdkVersion to the previous API level (which is actually the value in
// androidVersion.)
- antProject.setProperty(mTargetApiOut,
+ antProject.setProperty(mMinSdkVersionOut,
Integer.toString(androidVersion.getApiLevel()));
} else if (value.length() > 0) {
@@ -266,8 +266,8 @@ public class GetTargetTask extends Task {
AndroidManifest.ATTRIBUTE_MIN_SDK_VERSION));
}
- // set the target api to the value
- antProject.setProperty(mTargetApiOut, value);
+ // set the minSdkVersion to the value
+ antProject.setProperty(mMinSdkVersionOut, value);
int projectApiLevel = androidVersion.getApiLevel();
if (minSdkValue > androidVersion.getApiLevel()) {
@@ -282,7 +282,7 @@ public class GetTargetTask extends Task {
"WARNING: No minSdkVersion value set. Application will install on all Android versions.");
// set the target api to 1
- antProject.setProperty(mTargetApiOut, "1");
+ antProject.setProperty(mMinSdkVersionOut, "1");
}
} catch (XPathExpressionException e) {
diff --git a/anttasks/src/com/android/ant/GetUiTargetTask.java b/anttasks/src/com/android/ant/GetUiTargetTask.java
new file mode 100644
index 0000000..4756b49
--- /dev/null
+++ b/anttasks/src/com/android/ant/GetUiTargetTask.java
@@ -0,0 +1,153 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.ant;
+
+import com.android.sdklib.IAndroidTarget;
+import com.android.sdklib.IAndroidTarget.IOptionalLibrary;
+import com.android.sdklib.ISdkLog;
+import com.android.sdklib.SdkManager;
+import com.android.sdklib.internal.project.ProjectProperties;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.types.Path;
+import org.apache.tools.ant.types.Path.PathElement;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashSet;
+
+/**
+ * Task to resolve the target of the current Android uiautomator project.
+ *
+ * Out params:
+ * <code>compileClassPathOut</code>: The compile class path for the project.
+ */
+public class GetUiTargetTask extends Task {
+
+ private String mCompileClassPathOut;
+
+ public void setCompileClassPathOut(String compileClassPathOut) {
+ mCompileClassPathOut = compileClassPathOut;
+ }
+
+ @Override
+ public void execute() throws BuildException {
+ if (mCompileClassPathOut == null) {
+ throw new BuildException("Missing attribute compileClassPathOut");
+ }
+
+ Project antProject = getProject();
+
+ // get the SDK location
+ File sdkDir = TaskHelper.getSdkLocation(antProject);
+
+ // get the target property value
+ String targetHashString = antProject.getProperty(ProjectProperties.PROPERTY_TARGET);
+
+ if (targetHashString == null) {
+ throw new BuildException("Android Target is not set.");
+ }
+
+ // load up the sdk targets.
+ final ArrayList<String> messages = new ArrayList<String>();
+ SdkManager manager = SdkManager.createManager(sdkDir.getPath(), new ISdkLog() {
+ @Override
+ public void error(Throwable t, String errorFormat, Object... args) {
+ if (errorFormat != null) {
+ messages.add(String.format("Error: " + errorFormat, args));
+ }
+ if (t != null) {
+ messages.add("Error: " + t.getMessage());
+ }
+ }
+
+ @Override
+ public void printf(String msgFormat, Object... args) {
+ messages.add(String.format(msgFormat, args));
+ }
+
+ @Override
+ public void warning(String warningFormat, Object... args) {
+ messages.add(String.format("Warning: " + warningFormat, args));
+ }
+ });
+
+ if (manager == null) {
+ // since we failed to parse the SDK, lets display the parsing output.
+ for (String msg : messages) {
+ System.out.println(msg);
+ }
+ throw new BuildException("Failed to parse SDK content.");
+ }
+
+ // resolve it
+ IAndroidTarget androidTarget = manager.getTargetFromHashString(targetHashString);
+
+ if (androidTarget == null) {
+ throw new BuildException(String.format(
+ "Unable to resolve project target '%s'", targetHashString));
+ }
+
+ // display the project info
+ System.out.println( "Project Target: " + androidTarget.getName());
+ if (androidTarget.isPlatform() == false) {
+ System.out.println("Vendor: " + androidTarget.getVendor());
+ System.out.println("Platform Version: " + androidTarget.getVersionName());
+ }
+ System.out.println( "API level: " + androidTarget.getVersion().getApiString());
+
+ if (androidTarget.getVersion().getApiLevel() < 16) {
+ throw new BuildException("UI Automator requires API 16");
+ }
+
+ // sets up the properties to find android.jar/framework.aidl/target tools
+ String androidJar = androidTarget.getPath(IAndroidTarget.ANDROID_JAR);
+ String uiAutomatorJar = androidTarget.getPath(IAndroidTarget.UI_AUTOMATOR_JAR);
+
+ // sets up the boot classpath
+
+ // create the Path object
+ Path compileclasspath = new Path(antProject);
+
+ // create a PathElement for the framework jars
+ PathElement element = compileclasspath.createPathElement();
+ element.setPath(androidJar);
+
+ element = compileclasspath.createPathElement();
+ element.setPath(uiAutomatorJar);
+
+ // create PathElement for each optional library.
+ IOptionalLibrary[] libraries = androidTarget.getOptionalLibraries();
+ if (libraries != null) {
+ HashSet<String> visitedJars = new HashSet<String>();
+ for (IOptionalLibrary library : libraries) {
+ String jarPath = library.getJarPath();
+ if (visitedJars.contains(jarPath) == false) {
+ visitedJars.add(jarPath);
+
+ element = compileclasspath.createPathElement();
+ element.setPath(jarPath);
+ }
+ }
+ }
+
+ // sets the path in the project with a reference
+ antProject.addReference(mCompileClassPathOut, compileclasspath);
+ }
+}
diff --git a/build/tools.atree b/build/tools.atree
index 3afa3f7..8f4cc1d 100644
--- a/build/tools.atree
+++ b/build/tools.atree
@@ -73,6 +73,7 @@ bin/uiautomatorviewer tools/uiautomatorviewer
# sdk.git Ant templates for project build files
sdk/templates/build.template tools/lib/build.template
+sdk/templates/uibuild.template tools/lib/uibuild.template
sdk/files/proguard-project.txt tools/lib/proguard-project.txt
sdk/files/proguard-android.txt tools/proguard/proguard-android.txt
sdk/files/proguard-android-optimize.txt tools/proguard/proguard-android-optimize.txt
diff --git a/common/src/com/android/SdkConstants.java b/common/src/com/android/SdkConstants.java
index b9be585..26db7aa 100644
--- a/common/src/com/android/SdkConstants.java
+++ b/common/src/com/android/SdkConstants.java
@@ -16,8 +16,6 @@
package com.android;
-import com.android.AndroidConstants;
-
import java.io.File;
/**
@@ -60,6 +58,8 @@ public final class SdkConstants {
/** Name of the framework library, i.e. "android.jar" */
public static final String FN_FRAMEWORK_LIBRARY = "android.jar"; //$NON-NLS-1$
+ /** Name of the framework library, i.e. "uiautomator.jar" */
+ public static final String FN_UI_AUTOMATOR_LIBRARY = "uiautomator.jar"; //$NON-NLS-1$
/** Name of the layout attributes, i.e. "attrs.xml" */
public static final String FN_ATTRS_XML = "attrs.xml"; //$NON-NLS-1$
/** Name of the layout attributes, i.e. "attrs_manifest.xml" */
diff --git a/ddms/app/etc/manifest.txt b/ddms/app/etc/manifest.txt
index 82af9c9..88249c4 100644
--- a/ddms/app/etc/manifest.txt
+++ b/ddms/app/etc/manifest.txt
@@ -1,3 +1,3 @@
Main-Class: com.android.ddms.Main
-Class-Path: sdkstats.jar ddmlib.jar ddmuilib.jar swtmenubar.jar org.eclipse.jface_3.6.2.M20110210-1200.jar org.eclipse.equinox.common_3.6.0.v20100503.jar org.eclipse.core.commands_3.6.0.I20100512-1500.jar jcommon-1.0.12.jar jfreechart-1.0.9.jar jfreechart-1.0.9-swt.jar osgi.jar
+Class-Path: common.jar sdkstats.jar ddmlib.jar ddmuilib.jar swtmenubar.jar org.eclipse.jface_3.6.2.M20110210-1200.jar org.eclipse.equinox.common_3.6.0.v20100503.jar org.eclipse.core.commands_3.6.0.I20100512-1500.jar jcommon-1.0.12.jar jfreechart-1.0.9.jar jfreechart-1.0.9-swt.jar osgi.jar
diff --git a/files/ant/uibuild.xml b/files/ant/uibuild.xml
new file mode 100644
index 0000000..dcd780e
--- /dev/null
+++ b/files/ant/uibuild.xml
@@ -0,0 +1,259 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="android_rules" default="debug">
+
+ <!--
+ This build file is imported by the project build file. It contains
+ all the targets and tasks necessary to build Android projects, be they
+ regular projects, library projects, or test projects.
+
+ At the beginning of the file is a list of properties that can be overridden
+ by adding them to your ant.properties (properties are immutable, so their
+ first definition sticks and is never changed).
+
+ Follows:
+ - custom task definitions,
+ - more properties (do not override those unless the whole build system is modified).
+ - macros used throughout the build,
+ - base build targets,
+ - debug-specific build targets,
+ - release-specific build targets,
+ - instrument-specific build targets,
+ - test project-specific build targets,
+ - install targets,
+ - help target
+ -->
+
+ <!-- ******************************************************* -->
+ <!-- **************** Overridable Properties *************** -->
+ <!-- ******************************************************* -->
+
+ <!-- You can override these values in your build.xml or ant.properties.
+ Overriding any other properties may result in broken build. -->
+
+ <!-- Tells adb which device to target. You can change this from the command line
+ by invoking "ant -Dadb.device.arg=-d" for device "ant -Dadb.device.arg=-e" for
+ the emulator. -->
+ <property name="adb.device.arg" value="" />
+
+ <!-- filename only of the output file. Cannot be a path -->
+ <property name="out.filename" value="${ant.project.name}.jar" />
+
+ <!-- compilation options -->
+ <property name="java.encoding" value="UTF-8" />
+ <property name="java.target" value="1.5" />
+ <property name="java.source" value="1.5" />
+ <property name="java.compilerargs" value="" />
+
+ <!-- Verbosity -->
+ <property name="verbose" value="false" />
+
+ <!-- ******************************************************* -->
+ <!-- ********************* Custom Tasks ******************** -->
+ <!-- ******************************************************* -->
+
+ <!-- jar file from where the tasks are loaded -->
+ <path id="android.antlibs">
+ <pathelement path="${sdk.dir}/tools/lib/anttasks.jar" />
+ </path>
+
+ <!-- Custom tasks -->
+ <taskdef resource="anttasks.properties" classpathref="android.antlibs" />
+
+ <!-- Emma configuration -->
+ <property name="emma.dir" value="${sdk.dir}/tools/lib" />
+ <path id="emma.lib">
+ <pathelement location="${emma.dir}/emma.jar" />
+ <pathelement location="${emma.dir}/emma_ant.jar" />
+ </path>
+ <taskdef resource="emma_ant.properties" classpathref="emma.lib" />
+ <!-- End of emma configuration -->
+
+
+ <!-- ******************************************************* -->
+ <!-- ******************* Other Properties ****************** -->
+ <!-- ******************************************************* -->
+ <!-- overriding these properties may break the build
+ unless the whole file is updated -->
+
+ <!-- Input directories -->
+ <property name="source.dir" value="src" />
+ <property name="source.absolute.dir" location="${source.dir}" />
+ <property name="jar.libs.dir" value="libs" />
+ <property name="jar.libs.absolute.dir" location="${jar.libs.dir}" />
+
+ <!-- Output directories -->
+ <property name="out.dir" value="bin" />
+ <property name="out.absolute.dir" location="${out.dir}" />
+ <property name="out.classes.absolute.dir" location="${out.dir}/classes" />
+
+ <property name="out.file" value="${out.absolute.dir}/${out.filename}" />
+
+ <!-- tools location -->
+ <property name="android.tools.dir" location="${sdk.dir}/tools" />
+ <property name="android.platform.tools.dir" location="${sdk.dir}/platform-tools" />
+ <condition property="exe" value=".exe" else=""><os family="windows" /></condition>
+ <condition property="bat" value=".bat" else=""><os family="windows" /></condition>
+ <property name="adb" location="${android.platform.tools.dir}/adb${exe}" />
+ <property name="dx" location="${android.platform.tools.dir}/dx${bat}" />
+
+ <!-- Intermediate files -->
+ <property name="dex.file.name" value="classes.dex" />
+ <property name="intermediate.dex.file" location="${out.absolute.dir}/${dex.file.name}" />
+ <property name="resource.package.file.name" value="${ant.project.name}.ap_" />
+
+ <!-- whether we need to fork javac.
+ This is only needed on Windows when running Java < 7 -->
+ <condition else="false" property="need.javac.fork">
+ <and>
+ <matches pattern="1\.[56]" string="${java.specification.version}"/>
+ <not>
+ <os family="unix"/>
+ </not>
+ </and>
+ </condition>
+
+ <macrodef name="run-tests-helper">
+ <attribute name="emma.enabled" default="false" />
+ <element name="extra-instrument-args" optional="yes" />
+ <sequential>
+ <echo level="info">Running tests ...</echo>
+ <exec executable="${adb}" failonerror="true">
+ <arg line="${adb.device.arg}" />
+ <arg value="shell" />
+ <arg value="am" />
+ <arg value="instrument" />
+ <arg value="-w" />
+ <arg value="-e" />
+ <arg value="coverage" />
+ <arg value="@{emma.enabled}" />
+ <extra-instrument-args />
+ <arg value="${project.app.package}/${test.runner}" />
+ </exec>
+ </sequential>
+ </macrodef>
+
+ <!-- ******************************************************* -->
+ <!-- ******************** Build Targets ******************** -->
+ <!-- ******************************************************* -->
+
+ <!-- Basic Ant + SDK check -->
+ <target name="-check-env">
+ <checkenv />
+ </target>
+
+ <!-- empty default pre-clean target. Create a similar target in
+ your build.xml and it'll be called instead of this one. -->
+ <target name="-pre-clean"/>
+
+ <!-- clean target -->
+ <target name="clean" depends="-check-env, -pre-clean"
+ description="Removes output files created by other targets.">
+ <delete dir="${out.absolute.dir}" verbose="${verbose}" />
+ </target>
+
+ <!-- Pre build setup -->
+ <target name="-build-setup" depends="-check-env">
+
+ <echo level="info">Resolving Build Target for ${ant.project.name}...</echo>
+ <!-- load project properties, resolve Android target, library dependencies
+ and set some properties with the results.
+ All property names are passed as parameters ending in -Out -->
+ <getuitarget compileClassPathOut="project.target.class.path" />
+
+ <echo level="info">----------</echo>
+ <echo level="info">Creating output directories if needed...</echo>
+ <mkdir dir="${out.absolute.dir}" />
+ <mkdir dir="${out.classes.absolute.dir}" />
+
+ </target>
+
+ <!-- empty default pre-compile target. Create a similar target in
+ your build.xml and it'll be called instead of this one. -->
+ <target name="-pre-compile"/>
+
+ <!-- Compiles this project's .java files into .class files. -->
+ <target name="compile" depends="-build-setup, -pre-compile">
+ <javac encoding="${java.encoding}"
+ source="${java.source}" target="${java.target}"
+ debug="true" extdirs="" includeantruntime="false"
+ destdir="${out.classes.absolute.dir}"
+ bootclasspathref="project.target.class.path"
+ verbose="${verbose}"
+ fork="${need.javac.fork}">
+ <src path="${source.absolute.dir}" />
+ <compilerarg line="${java.compilerargs}" />
+ </javac>
+ </target>
+
+ <!-- empty default post-compile target. Create a similar target in
+ your build.xml and it'll be called instead of this one. -->
+ <target name="-post-compile"/>
+
+ <!-- Converts this project's .class files into .dex files -->
+ <target name="-dex" depends="compile, -post-compile">
+ <dex executable="${dx}"
+ output="${intermediate.dex.file}"
+ nolocals="@{nolocals}"
+ verbose="${verbose}">
+ <path path="${out.classes.absolute.dir}"/>
+ </dex>
+ </target>
+
+ <!-- empty default post-dex target. Create a similar target in
+ your build.xml and it'll be called instead of this one. -->
+ <target name="-post-dex"/>
+
+ <target name="-jar" depends="-dex, -post-dex" >
+ <jar destfile="${out.file}">
+ <fileset file="${intermediate.dex.file}" />
+ </jar>
+ </target>
+
+ <!-- empty default post-jar target. Create a similar target in
+ your build.xml and it'll be called instead of this one. -->
+ <target name="-post-jar"/>
+
+ <target name="build" depends="-jar, -post-jar" />
+
+ <target name="install" description="Install the test package">
+ <exec executable="${adb}" failonerror="true">
+ <arg line="${adb.device.arg}" />
+ <arg value="push" />
+ <arg value="${out.file}" />
+ <arg value="/data/local/tmp" />
+ </exec>
+ </target>
+
+ <target name="test" description="Runs tests">
+ <!-- todo: fix this -->
+ <fail message="Launching tests from Ant not supported yet" />
+
+ <exec executable="${adb}" failonerror="true">
+ <arg line="${adb.device.arg}" />
+ <arg value="shell" />
+ <arg value="uiautomator" />
+ <arg value="runtest" />
+ <arg value="${out.filename}" />
+ <arg value="-e" />
+ <arg value="class" />
+ <arg value="com.android.uiautomator.samples.skeleton.DemoTestCase" />
+ </exec>
+ </target>
+
+ <target name="help">
+ <!-- displays starts at col 13
+ |13 80| -->
+ <echo>Android Ant Build. Available targets:</echo>
+ <echo> help: Displays this help.</echo>
+ <echo> clean: Removes output files created by other targets.</echo>
+ <echo> build: Builds the test library.</echo>
+ <echo> install: Installs the library on a connected device or</echo>
+ <echo> emulator.</echo>
+ <echo> test: Runs the tests.</echo>
+ <echo></echo>
+ <echo>It is possible to mix targets. For instance:</echo>
+ <echo> ant build install test</echo>
+ <echo>This will build, install and run the test in a single command.</echo>
+ </target>
+
+</project>
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/IAndroidTarget.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/IAndroidTarget.java
index f3236ab..596e837 100644
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/IAndroidTarget.java
+++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/IAndroidTarget.java
@@ -87,6 +87,8 @@ public interface IAndroidTarget extends Comparable<IAndroidTarget> {
* This is deprecated as this is now in the platform tools and not in the platform. */
@Deprecated
public final static int ANDROID_RS_CLANG = 26;
+ /** OS Path to the "uiautomator.jar" file. */
+ public final static int UI_AUTOMATOR_JAR = 27;
/**
* Return value for {@link #getUsbVendorId()} meaning no USB vendor IDs are defined by the
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/PlatformTarget.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/PlatformTarget.java
index 40e2b92..7c2b4aa 100644
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/PlatformTarget.java
+++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/PlatformTarget.java
@@ -91,6 +91,7 @@ final class PlatformTarget implements IAndroidTarget {
// pre-build the path to the platform components
mPaths.put(ANDROID_JAR, mRootFolderOsPath + SdkConstants.FN_FRAMEWORK_LIBRARY);
+ mPaths.put(UI_AUTOMATOR_JAR, mRootFolderOsPath + SdkConstants.FN_UI_AUTOMATOR_LIBRARY);
mPaths.put(SOURCES, mRootFolderOsPath + SdkConstants.FD_ANDROID_SOURCES);
mPaths.put(ANDROID_AIDL, mRootFolderOsPath + SdkConstants.FN_FRAMEWORK_AIDL);
mPaths.put(SAMPLES, mRootFolderOsPath + SdkConstants.OS_PLATFORM_SAMPLES_FOLDER);
diff --git a/templates/uibuild.template b/templates/uibuild.template
new file mode 100644
index 0000000..3170da6
--- /dev/null
+++ b/templates/uibuild.template
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="PROJECT_NAME" default="help">
+
+ <!-- The local.properties file is created and updated by the 'android' tool.
+ It contains the path to the SDK. It should *NOT* be checked into
+ Version Control Systems. -->
+ <property file="local.properties" />
+
+ <!-- The ant.properties file can be created by you. It is only edited by the
+ 'android' tool to add properties to it.
+ This is the place to change some Ant specific build properties.
+ Here are some properties you may want to change/update:
+
+ source.dir
+ The name of the source directory. Default is 'src'.
+ out.dir
+ The name of the output directory. Default is 'bin'.
+
+ For other overridable properties, look at the beginning of the rules
+ files in the SDK, at tools/ant/build.xml
+
+ Properties related to the SDK location or the project target should
+ be updated using the 'android' tool with the 'update' action.
+
+ This file is an integral part of the build system for your
+ application and should be checked into Version Control Systems.
+
+ -->
+ <property file="ant.properties" />
+
+ <!-- if sdk.dir was not set from one of the property file, then
+ get it from the ANDROID_HOME env var.
+ This must be done before we load project.properties since
+ the proguard config can use sdk.dir -->
+ <property environment="env" />
+ <condition property="sdk.dir" value="${env.ANDROID_HOME}">
+ <isset property="env.ANDROID_HOME" />
+ </condition>
+
+ <!-- The project.properties file is created and updated by the 'android'
+ tool, as well as ADT.
+
+ This contains project specific properties such as project target, and library
+ dependencies. Lower level build properties are stored in ant.properties
+ (or in .classpath for Eclipse projects).
+
+ This file is an integral part of the build system for your
+ application and should be checked into Version Control Systems. -->
+ <loadproperties srcFile="project.properties" />
+
+ <!-- quick check on sdk.dir -->
+ <fail
+ message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
+ unless="sdk.dir"
+ />
+
+ <!--
+ Import per project custom build rules if present at the root of the project.
+ This is the place to put custom intermediary targets such as:
+ -pre-build
+ -pre-compile
+ -post-compile (This is typically used for code obfuscation.
+ Compiled code location: ${out.classes.absolute.dir}
+ If this is not done in place, override ${out.dex.input.absolute.dir})
+ -post-package
+ -post-build
+ -pre-clean
+ -->
+ <import file="custom_rules.xml" optional="true" />
+
+ <!-- Import the actual build file.
+
+ To customize existing targets, there are two options:
+ - Customize only one target:
+ - copy/paste the target into this file, *before* the
+ <import> task.
+ - customize it to your needs.
+ - Customize the whole content of build.xml
+ - copy/paste the content of the rules files (minus the top node)
+ into this file, replacing the <import> task.
+ - customize to your needs.
+
+ ***********************
+ ****** IMPORTANT ******
+ ***********************
+ In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
+ in order to avoid having your file be overridden by tools such as "android update project"
+ -->
+ <!-- version-tag: VERSION_TAG -->
+ <import file="${sdk.dir}/tools/ant/uibuild.xml" />
+
+</project>