OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 run the equivalent of jarjar on Java resources (layout.xml files). | 6 # to run the equivalent of jarjar on Java resources (layout.xml files). |
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 # 'java_in_dir': 'path/to/package/root', | 13 # 'java_in_dir': 'path/to/package/root', |
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 # res_dir - The top-level resources folder. | 19 # res_dir - The top-level resources folder. |
20 # rules_file - Path to the file containing jar-jar rules. | 20 # rules_file - Path to the file containing jar-jar rules. |
21 | 21 |
22 { | 22 { |
23 'variables': { | 23 'variables': { |
24 'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)', | 24 'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)', |
25 'jarjar_stamp': '<(intermediate_dir)/jarjar_resources.stamp', | 25 'jarjar_stamp': '<(intermediate_dir)/jarjar_resources.stamp', |
26 'resource_input_paths': ['<!@(find <(res_dir) -type f)'], | 26 'resource_input_paths': ['<!@(find <(res_dir) -type f | sort)'], |
27 }, | 27 }, |
28 'actions': [{ | 28 'actions': [{ |
29 'action_name': 'jarjar resources', | 29 'action_name': 'jarjar resources', |
30 'message': 'Copying and jar-jaring resources for <(_target_name)', | 30 'message': 'Copying and jar-jaring resources for <(_target_name)', |
31 'variables': { | 31 'variables': { |
32 'out_dir': '<(intermediate_dir)/jarjar_res', | 32 'out_dir': '<(intermediate_dir)/jarjar_res', |
33 }, | 33 }, |
34 'inputs': [ | 34 'inputs': [ |
35 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 35 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
36 '<(DEPTH)/build/android/gyp/jarjar_resources.py', | 36 '<(DEPTH)/build/android/gyp/jarjar_resources.py', |
37 '>@(resource_input_paths)', | 37 '>@(resource_input_paths)', |
38 ], | 38 ], |
39 'outputs': [ | 39 'outputs': [ |
40 '<(jarjar_stamp)', | 40 '<(jarjar_stamp)', |
41 ], | 41 ], |
42 'action': [ | 42 'action': [ |
43 'python', '../build/android/gyp/jarjar_resources.py', | 43 'python', '../build/android/gyp/jarjar_resources.py', |
44 '--input-dir', '<(res_dir)', | 44 '--input-dir', '<(res_dir)', |
45 '--output-dir', '<(out_dir)', | 45 '--output-dir', '<(out_dir)', |
46 '--rules-path', '<(rules_file)', | 46 '--rules-path', '<(rules_file)', |
47 '--stamp', '<(jarjar_stamp)', | 47 '--stamp', '<(jarjar_stamp)', |
48 ] | 48 ] |
49 }], | 49 }], |
50 } | 50 } |
OLD | NEW |