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

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

Issue 2014983003: [Android] Build changes needed for Robolectric 3.0. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed agrieves nit and mispelling. Created 4 years, 7 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/android/gyp/javac.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gyp/jar.py
diff --git a/build/android/gyp/jar.py b/build/android/gyp/jar.py
index cfa5e509e474b5c549b08e81d89feb67504213ca..2ebec67ea1f35a63114d32b63174d108387cd1b2 100755
--- a/build/android/gyp/jar.py
+++ b/build/android/gyp/jar.py
@@ -6,6 +6,7 @@
import optparse
import os
+import shutil
import sys
from util import build_utils
@@ -19,7 +20,8 @@ _RESOURCE_CLASSES = [
]
-def Jar(class_files, classes_dir, jar_path, manifest_file=None):
+def Jar(class_files, classes_dir, jar_path, manifest_file=None,
+ provider_configurations=None):
jar_path = os.path.abspath(jar_path)
# The paths of the files in the jar will be the same as they are passed in to
@@ -33,6 +35,15 @@ def Jar(class_files, classes_dir, jar_path, manifest_file=None):
jar_cmd.append(os.path.abspath(manifest_file))
jar_cmd.extend(class_files_rel)
+ if provider_configurations:
+ service_dir = os.path.join(jar_cwd, 'META-INF', 'services')
+ if not os.path.exists(service_dir):
+ os.makedirs(service_dir)
+ for config in provider_configurations:
+ config_jar_path = os.path.join(service_dir, os.path.basename(config))
+ shutil.copy(config, config_jar_path)
+ jar_cmd.append(os.path.relpath(config_jar_path, jar_cwd))
+
if not class_files_rel:
empty_file = os.path.join(classes_dir, '.empty')
build_utils.Touch(empty_file)
@@ -41,12 +52,14 @@ def Jar(class_files, classes_dir, jar_path, manifest_file=None):
build_utils.Touch(jar_path, fail_if_missing=True)
-def JarDirectory(classes_dir, jar_path, manifest_file=None, predicate=None):
+def JarDirectory(classes_dir, jar_path, manifest_file=None, predicate=None,
+ provider_configurations=None):
class_files = build_utils.FindInDirectory(classes_dir, '*.class')
if predicate:
class_files = [f for f in class_files if predicate(f)]
- Jar(class_files, classes_dir, jar_path, manifest_file=manifest_file)
+ Jar(class_files, classes_dir, jar_path, manifest_file=manifest_file,
+ provider_configurations=provider_configurations)
def main():
« no previous file with comments | « no previous file | build/android/gyp/javac.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698