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..f759c40298eb769e4216e53ae6c6f0fc00602a13 |
--- /dev/null |
+++ b/build/android/ant/common.xml |
@@ -0,0 +1,94 @@ |
+<?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"> |
+ <!-- |
nilesh
2012/07/25 16:57:22
<!-- Common build properties for Chrome for androi
Yaron
2012/07/25 18:12:23
Done.
|
+ Common build properties for Chrome for android. |
+ --> |
+ |
+<!-- Macro for checking that a property is correctly set. |
nilesh
2012/07/25 16:57:22
We should settle on one format for multi-line comm
Yaron
2012/07/25 18:12:23
Done.
|
+ 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}'. |
+ --> |
nilesh
2012/07/25 16:57:22
Match this with <!--
Yaron
2012/07/25 18:12:23
Done.
|
+ <fail message="Value checked failed for property: @{property} : ${@{property}}. |
+Property value contains an uninitialized environment variable."> |
+ <condition> |
+ <contains string="${@{property}}" substring="$" /> |
+ </condition> |
nilesh
2012/07/25 16:57:22
fix indent.
Yaron
2012/07/25 18:12:23
Done.
|
+ </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" |
+ --> |
nilesh
2012/07/25 16:57:22
This has a different indentation than the comments
Yaron
2012/07/25 18:12:23
Done.
|
+ <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 environment="env" /> |
+ <property-location name="sdk.dir" location="${env.ANDROID_SDK_ROOT}" /> |
+ <property-location name="toolchain.dir" location="${env.ANDROID_TOOLCHAIN}" /> |
+ <property name="source.dir" location="src" /> |
+ <property-value name="target" value="android-${env.ANDROID_SDK_VERSION}" /> |
+ <property-value name="sdk.version" value="${env.ANDROID_SDK_VERSION}" /> |
+ |
+ <!-- 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> |
+</project> |
+ |
nilesh
2012/07/25 16:57:22
remove trailing new lines.
|
+ |