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

Unified Diff: build/android/gradle/generate_gradle.py

Issue 2678463003: Revert of Android: Add owned resources to android studio (Closed)
Patch Set: Created 3 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 | « build/android/gradle/android.jinja ('k') | docs/android_studio.md » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gradle/generate_gradle.py
diff --git a/build/android/gradle/generate_gradle.py b/build/android/gradle/generate_gradle.py
index dc3889b5306100e18cbd4ced5bc924bfa359023a..fbe0966ac3b40b2e4ce3ea8a5fb3b613eb9f5c18 100755
--- a/build/android/gradle/generate_gradle.py
+++ b/build/android/gradle/generate_gradle.py
@@ -34,7 +34,6 @@
_SRCJARS_SUBDIR = 'extracted-srcjars'
_JNI_LIBS_SUBDIR = 'symlinked-libs'
_ARMEABI_SUBDIR = 'armeabi'
-_RES_SUBDIR = 'extracted-res'
_DEFAULT_TARGETS = [
# TODO(agrieve): Requires alternate android.jar to compile.
@@ -213,17 +212,6 @@
os.path.join(self.EntryOutputDir(entry), _SRCJARS_SUBDIR))
return java_dirs
- def _GenResDirs(self, entry):
- res_dirs = list(entry.DepsInfo().get('owned_resources_dirs', []))
- zips = entry.DepsInfo().get('owned_resources_zips')
- if zips:
- # These are generated resources that should not be modified.
- res_dir = os.path.join(self.EntryOutputDir(entry), _RES_SUBDIR)
- for zip_path in _RebasePath(zips):
- _ExtractFile(zip_path, res_dir)
- res_dirs.append(res_dir)
- return res_dirs
-
def _Relativize(self, entry, paths):
return _RebasePath(paths, self.EntryOutputDir(entry))
@@ -252,7 +240,6 @@
entry, android_test_manifest)
variables['java_dirs'] = self._Relativize(entry, self._GenJavaDirs(entry))
variables['jni_libs'] = self._Relativize(entry, self._GenJniLibs(entry))
- variables['res_dirs'] = self._Relativize(entry, self._GenResDirs(entry))
deps = [_ProjectEntry.FromBuildConfigPath(p)
for p in entry.Gradle()['dependent_android_projects']]
variables['android_project_deps'] = [d.ProjectName() for d in deps]
@@ -442,12 +429,6 @@
return '\n'.join(lines)
-def _ExtractFile(zip_path, extracted_path):
- logging.info('Extracting %s to %s', zip_path, extracted_path)
- with zipfile.ZipFile(zip_path) as z:
- z.extractall(extracted_path)
-
-
def _ExtractSrcjars(entry_output_dir, srcjar_tuples):
"""Extracts all srcjars to the directory given by the tuples."""
extracted_paths = set(s[1] for s in srcjar_tuples)
@@ -456,7 +437,9 @@
shutil.rmtree(extracted_path, True)
for srcjar_path, extracted_path in srcjar_tuples:
- _ExtractFile(srcjar_path, extracted_path)
+ logging.info('Extracting %s to %s', srcjar_path, extracted_path)
+ with zipfile.ZipFile(srcjar_path) as z:
+ z.extractall(extracted_path)
def _FindAllProjectEntries(main_entries):
« no previous file with comments | « build/android/gradle/android.jinja ('k') | docs/android_studio.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698