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

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

Issue 910143003: Change in android Java build rules for Mojo Java content handler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | 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 15fe73db49827fed77692a61bd9aded108664d8d..37380629ebf2a045d1990b979b96fb76efd89898 100755
--- a/build/android/gyp/javac.py
+++ b/build/android/gyp/javac.py
@@ -106,7 +106,8 @@ def DoJavac(
_MAX_MANIFEST_LINE_LEN = 72
-def CreateManifest(manifest_path, classpath, main_class=None):
+def CreateManifest(manifest_path, classpath, main_class=None,
+ manifest_entries=None):
"""Creates a manifest file with the given parameters.
This generates a manifest file that compiles with the spec found at
@@ -117,11 +118,16 @@ def CreateManifest(manifest_path, classpath, main_class=None):
classpath: The JAR files that should be listed on the manifest file's
classpath.
main_class: If present, the class containing the main() function.
+ manifest_entries: If present, a list of (key, value) pairs to add to
+ the manifest.
"""
output = ['Manifest-Version: 1.0']
if main_class:
output.append('Main-Class: %s' % main_class)
+ if manifest_entries:
+ for k, v in manifest_entries:
+ output.append('%s: %s' % (k, v))
if classpath:
sanitized_paths = []
for path in classpath:
@@ -183,6 +189,10 @@ def main(argv):
parser.add_option(
'--main-class',
help='The class containing the main method.')
+ parser.add_option(
+ '--manifest-entry',
+ action='append',
+ help='Key:value pairs to add to the .jar manifest.')
parser.add_option('--stamp', help='Path to touch on success.')
@@ -232,10 +242,13 @@ def main(argv):
java_files)
if options.jar_path:
- if options.main_class:
+ if options.main_class or options.manifest_entry:
+ if options.manifest_entry:
+ entries = map(lambda e: e.split(":"), options.manifest_entry)
+ else:
+ entries = []
manifest_file = os.path.join(temp_dir, 'manifest')
- CreateManifest(manifest_file, classpath,
- options.main_class)
+ CreateManifest(manifest_file, classpath, options.main_class, entries)
else:
manifest_file = None
jar.JarDirectory(classes_dir,
« no previous file with comments | « no previous file | build/config/android/internal_rules.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698