Commit 8bf6c179 authored by cjhopman@chromium.org's avatar cjhopman@chromium.org

Make java_aidl targets export include directories

Native code generation rules typically add their output directory to
their dependent's 'include_dirs'. This change makes targets that include
java_aidl.gypi do a similar thing for other java*.gypi targets.

Make java.gypi pass this variable to ant and content.xml use the
variable rather than hardcoding the directory.

Also, move the aidl output folder into <(SHARED_INTERMEDIATE_DIR) as it
should be.

BUG=


Review URL: https://chromiumcodereview.appspot.com/10855060

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151315 0039d316-1c4b-4281-b951-d872f2087c98
parent 029ed3e3
......@@ -35,6 +35,7 @@
},
'variables': {
'input_jars_paths': [],
'additional_src_dirs': [],
},
'actions': [
{
......@@ -54,6 +55,7 @@
'ant',
'-DPRODUCT_DIR=<(ant_build_out)',
'-DPACKAGE_NAME=<(package_name)',
'-DADDITIONAL_SRC_DIRS=>(additional_src_dirs)',
'-DANDROID_SDK=<(android_sdk)',
'-DANDROID_SDK_ROOT=<(android_sdk_root)',
'-DANDROID_SDK_TOOLS=<(android_sdk_tools)',
......
......@@ -10,6 +10,7 @@
# 'target_name': 'aidl_aidl-file-name',
# 'type': 'none',
# 'variables': {
# 'package_name': <name-of-package>
# 'aidl_interface_file': '<interface-path>/<interface-file>.aidl',
# },
# 'sources': {
......@@ -25,8 +26,15 @@
# <(PRODUCT_DIR)/lib.java/<input-file1>.java
# <(PRODUCT_DIR)/lib.java/<input-file2>.java
# ...
#
# TODO(cjhopman): dependents need to rebuild when this target's inputs have changed.
{
'direct_dependent_settings': {
'variables': {
'additional_src_dirs': ['<(SHARED_INTERMEDIATE_DIR)/<(package_name)/aidl/'],
},
},
'rules': [
{
'rule_name': 'compile_aidl',
......@@ -36,14 +44,14 @@
'<(aidl_interface_file)',
],
'outputs': [
'<(PRODUCT_DIR)/lib.java/<(RULE_INPUT_ROOT).java',
'<(SHARED_INTERMEDIATE_DIR)/<(package_name)/aidl/<(RULE_INPUT_ROOT).java',
],
'action': [
'<(android_sdk_tools)/aidl',
'-p<(android_sdk)/framework.aidl',
'-p<(aidl_interface_file)',
'<(RULE_INPUT_PATH)',
'<(PRODUCT_DIR)/lib.java/<(RULE_INPUT_ROOT).java',
'<(SHARED_INTERMEDIATE_DIR)/<(package_name)/aidl/<(RULE_INPUT_ROOT).java',
],
},
],
......
......@@ -230,6 +230,7 @@
'target_name': 'common_aidl',
'type': 'none',
'variables': {
'package_name': 'content',
'aidl_interface_file': 'public/android/java/src/org/chromium/content/common/common.aidl',
},
'sources': [
......@@ -244,6 +245,7 @@
'dependencies': [
'../base/base.gyp:base_java',
'../net/net.gyp:net_java',
'common_aidl',
'content_common',
],
'export_dependent_settings': [
......
......@@ -14,6 +14,11 @@
<pathelement location="${lib.dir}/chromium_base.jar" />
<pathelement location="${lib.dir}/chromium_net.jar" />
</path>
<path id="javac.srcdirs.additional">
<filelist dir="/" files="${ADDITIONAL_SRC_DIRS}" />
</path>
<!-- Override javac path to include jars in lib.java directory -->
<property-value name="javac.srcdir" value="${src}:${lib.dir}" />
<property-value name="javac.srcdir" value="${src}:${toString:javac.srcdirs.additional}" />
</project>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment