[email protected] | 3da3827 | 2013-03-29 04:56:56 | [diff] [blame] | 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 | |
| 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. |
| 7 | # |
| 8 | # To use this, create a gyp target with the following form: |
| 9 | # { |
| 10 | # 'target_name': 'my-package_java', |
| 11 | # 'type': 'none', |
| 12 | # 'variables': { |
| 13 | # 'jar_path': 'path/to/your.jar', |
| 14 | # }, |
| 15 | # 'includes': ['path/to/this/gypi/file'], |
| 16 | # } |
| 17 | # |
| 18 | # Required variables: |
| 19 | # jar_path - The path to the prebuilt Java JAR file. |
| 20 | |
| 21 | { |
| 22 | 'dependencies': [ |
[email protected] | 225ec63 | 2013-04-03 18:20:22 | [diff] [blame] | 23 | '<(DEPTH)/build/android/setup.gyp:build_output_dirs' |
[email protected] | 3da3827 | 2013-03-29 04:56:56 | [diff] [blame] | 24 | ], |
| 25 | 'variables': { |
| 26 | 'dex_path': '<(PRODUCT_DIR)/lib.java/<(_target_name).dex.jar', |
[email protected] | 965ec7e | 2013-08-19 22:45:34 | [diff] [blame] | 27 | 'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)', |
| 28 | 'android_jar': '<(android_sdk)/android.jar', |
| 29 | 'input_jars_paths': [ '<(android_jar)' ], |
davileen | 57dc71e | 2014-12-02 01:31:22 | [diff] [blame] | 30 | 'neverlink%': 0, |
[email protected] | 965ec7e | 2013-08-19 22:45:34 | [diff] [blame] | 31 | 'proguard_config%': '', |
| 32 | 'proguard_preprocess%': '0', |
| 33 | 'variables': { |
| 34 | 'variables': { |
| 35 | 'proguard_preprocess%': 0, |
| 36 | }, |
| 37 | 'conditions': [ |
| 38 | ['proguard_preprocess == 1', { |
| 39 | 'dex_input_jar_path': '<(intermediate_dir)/<(_target_name).pre.jar' |
| 40 | }, { |
| 41 | 'dex_input_jar_path': '<(jar_path)' |
| 42 | }], |
| 43 | ], |
| 44 | }, |
| 45 | 'dex_input_jar_path': '<(dex_input_jar_path)', |
[email protected] | 3da3827 | 2013-03-29 04:56:56 | [diff] [blame] | 46 | }, |
| 47 | 'all_dependent_settings': { |
| 48 | 'variables': { |
[email protected] | 965ec7e | 2013-08-19 22:45:34 | [diff] [blame] | 49 | 'input_jars_paths': ['<(dex_input_jar_path)'], |
davileen | 57dc71e | 2014-12-02 01:31:22 | [diff] [blame] | 50 | 'conditions': [ |
| 51 | ['neverlink == 1', { |
| 52 | 'library_dexed_jars_paths': [], |
| 53 | }, { |
| 54 | 'library_dexed_jars_paths': ['<(dex_path)'], |
| 55 | }], |
| 56 | ], |
[email protected] | 3da3827 | 2013-03-29 04:56:56 | [diff] [blame] | 57 | }, |
| 58 | }, |
[email protected] | 965ec7e | 2013-08-19 22:45:34 | [diff] [blame] | 59 | 'conditions' : [ |
| 60 | ['proguard_preprocess == 1', { |
| 61 | 'actions': [ |
| 62 | { |
| 63 | 'action_name': 'proguard_<(_target_name)', |
| 64 | 'message': 'Proguard preprocessing <(_target_name) jar', |
| 65 | 'inputs': [ |
[email protected] | ed6659c | 2014-07-11 01:49:41 | [diff] [blame] | 66 | '<(android_sdk_root)/tools/proguard/lib/proguard.jar', |
[email protected] | 965ec7e | 2013-08-19 22:45:34 | [diff] [blame] | 67 | '<(DEPTH)/build/android/gyp/util/build_utils.py', |
| 68 | '<(DEPTH)/build/android/gyp/proguard.py', |
| 69 | '<(jar_path)', |
| 70 | '<(proguard_config)', |
| 71 | ], |
| 72 | 'outputs': [ |
| 73 | '<(dex_input_jar_path)', |
| 74 | ], |
| 75 | 'action': [ |
| 76 | 'python', '<(DEPTH)/build/android/gyp/proguard.py', |
[email protected] | ed6659c | 2014-07-11 01:49:41 | [diff] [blame] | 77 | '--proguard-path=<(android_sdk_root)/tools/proguard/lib/proguard.jar', |
[email protected] | 965ec7e | 2013-08-19 22:45:34 | [diff] [blame] | 78 | '--input-path=<(jar_path)', |
| 79 | '--output-path=<(dex_input_jar_path)', |
| 80 | '--proguard-config=<(proguard_config)', |
| 81 | '--classpath=>(input_jars_paths)', |
[email protected] | 965ec7e | 2013-08-19 22:45:34 | [diff] [blame] | 82 | ] |
| 83 | }, |
| 84 | ], |
| 85 | }], |
davileen | 57dc71e | 2014-12-02 01:31:22 | [diff] [blame] | 86 | ['neverlink == 0', { |
| 87 | 'actions': [ |
| 88 | { |
| 89 | 'action_name': 'dex_<(_target_name)', |
| 90 | 'message': 'Dexing <(_target_name) jar', |
| 91 | 'variables': { |
| 92 | 'dex_input_paths': [ |
| 93 | '<(dex_input_jar_path)', |
| 94 | ], |
| 95 | 'output_path': '<(dex_path)', |
| 96 | }, |
| 97 | 'includes': [ 'android/dex_action.gypi' ], |
| 98 | }, |
| 99 | ], |
| 100 | }], |
[email protected] | 3da3827 | 2013-03-29 04:56:56 | [diff] [blame] | 101 | ], |
| 102 | } |