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
diff --git a/build/java_aidl.gypi b/build/java_aidl.gypi
index 9cdcf62..84e645e 100644
--- a/build/java_aidl.gypi
+++ b/build/java_aidl.gypi
@@ -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',
       ],
     },
   ],