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

Unified Diff: third_party/WebKit/Source/devtools/scripts/build/build_release_applications.py

Issue 2608043002: DevTools: extract modules (with extensions) (Closed)
Patch Set: fixes Created 3 years, 11 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
Index: third_party/WebKit/Source/devtools/scripts/build/build_release_applications.py
diff --git a/third_party/WebKit/Source/devtools/scripts/build/build_release_applications.py b/third_party/WebKit/Source/devtools/scripts/build/build_release_applications.py
index e095c3853400c8239369bca53fe860e165eb46f6..a2ff8671bb68a45dbd37c8cfbd171e5e5ec16d3f 100755
--- a/third_party/WebKit/Source/devtools/scripts/build/build_release_applications.py
+++ b/third_party/WebKit/Source/devtools/scripts/build/build_release_applications.py
@@ -189,17 +189,25 @@ class ReleaseBuilder(object):
non_autostart_deps = deps & non_autostart
if len(non_autostart_deps):
bail_error('Non-autostart dependencies specified for the autostarted module "%s": %s' % (name, non_autostart_deps))
-
- namespace = name.replace('_lazy', '')
- if namespace == 'sdk' or namespace == 'ui':
- namespace = namespace.upper();
- namespace = "".join(map(lambda x: x[0].upper() + x[1:], namespace.split('_')))
+ namespace = name
+ if self._map_special_case_namespace(namespace):
+ namespace = self._map_special_case_namespace(namespace)
+ else:
+ namespace = "".join(map(lambda x: x[0].upper() + x[1:], namespace.split('_')))
output.write('\n/* Module %s */\n' % name)
output.write('\nself[\'%s\'] = self[\'%s\'] || {};\n' % (namespace, namespace))
modular_build.concatenate_scripts(desc.get('scripts'), join(self.application_dir, name), self.output_dir, output)
else:
non_autostart.add(name)
+ def _map_special_case_namespace(self, namespace):
+ if hasattr(self, '_special_cases'):
+ return self._special_cases.get(namespace, None)
+ scripts_path = path.join(path.dirname(path.dirname(path.abspath(__file__))), 'module_to_namespaces.json')
+ with open(scripts_path) as json_file:
+ self._special_cases = json.load(json_file)
+ return self._special_cases.get(namespace, None)
+
def _concatenate_application_script(self, output):
runtime_contents = read_file(join(self.application_dir, 'Runtime.js'))
runtime_contents = re.sub('var allDescriptors = \[\];', 'var allDescriptors = %s;' % self._release_module_descriptors().replace('\\', '\\\\'), runtime_contents, 1)

Powered by Google App Engine
This is Rietveld 408576698