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

Unified Diff: build/android/gyp/javac.py

Issue 2044223005: [Android] Add option to add additional files to built jars. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: style nits Created 4 years, 5 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/android/gyp/jar.py ('k') | build/config/android/internal_rules.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gyp/javac.py
diff --git a/build/android/gyp/javac.py b/build/android/gyp/javac.py
index 7b5264d3794f56996b7f478144c67a7a52fb0810..818f011d9e4a908b8abfec4a52fd29eec9ef5a88 100755
--- a/build/android/gyp/javac.py
+++ b/build/android/gyp/javac.py
@@ -229,11 +229,13 @@ def _OnStaleMd5(changes, options, javac_cmd, java_files, classpath_inputs):
jar.JarDirectory(classes_dir,
options.jar_path,
predicate=inclusion_predicate,
- provider_configurations=options.provider_configurations)
+ provider_configurations=options.provider_configurations,
+ additional_files=options.additional_jar_files)
jar.JarDirectory(classes_dir,
excluded_jar_path,
predicate=exclusion_predicate,
- provider_configurations=options.provider_configurations)
+ provider_configurations=options.provider_configurations,
+ additional_files=options.additional_jar_files)
def _ParseOptions(argv):
@@ -290,6 +292,13 @@ def _ParseOptions(argv):
help='File to specify a service provider. Will be included '
'in the jar under META-INF/services.')
parser.add_option(
+ '--additional-jar-file',
+ dest='additional_jar_files',
+ action='append',
+ help='Additional files to package into jar. By default, only Java .class '
+ 'files are packaged into the jar. Files should be specified in '
+ 'format <filename>:<path to be placed in jar>.')
+ parser.add_option(
'--chromium-code',
type='int',
help='Whether code being compiled should be built with stricter '
@@ -318,6 +327,12 @@ def _ParseOptions(argv):
java_srcjars += build_utils.ParseGypList(arg)
options.java_srcjars = java_srcjars
+ additional_jar_files = []
+ for arg in options.additional_jar_files or []:
+ filepath, jar_filepath = arg.split(':')
+ additional_jar_files.append((filepath, jar_filepath))
+ options.additional_jar_files = additional_jar_files
+
if options.src_gendirs:
options.src_gendirs = build_utils.ParseGypList(options.src_gendirs)
« no previous file with comments | « build/android/gyp/jar.py ('k') | build/config/android/internal_rules.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698