OLD | NEW |
(Empty) | |
| 1 <?xml version="1.0" encoding="UTF-8"?> |
| 2 <!-- |
| 3 Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 4 Use of this source code is governed by a BSD-style license that can be |
| 5 found in the LICENSE file. |
| 6 --> |
| 7 <project name="chrome_common_defines"> |
| 8 <!-- Common build properties for Chrome for android. --> |
| 9 |
| 10 <!-- |
| 11 Macro for checking that a property is correctly set. Performs checks for: |
| 12 1. Property is set and not null. |
| 13 2. String value of property does not contains any '$' signs. |
| 14 --> |
| 15 <macrodef name="check-property-value"> |
| 16 <attribute name="property"/> |
| 17 <sequential> |
| 18 <fail message ="Property @{property} is not set."> |
| 19 <condition> |
| 20 <or> |
| 21 <not><isset property="@{property}"/></not> |
| 22 <length string="${@{property}}" trim="true" when="less" length="1"/> |
| 23 </or> |
| 24 </condition> |
| 25 </fail> |
| 26 <!-- |
| 27 Check for $ signs. This catches errors when properties are initialized f
rom environment |
| 28 variables. E.g. if we have <property name="foo" value="${env.bar}" /> bu
t env.bar is |
| 29 not set then foo will have the literal value of '${env.bar}'. |
| 30 --> |
| 31 <fail message="Value checked failed for property: @{property} : ${@{proper
ty}}. |
| 32 Property value contains an uninitialized environment variable."> |
| 33 <condition> |
| 34 <contains string="${@{property}}" substring="$"/> |
| 35 </condition> |
| 36 </fail> |
| 37 </sequential> |
| 38 </macrodef> |
| 39 |
| 40 <!-- |
| 41 A safe setter for location properties. Checks that a location is not |
| 42 empty and actually exists. For specifying output directories, location |
| 43 check can be disabled by specifying check-exists="false". |
| 44 --> |
| 45 <macrodef name="property-location"> |
| 46 <attribute name="name"/> |
| 47 <attribute name="location"/> |
| 48 <attribute name="check-exists" default="true"/> |
| 49 <sequential> |
| 50 <property name="@{name}" location="@{location}"/> |
| 51 <check-property-value property="@{name}"/> |
| 52 <fail message="Location specified for @{name} : @{location} does not exist
."> |
| 53 <condition> |
| 54 <and> |
| 55 <equals arg1="@{check-exists}" arg2="true"/> |
| 56 <not><available type="dir" file="@{location}"/></not> |
| 57 </and> |
| 58 </condition> |
| 59 </fail> |
| 60 </sequential> |
| 61 </macrodef> |
| 62 |
| 63 <!-- A safe setter for property values --> |
| 64 <macrodef name="property-value"> |
| 65 <attribute name="name"/> |
| 66 <attribute name="value"/> |
| 67 <sequential> |
| 68 <property name="@{name}" value="@{value}"/> |
| 69 <check-property-value property="@{name}"/> |
| 70 </sequential> |
| 71 </macrodef> |
| 72 |
| 73 <!-- Common environment properties. --> |
| 74 <property-location name="sdk.dir" location="${ANDROID_SDK_ROOT}"/> |
| 75 <property-value name="target" value="android-${ANDROID_SDK_VERSION}"/> |
| 76 <property name="source.dir" location="src"/> |
| 77 <property-location name="toolchain.dir" location="${ANDROID_TOOLCHAIN}"/> |
| 78 </project> |
OLD | NEW |