Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2130)

Unified Diff: build/java.gypi

Issue 10987083: Add more generic support for java targets bundling multiple directories (Closed) Base URL: http://git.chromium.org/chromium/src.git@apk_jar
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/ant/chromium-jars.xml ('k') | build/java_aidl.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/java.gypi
diff --git a/build/java.gypi b/build/java.gypi
index 249f063be6bbebe197bfbc40113ff0b1fcfb5487..05e89c9d0ea60ed7b44d44963fc22a1298079ffc 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'
« no previous file with comments | « build/android/ant/chromium-jars.xml ('k') | build/java_aidl.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698