common.xml 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. Macro for checking that a property is correctly set. Performs checks for:
  11. 1. Property is set and not null.
  12. 2. String value of property does not contains any '$' signs.
  13. -->
  14. <macrodef name="check-property-value">
  15. <attribute name="property"/>
  16. <sequential>
  17. <fail message ="Property @{property} is not set.">
  18. <condition>
  19. <or>
  20. <not><isset property="@{property}"/></not>
  21. <length string="${@{property}}" trim="true" when="less" length="1"/>
  22. </or>
  23. </condition>
  24. </fail>
  25. <!--
  26. Check for $ signs. This catches errors when properties are initialized from environment
  27. variables. E.g. if we have <property name="foo" value="${env.bar}" /> but env.bar is
  28. not set then foo will have the literal value of '${env.bar}'.
  29. -->
  30. <fail message="Value checked failed for property: @{property} : ${@{property}}.
  31. Property value contains an uninitialized environment variable.">
  32. <condition>
  33. <contains string="${@{property}}" substring="$"/>
  34. </condition>
  35. </fail>
  36. </sequential>
  37. </macrodef>
  38. <!--
  39. A safe setter for location properties. Checks that a location is not
  40. empty and actually exists. For specifying output directories, location
  41. check can be disabled by specifying check-exists="false".
  42. -->
  43. <macrodef name="property-location">
  44. <attribute name="name"/>
  45. <attribute name="location"/>
  46. <attribute name="check-exists" default="true"/>
  47. <sequential>
  48. <property name="@{name}" location="@{location}"/>
  49. <check-property-value property="@{name}"/>
  50. <fail message="Location specified for @{name} : @{location} does not exist.">
  51. <condition>
  52. <and>
  53. <equals arg1="@{check-exists}" arg2="true"/>
  54. <not><available file="@{location}"/></not>
  55. </and>
  56. </condition>
  57. </fail>
  58. </sequential>
  59. </macrodef>
  60. <!-- A safe setter for property values -->
  61. <macrodef name="property-value">
  62. <attribute name="name"/>
  63. <attribute name="value"/>
  64. <sequential>
  65. <property name="@{name}" value="@{value}"/>
  66. <check-property-value property="@{name}"/>
  67. </sequential>
  68. </macrodef>
  69. <!-- Common environment properties. -->
  70. <property-location name="sdk.dir" location="${ANDROID_SDK_ROOT}"/>
  71. <property-value name="target" value="android-${ANDROID_SDK_VERSION}"/>
  72. <property name="source.dir" location="src"/>
  73. <property-location name="android.gdbserver" location="${ANDROID_GDBSERVER}"/>
  74. <!--
  75. Common directories used by SDK Build, when making changes here
  76. make sure to update gyp files and test scripts constants in
  77. build/android/pylib/constants.py
  78. -->
  79. <!-- Common directory for chromium_*.jars. -->
  80. <property-location name="lib.java.dir" location="${PRODUCT_DIR}/lib.java"/>
  81. <!-- Common directory for test jars. -->
  82. <property-location name="test.lib.java.dir"
  83. location="${PRODUCT_DIR}/test.lib.java"/>
  84. <!-- Common directory for apks. -->
  85. <property-location name="apks.dir" location="${PRODUCT_DIR}/apks"/>
  86. </project>