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

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

Issue 2866863003: [Android, Tools] Speed up gn_to_cmake.py with caching (Closed)
Patch Set: Created 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gradle/gn_to_cmake.py
diff --git a/build/android/gradle/gn_to_cmake.py b/build/android/gradle/gn_to_cmake.py
index a790d63493b4df8f02e395d932c207109aa051e0..dd6c1323c0d90c7f5c496202e82cbe97953afebe 100755
--- a/build/android/gradle/gn_to_cmake.py
+++ b/build/android/gradle/gn_to_cmake.py
@@ -189,6 +189,7 @@ class Project(object):
self.root_path = build_settings['root_path']
self.build_path = posixpath.join(self.root_path,
build_settings['build_dir'][2:])
+ self.object_source_deps = {}
def GetAbsolutePath(self, path):
if path.startswith("//"):
@@ -198,13 +199,19 @@ class Project(object):
def GetObjectSourceDependencies(self, gn_target_name, object_dependencies):
"""All OBJECT libraries whose sources have not been absorbed."""
+ if gn_target_name in self.object_source_deps:
+ object_dependencies.update(self.object_source_deps[gn_target_name])
+ return
+ target_deps = set()
dependencies = self.targets[gn_target_name].get('deps', [])
for dependency in dependencies:
dependency_type = self.targets[dependency].get('type', None)
if dependency_type == 'source_set':
- object_dependencies.add(dependency)
+ target_deps.add(dependency)
if dependency_type not in gn_target_types_that_absorb_objects:
- self.GetObjectSourceDependencies(dependency, object_dependencies)
+ self.GetObjectSourceDependencies(dependency, target_deps)
+ self.object_source_deps[gn_target_name] = target_deps
+ object_dependencies.update(target_deps)
def GetObjectLibraryDependencies(self, gn_target_name, object_dependencies):
"""All OBJECT libraries whose libraries have not been absorbed."""
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698