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.
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.
8 # To use this, create a gyp target with the following form:
10 # 'target_name': 'my-package_java',
13 # 'jar_path': 'path/to/your.jar',
15 # 'includes': ['path/to/this/gypi/file'],
19 # jar_path - The path to the prebuilt Java JAR file.
23 '<(DEPTH)/build/android/setup.gyp:build_output_dirs'
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)' ],
31 'proguard_config%': '',
32 'proguard_preprocess%': '0',
35 'proguard_preprocess%': 0,
38 ['proguard_preprocess == 1', {
39 'dex_input_jar_path': '<(intermediate_dir)/<(_target_name).pre.jar'
41 'dex_input_jar_path': '<(jar_path)'
45 'dex_input_jar_path': '<(dex_input_jar_path)',
47 'all_dependent_settings': {
49 'input_jars_paths': ['<(dex_input_jar_path)'],
52 'library_dexed_jars_paths': [],
54 'library_dexed_jars_paths': ['<(dex_path)'],
60 ['proguard_preprocess == 1', {
63 'action_name': 'proguard_<(_target_name)',
64 'message': 'Proguard preprocessing <(_target_name) jar',
66 '<(android_sdk_root)/tools/proguard/lib/proguard.jar',
67 '<(DEPTH)/build/android/gyp/util/build_utils.py',
68 '<(DEPTH)/build/android/gyp/proguard.py',
73 '<(dex_input_jar_path)',
76 'python', '<(DEPTH)/build/android/gyp/proguard.py',
77 '--proguard-path=<(android_sdk_root)/tools/proguard/lib/proguard.jar',
78 '--input-path=<(jar_path)',
79 '--output-path=<(dex_input_jar_path)',
80 '--proguard-config=<(proguard_config)',
81 '--classpath=>(input_jars_paths)',
89 'action_name': 'dex_<(_target_name)',
90 'message': 'Dexing <(_target_name) jar',
93 '<(dex_input_jar_path)',
95 'output_path': '<(dex_path)',
97 'includes': [ 'android/dex_action.gypi' ],