summaryrefslogtreecommitdiffstats
path: root/build/android/dex_action.gypi
diff options
context:
space:
mode:
authorcjhopman@chromium.org <cjhopman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-18 02:33:37 +0000
committercjhopman@chromium.org <cjhopman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-18 02:33:37 +0000
commit6593b277eafa971ae5e05a5200e6757e71684628 (patch)
tree393077d1827d94333c9b14e3563a3bd54e44f664 /build/android/dex_action.gypi
parent977b69904d8625342ca73b3f1636ba716a565c7b (diff)
downloadchromium_src-6593b277eafa971ae5e05a5200e6757e71684628.zip
chromium_src-6593b277eafa971ae5e05a5200e6757e71684628.tar.gz
chromium_src-6593b277eafa971ae5e05a5200e6757e71684628.tar.bz2
[Android] Fix proguard
Gyp supports only very limited ways of changing behavior based upon CONFIGURATION_NAME. Particularly, it does not support the way that was supposed to enable/disable use of proguard. Instead of trying to switch behavior in gyp, instead pass CONFIGURATION_NAME, proguard_enabled, and proguard_enabled_dex_input_path to dex.py and switch the behavior there. This also extracts the dex actions into build/android/dex_action.gypi and uses that for the actions in both build/java.gypi and build/java_apk.gypi. BUG=240837 Review URL: https://chromiumcodereview.appspot.com/15231006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@200958 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/android/dex_action.gypi')
-rw-r--r--build/android/dex_action.gypi61
1 files changed, 61 insertions, 0 deletions
diff --git a/build/android/dex_action.gypi b/build/android/dex_action.gypi
new file mode 100644
index 0000000..c41effb
--- /dev/null
+++ b/build/android/dex_action.gypi
@@ -0,0 +1,61 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# This file is meant to be included into an action to provide a rule that dexes
+# compiled java files. If proguard_enabled == "true" and CONFIGURATION_NAME ==
+# "Release", then it will dex the proguard_enabled_input_path instead of the
+# normal dex_input_paths/dex_generated_input_paths.
+#
+# To use this, create a gyp target with the following form:
+# {
+# 'action_name': 'some name for the action'
+# 'actions': [
+# 'variables': {
+# 'dex_input_paths': [ 'files to dex (when proguard is not used) and add to input paths' ],
+# 'dex_generated_input_dirs': [ 'dirs that contain generated files to dex' ],
+# 'input_paths': [ 'additional files to be added to the list of inputs' ],
+#
+# # For targets that use proguard:
+# 'proguard_enabled': 'true',
+# 'proguard_enabled_input_path': 'path to dex when using proguard',
+# },
+# 'includes': [ 'relative/path/to/dex_action.gypi' ],
+# ],
+# },
+#
+
+{
+ 'message': 'Creating dex file: <(output_path)',
+ 'variables': {
+ 'dex_input_paths': [],
+ 'dex_generated_input_dirs': [],
+ 'input_paths': [],
+ 'proguard_enabled%': 'false',
+ 'proguard_enabled_input_path%': '',
+ },
+ 'inputs': [
+ '<(DEPTH)/build/android/gyp/util/build_utils.py',
+ '<(DEPTH)/build/android/gyp/util/md5_check.py',
+ '<(DEPTH)/build/android/gyp/dex.py',
+ '>@(input_paths)',
+ '>@(dex_input_paths)',
+ ],
+ 'outputs': [
+ '<(output_path)',
+ ],
+ 'action': [
+ 'python', '<(DEPTH)/build/android/gyp/dex.py',
+ '--dex-path=<(output_path)',
+ '--android-sdk-root=<(android_sdk_root)',
+ '--configuration-name=<(CONFIGURATION_NAME)',
+ '--proguard-enabled=<(proguard_enabled)',
+ '--proguard-enabled-input-path=<(proguard_enabled_input_path)',
+
+ # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja.
+ '--ignore=>!(echo \'>(_inputs)\' | md5sum)',
+
+ '>@(dex_input_paths)',
+ '>@(dex_generated_input_dirs)',
+ ]
+}