java_aidl.gypi 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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
  3. # found in the LICENSE file.
  4. # This file is meant to be included into a target to provide a rule
  5. # to build Java aidl files in a consistent manner.
  6. #
  7. # To use this, create a gyp target with the following form:
  8. # {
  9. # 'target_name': 'aidl_aidl-file-name',
  10. # 'type': 'none',
  11. # 'variables': {
  12. # 'package_name': <name-of-package>
  13. # 'aidl_interface_file': '<interface-path>/<interface-file>.aidl',
  14. # },
  15. # 'sources': {
  16. # '<input-path1>/<input-file1>.aidl',
  17. # '<input-path2>/<input-file2>.aidl',
  18. # ...
  19. # },
  20. # 'includes': ['<path-to-this-file>/java_aidl.gypi'],
  21. # }
  22. #
  23. #
  24. # The generated java files will be:
  25. # <(PRODUCT_DIR)/lib.java/<input-file1>.java
  26. # <(PRODUCT_DIR)/lib.java/<input-file2>.java
  27. # ...
  28. #
  29. # TODO(cjhopman): dependents need to rebuild when this target's inputs have changed.
  30. {
  31. 'direct_dependent_settings': {
  32. 'variables': {
  33. 'generated_src_dirs': ['<(SHARED_INTERMEDIATE_DIR)/<(package_name)/aidl/'],
  34. },
  35. },
  36. 'rules': [
  37. {
  38. 'rule_name': 'compile_aidl',
  39. 'extension': 'aidl',
  40. 'inputs': [
  41. '<(android_sdk)/framework.aidl',
  42. '<(aidl_interface_file)',
  43. ],
  44. 'outputs': [
  45. '<(SHARED_INTERMEDIATE_DIR)/<(package_name)/aidl/<(RULE_INPUT_ROOT).java',
  46. ],
  47. 'action': [
  48. '<(android_sdk_tools)/aidl',
  49. '-p<(android_sdk)/framework.aidl',
  50. '-p<(aidl_interface_file)',
  51. '<(RULE_INPUT_PATH)',
  52. '<(SHARED_INTERMEDIATE_DIR)/<(package_name)/aidl/<(RULE_INPUT_ROOT).java',
  53. ],
  54. },
  55. ],
  56. }