[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', |
| 27 | }, |
| 28 | 'all_dependent_settings': { |
| 29 | 'variables': { |
| 30 | 'input_jars_paths': ['<(jar_path)'], |
| 31 | 'library_dexed_jars_paths': ['<(dex_path)'], |
| 32 | }, |
| 33 | }, |
| 34 | 'actions': [ |
| 35 | { |
| 36 | 'action_name': 'dex_<(_target_name)', |
| 37 | 'message': 'Dexing <(_target_name) jar', |
| 38 | 'inputs': [ |
[email protected] | c335137 | 2013-04-05 04:13:50 | [diff] [blame] | 39 | '<(DEPTH)/build/android/gyp/util/build_utils.py', |
[email protected] | c3aae52a | 2013-04-04 09:35:50 | [diff] [blame] | 40 | '<(DEPTH)/build/android/gyp/dex.py', |
[email protected] | 3da3827 | 2013-03-29 04:56:56 | [diff] [blame] | 41 | '<(jar_path)', |
| 42 | ], |
| 43 | 'outputs': [ |
| 44 | '<(dex_path)', |
| 45 | ], |
| 46 | 'action': [ |
[email protected] | c3aae52a | 2013-04-04 09:35:50 | [diff] [blame] | 47 | 'python', '<(DEPTH)/build/android/gyp/dex.py', |
[email protected] | 3da3827 | 2013-03-29 04:56:56 | [diff] [blame] | 48 | '--dex-path=<(dex_path)', |
| 49 | '--android-sdk-root=<(android_sdk_root)', |
| 50 | |
| 51 | # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja. |
| 52 | '--ignore=>!(echo \'>(_inputs)\' | md5sum)', |
| 53 | |
| 54 | '<(jar_path)', |
| 55 | ] |
| 56 | }, |
| 57 | |
| 58 | ], |
| 59 | } |