Chromium Code Reviews| Index: build/host_jar.gypi |
| diff --git a/build/host_jar.gypi b/build/host_jar.gypi |
| index 6ccc1bdbad5a7635a6acb867aab474f8dae99966..6731d8778f514827fee0825470b64080586e212b 100644 |
| --- a/build/host_jar.gypi |
| +++ b/build/host_jar.gypi |
| @@ -3,7 +3,9 @@ |
| # found in the LICENSE file. |
| # This file is meant to be included into a target to provide a rule to build |
| -# a JAR file for use on a host in a consistent manner. |
| +# a JAR file for use on a host in a consistent manner. If a main class is |
| +# specified, this file will also generate an executable to run the jar in the |
| +# output folder's /bin/ directory. |
| # |
| # To use this, create a gyp target with the following form: |
| # { |
| @@ -64,14 +66,9 @@ |
| 'variables': { |
| 'extra_options': [], |
| 'java_sources': [ '<!@(find <@(src_paths) -name "*.java")' ], |
| + 'java_sources!': ['<!@(find <@(excluded_src_paths) -name "*.java")'], |
|
cjhopman
2015/04/06 18:56:32
if excluded_src_paths is empty, this will do the w
mikecase (-- gone --)
2015/04/06 21:03:39
Done, but I kept 2 changes I made to the condition
|
| 'conditions': [ |
| - ['"<(excluded_src_paths)" != ""', { |
| - 'java_sources!': ['<!@(find <@(excluded_src_paths) -name "*.java")'] |
| - }], |
| - ['"<(jar_excluded_classes)" != ""', { |
| - 'extra_options': ['--excluded-classes=<(jar_excluded_classes)'] |
| - }], |
| - ['">(main_class)" != ""', { |
| + ['main_class != ""', { |
| 'extra_options': ['--main-class=>(main_class)'] |
| }] |
| ], |
| @@ -93,10 +90,38 @@ |
| '--chromium-code=<(chromium_code)', |
| '--stamp=<(stamp)', |
| '--jar-path=<(jar_path)', |
| + '--jar-excluded-classes=<(jar_excluded_classes)', |
| '<@(extra_options)', |
| '^@(java_sources)', |
| ], |
| }, |
| + ], |
| + 'conditions': [ |
| + ['main_class != ""', { |
| + 'actions': [ |
| + { |
| + 'action_name': 'create_java_binary_script_<(_target_name)', |
| + 'message': 'Creating java binary script <(_target_name)', |
| + 'variables': { |
| + 'output': '<(PRODUCT_DIR)/bin/<(_target_name)', |
| + }, |
| + 'inputs': [ |
| + '<(DEPTH)/build/android/gyp/create_java_binary_script.py', |
| + '<(jar_path)', |
| + ], |
| + 'outputs': [ |
| + '<(output)', |
| + ], |
| + 'action': [ |
| + 'python', '<(DEPTH)/build/android/gyp/create_java_binary_script.py', |
| + '--classpath=>(input_jars_paths)', |
| + '--jar-path=<(jar_path)', |
| + '--output=<(output)', |
| + '--main-class=>(main_class)', |
| + ], |
| + } |
| + ] |
| + }] |
| ] |
| } |