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 Java in a consistent manner. | 6 # to build Java 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_java', | 10 # 'target_name': 'my-package_java', |
11 # 'type': 'none', | 11 # 'type': 'none', |
12 # 'variables': { | 12 # 'variables': { |
13 # 'package_name': 'my-package', | 13 # 'package_name': 'my-package', |
14 # 'java_in_dir': 'path/to/package/root', | 14 # 'java_in_dir': 'path/to/package/root', |
15 # }, | 15 # }, |
16 # 'includes': ['path/to/this/gypi/file'], | 16 # 'includes': ['path/to/this/gypi/file'], |
17 # } | 17 # } |
18 # | 18 # |
19 # Note that this assumes that there's ant buildfile with package_name in | 19 # Note that this assumes that there's ant buildfile with package_name in |
20 # java_in_dir. So if if you have package_name="base" and | 20 # java_in_dir. So if if you have package_name="base" and |
21 # java_in_dir="base/android/java" you should have a directory structure like: | 21 # java_in_dir="base/android/java" you should have a directory structure like: |
22 # | 22 # |
23 # base/android/java/base.xml | 23 # base/android/java/base.xml |
24 # base/android/java/org/chromium/base/Foo.java | 24 # base/android/java/org/chromium/base/Foo.java |
25 # base/android/java/org/chromium/base/Bar.java | 25 # base/android/java/org/chromium/base/Bar.java |
26 # | 26 # |
27 # Finally, the generated jar-file will be: | 27 # Finally, the generated jar-file will be: |
28 # <(PRODUCT_DIR)/lib.java/chromium_base.jar | 28 # <(PRODUCT_DIR)/lib.java/chromium_base.jar |
29 # | |
30 # TODO(yfriedman): The "finally" statement isn't entirely true yet, as we don't | |
31 # auto-generate the ant file yet. | |
32 | 29 |
33 { | 30 { |
| 31 'direct_dependent_settings': { |
| 32 'variables': { |
| 33 'input_jars_paths': ['<(PRODUCT_DIR)/lib.java/chromium_<(package_name).jar
'], |
| 34 }, |
| 35 }, |
| 36 'variables': { |
| 37 'input_jars_paths': [], |
| 38 }, |
34 'actions': [ | 39 'actions': [ |
35 { | 40 { |
36 'action_name': 'ant_<(package_name)', | 41 'action_name': 'ant_<(package_name)', |
37 'message': 'Building <(package_name) java sources.', | 42 'message': 'Building <(package_name) java sources.', |
38 'inputs': [ | 43 'inputs': [ |
39 '<(java_in_dir)/<(package_name).xml', | 44 'android/ant/common.xml', |
40 '<!@(find <(java_in_dir) -name "*.java")' | 45 'android/ant/chromium-jars.xml', |
| 46 '<(java_in_dir)/<(package_name).xml', |
| 47 '<!@(find <(java_in_dir) -name "*.java")', |
| 48 '>@(input_jars_paths)', |
41 ], | 49 ], |
42 'outputs': [ | 50 'outputs': [ |
43 '<(PRODUCT_DIR)/lib.java/chromium_<(package_name).jar', | 51 '<(PRODUCT_DIR)/lib.java/chromium_<(package_name).jar', |
44 ], | 52 ], |
45 'action': [ | 53 'action': [ |
46 'ant', | 54 'ant', |
47 '-DPRODUCT_DIR=<(ant_build_out)', | 55 '-DPRODUCT_DIR=<(ant_build_out)', |
48 '-DPACKAGE_NAME=<(package_name)', | 56 '-DPACKAGE_NAME=<(package_name)', |
49 '-DANDROID_SDK=<(android_sdk)', | 57 '-DANDROID_SDK=<(android_sdk)', |
50 '-DANDROID_SDK_ROOT=<(android_sdk_root)', | 58 '-DANDROID_SDK_ROOT=<(android_sdk_root)', |
51 '-DANDROID_SDK_TOOLS=<(android_sdk_tools)', | 59 '-DANDROID_SDK_TOOLS=<(android_sdk_tools)', |
52 '-DANDROID_SDK_VERSION=<(android_sdk_version)', | 60 '-DANDROID_SDK_VERSION=<(android_sdk_version)', |
53 '-DANDROID_TOOLCHAIN=<(android_toolchain)', | 61 '-DANDROID_TOOLCHAIN=<(android_toolchain)', |
54 '-buildfile', | 62 '-buildfile', |
55 '<(java_in_dir)/<(package_name).xml', | 63 '<(java_in_dir)/<(package_name).xml', |
56 ] | 64 ] |
57 }, | 65 }, |
58 ], | 66 ], |
59 } | 67 } |
OLD | NEW |