OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 # This file is meant to be included into a target to provide a rule | 5 # This file is meant to be included into a target to provide a rule |
6 # to build Android APKs in a consistent manner. | 6 # to build Android APKs in a consistent manner. |
7 # | 7 # |
8 # To use this, create a gyp target with the following form: | 8 # To use this, create a gyp target with the following form: |
9 # { | 9 # { |
10 # 'target_name': 'my_package_apk', | 10 # 'target_name': 'my_package_apk', |
(...skipping 21 matching lines...) Expand all Loading... |
32 # names of some output files. | 32 # names of some output files. |
33 # apk_name - The final apk will be named <apk_name>-debug.apk (or -release) | 33 # apk_name - The final apk will be named <apk_name>-debug.apk (or -release) |
34 # java_in_dir - The top-level java directory. The src should be in | 34 # java_in_dir - The top-level java directory. The src should be in |
35 # <java_in_dir>/src. | 35 # <java_in_dir>/src. |
36 # resource_dir - The directory for resources. | 36 # resource_dir - The directory for resources. |
37 # Optional/automatic variables: | 37 # Optional/automatic variables: |
38 # additional_input_paths - These paths will be included in the 'inputs' list to | 38 # additional_input_paths - These paths will be included in the 'inputs' list to |
39 # ensure that this target is rebuilt when one of these paths changes. | 39 # ensure that this target is rebuilt when one of these paths changes. |
40 # additional_src_dirs - Additional directories with .java files to be compiled | 40 # additional_src_dirs - Additional directories with .java files to be compiled |
41 # and included in the output of this target. | 41 # and included in the output of this target. |
| 42 # asset_location - The directory where assets are located (default: |
| 43 # <PRODUCT_DIR>/<package_name>/assets). |
42 # generated_src_dirs - Same as additional_src_dirs except used for .java files | 44 # generated_src_dirs - Same as additional_src_dirs except used for .java files |
43 # that are generated at build time. This should be set automatically by a | 45 # that are generated at build time. This should be set automatically by a |
44 # target's dependencies. The .java files in these directories are not | 46 # target's dependencies. The .java files in these directories are not |
45 # included in the 'inputs' list (unlike additional_src_dirs). | 47 # included in the 'inputs' list (unlike additional_src_dirs). |
46 # input_jars_paths - The path to jars to be included in the classpath. This | 48 # input_jars_paths - The path to jars to be included in the classpath. This |
47 # should be filled automatically by depending on the appropriate targets. | 49 # should be filled automatically by depending on the appropriate targets. |
48 # native_libs_paths - The path to any native library to be included in this | 50 # native_libs_paths - The path to any native library to be included in this |
49 # target. | 51 # target. |
50 | 52 |
51 { | 53 { |
52 'variables': { | 54 'variables': { |
| 55 'asset_location': '', |
| 56 'additional_input_paths': [], |
53 'input_jars_paths': [], | 57 'input_jars_paths': [], |
54 'native_libs_paths': [], | 58 'native_libs_paths': [], |
55 'additional_input_paths': [], | |
56 'additional_src_dirs': [], | 59 'additional_src_dirs': [], |
57 'generated_src_dirs': [], | 60 'generated_src_dirs': [], |
58 }, | 61 }, |
59 'actions': [ | 62 'actions': [ |
60 { | 63 { |
61 'action_name': 'ant_<(package_name)_apk', | 64 'action_name': 'ant_<(package_name)_apk', |
62 'message': 'Building <(package_name) apk.', | 65 'message': 'Building <(package_name) apk.', |
63 'inputs': [ | 66 'inputs': [ |
64 '<(java_in_dir)/<(package_name)_apk.xml', | |
65 '<(java_in_dir)/AndroidManifest.xml', | 67 '<(java_in_dir)/AndroidManifest.xml', |
| 68 '<(DEPTH)/build/android/ant/chromium-apk.xml', |
66 '<(DEPTH)/build/android/ant/common.xml', | 69 '<(DEPTH)/build/android/ant/common.xml', |
67 '<(DEPTH)/build/android/ant/sdk-targets.xml', | 70 '<(DEPTH)/build/android/ant/sdk-targets.xml', |
68 # If there is a separate find for additonal_src_dirs, it will find the | 71 # If there is a separate find for additonal_src_dirs, it will find the |
69 # wrong .java files when additional_src_dirs is empty. | 72 # wrong .java files when additional_src_dirs is empty. |
70 '>!@(find >(java_in_dir) >(additional_src_dirs) -name "*.java")', | 73 '>!@(find >(java_in_dir) >(additional_src_dirs) -name "*.java")', |
71 '<!@(find <(java_in_dir)/<(resource_dir) -name "*")', | 74 '<!@(find <(java_in_dir)/<(resource_dir) -name "*")', |
72 '>@(input_jars_paths)', | 75 '>@(input_jars_paths)', |
73 '>@(native_libs_paths)', | 76 '>@(native_libs_paths)', |
74 '>@(additional_input_paths)', | 77 '>@(additional_input_paths)', |
75 ], | 78 ], |
76 'outputs': [ | 79 'outputs': [ |
77 '<(PRODUCT_DIR)/apks/<(apk_name)-debug.apk', | 80 '<(PRODUCT_DIR)/apks/<(apk_name)-debug.apk', |
78 ], | 81 ], |
79 'action': [ | 82 'action': [ |
80 'ant', | 83 'ant', |
81 '-DAPP_ABI=<(android_app_abi)', | 84 '-DAPP_ABI=<(android_app_abi)', |
82 '-DANDROID_GDBSERVER=<(android_gdbserver)', | 85 '-DANDROID_GDBSERVER=<(android_gdbserver)', |
83 '-DANDROID_SDK=<(android_sdk)', | 86 '-DANDROID_SDK=<(android_sdk)', |
84 '-DANDROID_SDK_ROOT=<(android_sdk_root)', | 87 '-DANDROID_SDK_ROOT=<(android_sdk_root)', |
85 '-DANDROID_SDK_TOOLS=<(android_sdk_tools)', | 88 '-DANDROID_SDK_TOOLS=<(android_sdk_tools)', |
86 '-DANDROID_SDK_VERSION=<(android_sdk_version)', | 89 '-DANDROID_SDK_VERSION=<(android_sdk_version)', |
87 '-DANDROID_TOOLCHAIN=<(android_toolchain)', | 90 '-DANDROID_TOOLCHAIN=<(android_toolchain)', |
88 '-DCHROMIUM_SRC=<(ant_build_out)/../..', | 91 '-DCHROMIUM_SRC=<(ant_build_out)/../..', |
89 '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)', | 92 '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)', |
90 '-DPRODUCT_DIR=<(ant_build_out)', | 93 '-DPRODUCT_DIR=<(ant_build_out)', |
91 | 94 |
| 95 '-DAPK_NAME=<(apk_name)', |
| 96 '-DASSET_DIR=<(asset_location)', |
92 '-DADDITIONAL_SRC_DIRS=>(additional_src_dirs)', | 97 '-DADDITIONAL_SRC_DIRS=>(additional_src_dirs)', |
| 98 '-DGENERATED_SRC_DIRS=>(generated_src_dirs)', |
93 '-DINPUT_JARS_PATHS=>(input_jars_paths)', | 99 '-DINPUT_JARS_PATHS=>(input_jars_paths)', |
94 '-DGENERATED_SRC_DIRS=>(generated_src_dirs)', | |
95 '-DPACKAGE_NAME=<(package_name)', | 100 '-DPACKAGE_NAME=<(package_name)', |
96 '-DRESOURCE_DIR=<(resource_dir)', | 101 '-DRESOURCE_DIR=<(resource_dir)', |
97 | 102 |
| 103 '-Dbasedir=<(java_in_dir)', |
98 '-buildfile', | 104 '-buildfile', |
99 '<(java_in_dir)/<(package_name)_apk.xml' | 105 '<(DEPTH)/build/android/ant/chromium-apk.xml' |
100 ] | 106 ] |
101 }, | 107 }, |
102 ], | 108 ], |
103 } | 109 } |
OLD | NEW |