diff options
author | cjhopman@chromium.org <cjhopman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-28 18:22:29 +0000 |
---|---|---|
committer | cjhopman@chromium.org <cjhopman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-28 18:22:29 +0000 |
commit | d54f19b08781809524c67379a7de4348e16e8664 (patch) | |
tree | 081b405cb026cda8be1f11143b6db6832dd57df7 /build/java.gypi | |
parent | 55c566d7b3fa0133e20adb601167c2925fc9eb6a (diff) | |
download | chromium_src-d54f19b08781809524c67379a7de4348e16e8664.zip chromium_src-d54f19b08781809524c67379a7de4348e16e8664.tar.gz chromium_src-d54f19b08781809524c67379a7de4348e16e8664.tar.bz2 |
Add more generic support for java targets bundling multiple directories
Currently chromium_testshell_test_apk and content_shell_test_apk compile
and package java files from two different directories. Supporting this
in a good way is a requirement for using a single ant template for all
apks.
Introduce a new gyp variable for apk/jar targets, generated_src_dirs.
Now, generated_src_dirs is for directories that contain .java files that
are generated at build time and additional_src_dirs is for extra normal
directories to include in the jar/apk.
Change content_shell_test_apk and chromium_testshell_test_apk to use
additional_src_dirs for their extra dirs.
Add documentation for the gyp variables for jar/apk targets.
Reorder the ant defines in the java.gypi and java_apk.gypi.
BUG=136756,146056
Review URL: https://chromiumcodereview.appspot.com/10987083
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159299 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/java.gypi')
-rw-r--r-- | build/java.gypi | 41 |
1 files changed, 27 insertions, 14 deletions
diff --git a/build/java.gypi b/build/java.gypi index 249f063..05e89c9 100644 --- a/build/java.gypi +++ b/build/java.gypi @@ -16,16 +16,25 @@ # 'includes': ['path/to/this/gypi/file'], # } # -# Note that this assumes that there's ant buildfile with package_name in -# java_in_dir. So if if you have package_name="base" and -# java_in_dir="base/android/java" you should have a directory structure like: +# The generated jar-file will be: +# <(PRODUCT_DIR)/lib.java/chromium_<(package_name).jar # -# base/android/java/base.xml -# base/android/java/org/chromium/base/Foo.java -# base/android/java/org/chromium/base/Bar.java -# -# Finally, the generated jar-file will be: -# <(PRODUCT_DIR)/lib.java/chromium_base.jar +# Required variables: +# package_name - Used to name the intermediate output directory and in the +# names of some output files. +# java_in_dir - The top-level java directory. The src should be in +# <java_in_dir>/src. +# Optional/automatic variables: +# additional_input_paths - These paths will be included in the 'inputs' list to +# ensure that this target is rebuilt when one of these paths changes. +# additional_src_dirs - Additional directories with .java files to be compiled +# and included in the output of this target. +# generated_src_dirs - Same as additional_src_dirs except used for .java files +# that are generated at build time. This should be set automatically by a +# target's dependencies. The .java files in these directories are not +# included in the 'inputs' list (unlike additional_src_dirs). +# input_jars_paths - The path to jars to be included in the classpath. This +# should be filled automatically by depending on the appropriate targets. { 'dependencies': [ @@ -40,6 +49,7 @@ 'input_jars_paths': [], 'additional_src_dirs': [], 'additional_input_paths': [], + 'generated_src_dirs': [], }, 'actions': [ { @@ -48,7 +58,7 @@ 'inputs': [ 'android/ant/common.xml', 'android/ant/chromium-jars.xml', - '<!@(find <(java_in_dir) -name "*.java")', + '>!@(find >(java_in_dir) >(additional_src_dirs) -name "*.java")', '>@(input_jars_paths)', '>@(additional_input_paths)', ], @@ -57,15 +67,18 @@ ], 'action': [ 'ant', - '-DPRODUCT_DIR=<(ant_build_out)', - '-DPACKAGE_NAME=<(package_name)', - '-DINPUT_JARS_PATHS=>(input_jars_paths)', - '-DADDITIONAL_SRC_DIRS=>(additional_src_dirs)', '-DANDROID_SDK=<(android_sdk)', '-DANDROID_SDK_ROOT=<(android_sdk_root)', '-DANDROID_SDK_TOOLS=<(android_sdk_tools)', '-DANDROID_SDK_VERSION=<(android_sdk_version)', '-DANDROID_GDBSERVER=<(android_gdbserver)', + '-DPRODUCT_DIR=<(ant_build_out)', + + '-DADDITIONAL_SRC_DIRS=>(additional_src_dirs)', + '-DGENERATED_SRC_DIRS=>(generated_src_dirs)', + '-DINPUT_JARS_PATHS=>(input_jars_paths)', + '-DPACKAGE_NAME=<(package_name)', + '-Dbasedir=<(java_in_dir)', '-buildfile', '<(DEPTH)/build/android/ant/chromium-jars.xml' |