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

Side by Side Diff: Source/devtools/scripts/compile_frontend.py

Issue 119823003: DevTools: Extract JS module declarations from compile_frontend.py into js_modules (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Comments addressed Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/devtools/scripts/frontend_modules.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 Google Inc. All rights reserved. 2 # Copyright (c) 2012 Google Inc. All rights reserved.
3 # 3 #
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are 5 # modification, are permitted provided that the following conditions are
6 # met: 6 # met:
7 # 7 #
8 # * Redistributions of source code must retain the above copyright 8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above 10 # * Redistributions in binary form must reproduce the above
(...skipping 17 matching lines...) Expand all
28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 29
30 import os 30 import os
31 import os.path 31 import os.path
32 import generate_protocol_externs 32 import generate_protocol_externs
33 import re 33 import re
34 import shutil 34 import shutil
35 import subprocess 35 import subprocess
36 import sys 36 import sys
37 import tempfile 37 import tempfile
38 try:
39 import json
40 except ImportError:
41 import simplejson as json
38 42
39 scripts_path = os.path.dirname(os.path.abspath(__file__)) 43 scripts_path = os.path.dirname(os.path.abspath(__file__))
40 devtools_path = os.path.dirname(scripts_path) 44 devtools_path = os.path.dirname(scripts_path)
41 inspector_path = os.path.dirname(devtools_path) + "/core/inspector" 45 inspector_path = os.path.dirname(devtools_path) + "/core/inspector"
42 devtools_frontend_path = devtools_path + "/front_end" 46 devtools_frontend_path = devtools_path + "/front_end"
43 protocol_externs_path = devtools_frontend_path + "/protocol_externs.js" 47 protocol_externs_path = devtools_frontend_path + "/protocol_externs.js"
44 webgl_rendering_context_idl_path = os.path.dirname(devtools_path) + "/core/html/ canvas/WebGLRenderingContext.idl" 48 webgl_rendering_context_idl_path = os.path.dirname(devtools_path) + "/core/html/ canvas/WebGLRenderingContext.idl"
45 closure_compiler_jar = scripts_path + "/closure/compiler.jar" 49 closure_compiler_jar = scripts_path + "/closure/compiler.jar"
46 jsdoc_validator_jar = scripts_path + "/jsdoc-validator/jsdoc-validator.jar" 50 jsdoc_validator_jar = scripts_path + "/jsdoc-validator/jsdoc-validator.jar"
47 java_exec = "java -Xms512m -server -XX:+TieredCompilation" 51 java_exec = "java -Xms512m -server -XX:+TieredCompilation"
48 52
49 generate_protocol_externs.generate_protocol_externs(protocol_externs_path, devto ols_path + "/protocol.json") 53 generate_protocol_externs.generate_protocol_externs(protocol_externs_path, devto ols_path + "/protocol.json")
50 54
51 jsmodule_name_prefix = "jsmodule_" 55 jsmodule_name_prefix = "jsmodule_"
52 modules = [ 56 js_modules_name = "frontend_modules.json"
53 { 57
54 "name": "common", 58 try:
55 "dependencies": [], 59 with open(os.path.join(scripts_path, js_modules_name), "rt") as js_modules_f ile:
56 "sources": [ 60 modules = json.loads(js_modules_file.read())
57 "Color.js", 61 except:
58 "DOMExtension.js", 62 print "ERROR: Failed to read %s" % js_modules_name
59 "Object.js", 63 raise
60 "ParsedURL.js",
61 "Progress.js",
62 "Settings.js",
63 "TextRange.js",
64 "UIString.js",
65 "UserMetrics.js",
66 "utilities.js",
67 "Geometry.js",
68 ]
69 },
70 {
71 "name": "sdk",
72 "dependencies": ["common"],
73 "sources": [
74 "ApplicationCacheModel.js",
75 "CompilerScriptMapping.js",
76 "ConsoleModel.js",
77 "ContentProvider.js",
78 "ContentProviderBasedProjectDelegate.js",
79 "ContentProviders.js",
80 "CookieParser.js",
81 "CSSFormatter.js",
82 "CSSMetadata.js",
83 "CSSStyleModel.js",
84 "CSSStyleSheetMapping.js",
85 "BreakpointManager.js",
86 "Database.js",
87 "DOMAgent.js",
88 "DOMStorage.js",
89 "DebuggerModel.js",
90 "DebuggerScriptMapping.js",
91 "FileManager.js",
92 "FileSystemMapping.js",
93 "FileSystemModel.js",
94 "FileSystemProjectDelegate.js",
95 "FileUtils.js",
96 "HAREntry.js",
97 "IndexedDBModel.js",
98 "InspectorBackend.js",
99 "IsolatedFileSystemManager.js",
100 "IsolatedFileSystem.js",
101 "JavaScriptFormatter.js",
102 "Linkifier.js",
103 "NetworkLog.js",
104 "NetworkUISourceCodeProvider.js",
105 "OverridesSupport.js",
106 "PresentationConsoleMessageHelper.js",
107 "RuntimeModel.js",
108 "SASSSourceMapping.js",
109 "Script.js",
110 "ScriptFormatter.js",
111 "ScriptFormatterWorker.js",
112 "ScriptSnippetModel.js",
113 "SimpleWorkspaceProvider.js",
114 "SnippetStorage.js",
115 "SourceMapping.js",
116 "StylesSourceMapping.js",
117 "TempFile.js",
118 "TimelineManager.js",
119 "RemoteObject.js",
120 "Resource.js",
121 "DefaultScriptMapping.js",
122 "ResourceScriptMapping.js",
123 "LiveEditSupport.js",
124 "ResourceTreeModel.js",
125 "ResourceType.js",
126 "ResourceUtils.js",
127 "SourceMap.js",
128 "TracingAgent.js",
129 "NetworkManager.js",
130 "NetworkRequest.js",
131 "UISourceCode.js",
132 "Workspace.js",
133 "WorkspaceController.js",
134 ]
135 },
136 {
137 "name": "ui",
138 "dependencies": ["common"],
139 "sources": [
140 "Checkbox.js",
141 "ContextMenu.js",
142 "CompletionDictionary.js",
143 "DOMSyntaxHighlighter.js",
144 "DataGrid.js",
145 "Dialog.js",
146 "DockController.js",
147 "Drawer.js",
148 "EmptyView.js",
149 "FilterBar.js",
150 "GoToLineDialog.js",
151 "HelpScreen.js",
152 "InspectorView.js",
153 "KeyboardShortcut.js",
154 "OverviewGrid.js",
155 "Panel.js",
156 "Placard.js",
157 "Popover.js",
158 "ProgressIndicator.js",
159 "PropertiesSection.js",
160 "SearchableView.js",
161 "Section.js",
162 "SidebarPane.js",
163 "SidebarTreeElement.js",
164 "ShortcutsScreen.js",
165 "ShowMoreDataGridNode.js",
166 "SidebarOverlay.js",
167 "SoftContextMenu.js",
168 "Spectrum.js",
169 "SplitView.js",
170 "SidebarView.js",
171 "StatusBarButton.js",
172 "SuggestBox.js",
173 "TabbedPane.js",
174 "TextEditor.js",
175 "TextPrompt.js",
176 "TextUtils.js",
177 "TimelineGrid.js",
178 "UIUtils.js",
179 "View.js",
180 "ViewportControl.js",
181 "treeoutline.js",
182 ]
183 },
184 {
185 "name": "components",
186 "dependencies": ["sdk", "ui"],
187 "sources": [
188 "AdvancedSearchController.js",
189 "HandlerRegistry.js",
190 "ConsoleMessage.js",
191 "CookiesTable.js",
192 "DOMBreakpointsSidebarPane.js",
193 "DOMPresentationUtils.js",
194 "ElementsTreeOutline.js",
195 "FontView.js",
196 "ImageView.js",
197 "NativeBreakpointsSidebarPane.js",
198 "InspectElementModeController.js",
199 "ObjectPopoverHelper.js",
200 "ObjectPropertiesSection.js",
201 "ScreencastView.js",
202 "SourceFrame.js",
203 "ResourceView.js",
204 ]
205 },
206 {
207 "name": "elements",
208 "dependencies": ["components"],
209 "sources": [
210 "CSSNamedFlowCollectionsView.js",
211 "CSSNamedFlowView.js",
212 "ElementsPanel.js",
213 "ElementsPanelDescriptor.js",
214 "EventListenersSidebarPane.js",
215 "MetricsSidebarPane.js",
216 "OverridesView.js",
217 "PlatformFontsSidebarPane.js",
218 "PropertiesSidebarPane.js",
219 "StylesSidebarPane.js",
220 "RenderingOptionsView.js",
221 ]
222 },
223 {
224 "name": "network",
225 "dependencies": ["components"],
226 "sources": [
227 "NetworkItemView.js",
228 "RequestCookiesView.js",
229 "RequestHeadersView.js",
230 "RequestHTMLView.js",
231 "RequestJSONView.js",
232 "RequestPreviewView.js",
233 "RequestResponseView.js",
234 "RequestTimingView.js",
235 "RequestView.js",
236 "ResourceWebSocketFrameView.js",
237 "NetworkPanel.js",
238 "NetworkPanelDescriptor.js",
239 ]
240 },
241 {
242 "name": "resources",
243 "dependencies": ["components"],
244 "sources": [
245 "ApplicationCacheItemsView.js",
246 "CookieItemsView.js",
247 "DatabaseQueryView.js",
248 "DatabaseTableView.js",
249 "DirectoryContentView.js",
250 "DOMStorageItemsView.js",
251 "FileContentView.js",
252 "FileSystemView.js",
253 "IndexedDBViews.js",
254 "ResourcesPanel.js",
255 ]
256 },
257 {
258 "name": "workers",
259 "dependencies": ["components"],
260 "sources": [
261 "WorkerManager.js",
262 ]
263 },
264 {
265 "name": "scripts",
266 "dependencies": ["components", "workers"],
267 "sources": [
268 "BreakpointsSidebarPane.js",
269 "CSSSourceFrame.js",
270 "CallStackSidebarPane.js",
271 "FilePathScoreFunction.js",
272 "FilteredItemSelectionDialog.js",
273 "JavaScriptSourceFrame.js",
274 "NavigatorOverlayController.js",
275 "NavigatorView.js",
276 "RevisionHistoryView.js",
277 "ScopeChainSidebarPane.js",
278 "SourcesNavigator.js",
279 "SourcesPanel.js",
280 "SourcesPanelDescriptor.js",
281 "SourcesSearchScope.js",
282 "StyleSheetOutlineDialog.js",
283 "TabbedEditorContainer.js",
284 "UISourceCodeFrame.js",
285 "WatchExpressionsSidebarPane.js",
286 "WorkersSidebarPane.js",
287 ]
288 },
289 {
290 "name": "console",
291 "dependencies": ["components"],
292 "sources": [
293 "ConsoleView.js",
294 "ConsolePanel.js",
295 ]
296 },
297 {
298 "name": "timeline",
299 "dependencies": ["components"],
300 "sources": [
301 "DOMCountersGraph.js",
302 "MemoryStatistics.js",
303 "PieChart.js",
304 "TimelineEventOverview.js",
305 "TimelineFrameOverview.js",
306 "TimelineMemoryOverview.js",
307 "TimelineModel.js",
308 "TimelineOverviewPane.js",
309 "TimelinePanel.js",
310 "TimelinePanelDescriptor.js",
311 "TimelinePresentationModel.js",
312 "TimelineFrameController.js"
313 ]
314 },
315 {
316 "name": "audits",
317 "dependencies": ["components"],
318 "sources": [
319 "AuditCategories.js",
320 "AuditController.js",
321 "AuditFormatters.js",
322 "AuditLauncherView.js",
323 "AuditResultView.js",
324 "AuditRules.js",
325 "AuditsPanel.js",
326 ]
327 },
328 {
329 "name": "codemirror",
330 "dependencies": ["components"],
331 "sources": [
332 "CodeMirrorTextEditor.js",
333 "CodeMirrorUtils.js",
334 ]
335 },
336 {
337 "name": "layers",
338 "dependencies": ["components"],
339 "sources": [
340 "LayerTreeModel.js",
341 "LayersPanel.js",
342 "LayersPanelDescriptor.js",
343 "LayerTree.js",
344 "Layers3DView.js",
345 "LayerDetailsView.js",
346 "PaintProfilerView.js",
347 ]
348 },
349 {
350 "name": "extensions",
351 "dependencies": ["components"],
352 "sources": [
353 "ExtensionAPI.js",
354 "ExtensionAuditCategory.js",
355 "ExtensionPanel.js",
356 "ExtensionRegistryStub.js",
357 "ExtensionServer.js",
358 "ExtensionView.js",
359 ]
360 },
361 {
362 "name": "settings",
363 "dependencies": ["components", "extensions"],
364 "sources": [
365 "SettingsScreen.js",
366 "EditFileSystemDialog.js",
367 ]
368 },
369 {
370 "name": "tests",
371 "dependencies": ["components"],
372 "sources": [
373 "TestController.js",
374 ]
375 },
376 {
377 "name": "profiler",
378 "dependencies": ["components", "workers"],
379 "sources": [
380 "AllocationProfile.js",
381 "BottomUpProfileDataGridTree.js",
382 "CPUProfileView.js",
383 "FlameChart.js",
384 "HeapSnapshot.js",
385 "HeapSnapshotDataGrids.js",
386 "HeapSnapshotGridNodes.js",
387 "HeapSnapshotLoader.js",
388 "HeapSnapshotProxy.js",
389 "HeapSnapshotView.js",
390 "HeapSnapshotWorker.js",
391 "HeapSnapshotWorkerDispatcher.js",
392 "JSHeapSnapshot.js",
393 "ProfileDataGridTree.js",
394 "ProfilesPanel.js",
395 "ProfilesPanelDescriptor.js",
396 "ProfileLauncherView.js",
397 "TopDownProfileDataGridTree.js",
398 "CanvasProfileView.js",
399 "CanvasReplayStateView.js",
400 ]
401 },
402 {
403 "name": "host_stub",
404 "dependencies": ["components", "profiler", "timeline"],
405 "sources": [
406 "InspectorFrontendAPI.js",
407 "InspectorFrontendHostStub.js",
408 ]
409 }
410 ]
411 64
412 # `importScript` function must not be used in any files 65 # `importScript` function must not be used in any files
413 # except module headers. Refer to devtools.gyp file for 66 # except module headers. Refer to devtools.gyp file for
414 # the module header list. 67 # the module header list.
415 allowed_import_statements_files = [ 68 allowed_import_statements_files = [
416 "utilities.js", 69 "utilities.js",
417 "ElementsPanel.js", 70 "ElementsPanel.js",
418 "ResourcesPanel.js", 71 "ResourcesPanel.js",
419 "NetworkPanel.js", 72 "NetworkPanel.js",
420 "SourcesPanel.js", 73 "SourcesPanel.js",
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 print "InjectedScriptSource.js and InjectedScriptCanvasModuleSource.js compi lation output:\n", injectedScriptCompileOut 296 print "InjectedScriptSource.js and InjectedScriptCanvasModuleSource.js compi lation output:\n", injectedScriptCompileOut
644 297
645 (canvasModuleCompileOut, _) = canvasModuleCompileProc.communicate() 298 (canvasModuleCompileOut, _) = canvasModuleCompileProc.communicate()
646 print "InjectedScriptCanvasModuleSource.js generated code check output:\n", canvasModuleCompileOut 299 print "InjectedScriptCanvasModuleSource.js generated code check output:\n", canvasModuleCompileOut
647 300
648 os.system("rm " + injectedScriptSourceTmpFile) 301 os.system("rm " + injectedScriptSourceTmpFile)
649 os.system("rm " + injectedScriptCanvasModuleSourceTmpFile) 302 os.system("rm " + injectedScriptCanvasModuleSourceTmpFile)
650 303
651 shutil.rmtree(modules_dir) 304 shutil.rmtree(modules_dir)
652 os.system("rm " + protocol_externs_path) 305 os.system("rm " + protocol_externs_path)
OLDNEW
« no previous file with comments | « no previous file | Source/devtools/scripts/frontend_modules.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698