Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(613)

Unified Diff: build/host_jar.gypi

Issue 1057783002: Add new GN junit binary template and new GYP java binary template. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed cjhopman's feedback. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/config/android/rules.gni ('k') | chrome/android/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/host_jar.gypi
diff --git a/build/host_jar.gypi b/build/host_jar.gypi
index 6ccc1bdbad5a7635a6acb867aab474f8dae99966..9c35177872ce92e36fe42e872a2c55798e0b4d5d 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:
# {
@@ -69,9 +71,9 @@
'java_sources!': ['<!@(find <@(excluded_src_paths) -name "*.java")']
}],
['"<(jar_excluded_classes)" != ""', {
- 'extra_options': ['--excluded-classes=<(jar_excluded_classes)']
+ 'extra_options': ['--jar-excluded-classes=<(jar_excluded_classes)']
}],
- ['">(main_class)" != ""', {
+ ['main_class != ""', {
'extra_options': ['--main-class=>(main_class)']
}]
],
@@ -97,6 +99,33 @@
'^@(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)',
+ ]
+ }
+ ]
+ }]
]
}
« no previous file with comments | « build/config/android/rules.gni ('k') | chrome/android/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698