| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 # This file is meant to be included into a target to provide a rule | 5 # This file is meant to be included into a target to provide a rule |
| 6 # to package prebuilt Java JARs in a consistent manner. | 6 # to package prebuilt Java JARs in a consistent manner. |
| 7 # | 7 # |
| 8 # To use this, create a gyp target with the following form: | 8 # To use this, create a gyp target with the following form: |
| 9 # { | 9 # { |
| 10 # 'target_name': 'my-package_java', | 10 # 'target_name': 'my-package_java', |
| 11 # 'type': 'none', | 11 # 'type': 'none', |
| 12 # 'variables': { | 12 # 'variables': { |
| 13 # 'jar_path': 'path/to/your.jar', | 13 # 'jar_path': 'path/to/your.jar', |
| 14 # }, | 14 # }, |
| 15 # 'includes': ['path/to/this/gypi/file'], | 15 # 'includes': ['path/to/this/gypi/file'], |
| 16 # } | 16 # } |
| 17 # | 17 # |
| 18 # Required variables: | 18 # Required variables: |
| 19 # jar_path - The path to the prebuilt Java JAR file. | 19 # jar_path - The path to the prebuilt Java JAR file. |
| 20 | 20 |
| 21 { | 21 { |
| 22 'dependencies': [ | 22 'dependencies': [ |
| 23 '<(DEPTH)/build/android/setup.gyp:build_output_dirs' | 23 '<(DEPTH)/build/android/setup.gyp:build_output_dirs' |
| 24 ], | 24 ], |
| 25 'variables': { | 25 'variables': { |
| 26 'dex_path': '<(PRODUCT_DIR)/lib.java/<(_target_name).dex.jar', | 26 'dex_path': '<(PRODUCT_DIR)/lib.java/<(_target_name).dex.jar', |
| 27 'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)', |
| 28 'android_jar': '<(android_sdk)/android.jar', |
| 29 'input_jars_paths': [ '<(android_jar)' ], |
| 30 'proguard_config%': '', |
| 31 'proguard_preprocess%': '0', |
| 32 'variables': { |
| 33 'variables': { |
| 34 'proguard_preprocess%': 0, |
| 35 }, |
| 36 'conditions': [ |
| 37 ['proguard_preprocess == 1', { |
| 38 'dex_input_jar_path': '<(intermediate_dir)/<(_target_name).pre.jar' |
| 39 }, { |
| 40 'dex_input_jar_path': '<(jar_path)' |
| 41 }], |
| 42 ], |
| 43 }, |
| 44 'dex_input_jar_path': '<(dex_input_jar_path)', |
| 27 }, | 45 }, |
| 28 'all_dependent_settings': { | 46 'all_dependent_settings': { |
| 29 'variables': { | 47 'variables': { |
| 30 'input_jars_paths': ['<(jar_path)'], | 48 'input_jars_paths': ['<(dex_input_jar_path)'], |
| 31 'library_dexed_jars_paths': ['<(dex_path)'], | 49 'library_dexed_jars_paths': ['<(dex_path)'], |
| 32 }, | 50 }, |
| 33 }, | 51 }, |
| 52 'conditions' : [ |
| 53 ['proguard_preprocess == 1', { |
| 54 'actions': [ |
| 55 { |
| 56 'action_name': 'proguard_<(_target_name)', |
| 57 'message': 'Proguard preprocessing <(_target_name) jar', |
| 58 'inputs': [ |
| 59 '<(android_sdk_root)/tools/proguard/bin/proguard.sh', |
| 60 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
| 61 '<(DEPTH)/build/android/gyp/proguard.py', |
| 62 '<(jar_path)', |
| 63 '<(proguard_config)', |
| 64 ], |
| 65 'outputs': [ |
| 66 '<(dex_input_jar_path)', |
| 67 ], |
| 68 'action': [ |
| 69 'python', '<(DEPTH)/build/android/gyp/proguard.py', |
| 70 '--proguard-path=<(android_sdk_root)/tools/proguard/bin/proguard.sh'
, |
| 71 '--input-path=<(jar_path)', |
| 72 '--output-path=<(dex_input_jar_path)', |
| 73 '--proguard-config=<(proguard_config)', |
| 74 '--classpath=>(input_jars_paths)', |
| 75 |
| 76 # TODO(newt): remove this once http://crbug.com/177552 is fixed in n
inja. |
| 77 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', |
| 78 ] |
| 79 }, |
| 80 ], |
| 81 }], |
| 82 ], |
| 34 'actions': [ | 83 'actions': [ |
| 35 { | 84 { |
| 36 'action_name': 'dex_<(_target_name)', | 85 'action_name': 'dex_<(_target_name)', |
| 37 'message': 'Dexing <(_target_name) jar', | 86 'message': 'Dexing <(_target_name) jar', |
| 38 'inputs': [ | 87 'inputs': [ |
| 39 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 88 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
| 40 '<(DEPTH)/build/android/gyp/dex.py', | 89 '<(DEPTH)/build/android/gyp/dex.py', |
| 41 '<(jar_path)', | 90 '<(dex_input_jar_path)', |
| 42 ], | 91 ], |
| 43 'outputs': [ | 92 'outputs': [ |
| 44 '<(dex_path)', | 93 '<(dex_path)', |
| 45 ], | 94 ], |
| 46 'action': [ | 95 'action': [ |
| 47 'python', '<(DEPTH)/build/android/gyp/dex.py', | 96 'python', '<(DEPTH)/build/android/gyp/dex.py', |
| 48 '--dex-path=<(dex_path)', | 97 '--dex-path=<(dex_path)', |
| 49 '--android-sdk-tools=<(android_sdk_tools)', | 98 '--android-sdk-tools=<(android_sdk_tools)', |
| 50 | 99 |
| 51 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja
. | 100 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja
. |
| 52 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', | 101 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', |
| 53 | 102 |
| 54 '<(jar_path)', | 103 '<(dex_input_jar_path)', |
| 55 ] | 104 ] |
| 56 }, | 105 }, |
| 57 | 106 |
| 58 ], | 107 ], |
| 59 } | 108 } |
| OLD | NEW |