Index: build/android/ant/common.xml |
diff --git a/build/android/ant/common.xml b/build/android/ant/common.xml |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c7c730ba3b45e5a9a4b6528b7d3229cb16a63e70 |
--- /dev/null |
+++ b/build/android/ant/common.xml |
@@ -0,0 +1,78 @@ |
+<?xml version="1.0" encoding="UTF-8"?> |
+<!-- |
+ Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+ Use of this source code is governed by a BSD-style license that can be |
+ found in the LICENSE file. |
+--> |
+<project name="chrome_common_defines"> |
+ <!-- Common build properties for Chrome for android. --> |
+ |
+ <!-- |
+ Macro for checking that a property is correctly set. Performs checks for: |
+ 1. Property is set and not null. |
+ 2. String value of property does not contains any '$' signs. |
+ --> |
+ <macrodef name="check-property-value"> |
+ <attribute name="property"/> |
+ <sequential> |
+ <fail message ="Property @{property} is not set."> |
+ <condition> |
+ <or> |
+ <not><isset property="@{property}"/></not> |
+ <length string="${@{property}}" trim="true" when="less" length="1"/> |
+ </or> |
+ </condition> |
+ </fail> |
+ <!-- |
+ Check for $ signs. This catches errors when properties are initialized from environment |
+ variables. E.g. if we have <property name="foo" value="${env.bar}" /> but env.bar is |
+ not set then foo will have the literal value of '${env.bar}'. |
+ --> |
+ <fail message="Value checked failed for property: @{property} : ${@{property}}. |
+ Property value contains an uninitialized environment variable."> |
+ <condition> |
+ <contains string="${@{property}}" substring="$"/> |
+ </condition> |
+ </fail> |
+ </sequential> |
+ </macrodef> |
+ |
+ <!-- |
+ A safe setter for location properties. Checks that a location is not |
+ empty and actually exists. For specifying output directories, location |
+ check can be disabled by specifying check-exists="false". |
+ --> |
+ <macrodef name="property-location"> |
+ <attribute name="name"/> |
+ <attribute name="location"/> |
+ <attribute name="check-exists" default="true"/> |
+ <sequential> |
+ <property name="@{name}" location="@{location}"/> |
+ <check-property-value property="@{name}"/> |
+ <fail message="Location specified for @{name} : @{location} does not exist."> |
+ <condition> |
+ <and> |
+ <equals arg1="@{check-exists}" arg2="true"/> |
+ <not><available type="dir" file="@{location}"/></not> |
+ </and> |
+ </condition> |
+ </fail> |
+ </sequential> |
+ </macrodef> |
+ |
+ <!-- A safe setter for property values --> |
+ <macrodef name="property-value"> |
+ <attribute name="name"/> |
+ <attribute name="value"/> |
+ <sequential> |
+ <property name="@{name}" value="@{value}"/> |
+ <check-property-value property="@{name}"/> |
+ </sequential> |
+ </macrodef> |
+ |
+ <!-- Common environment properties. --> |
+ <property-location name="sdk.dir" location="${ANDROID_SDK_ROOT}"/> |
+ <property-value name="target" value="android-${ANDROID_SDK_VERSION}"/> |
+ <property name="source.dir" location="src"/> |
+ <property-location name="toolchain.dir" location="${ANDROID_TOOLCHAIN}"/> |
+</project> |