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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/devtools/scripts/frontend_modules.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/scripts/compile_frontend.py
diff --git a/Source/devtools/scripts/compile_frontend.py b/Source/devtools/scripts/compile_frontend.py
index 7aebc6e851177458912e426d06012f6e5e1cb29c..62ada419de3f7716f8dff42254945dce1c179ccf 100755
--- a/Source/devtools/scripts/compile_frontend.py
+++ b/Source/devtools/scripts/compile_frontend.py
@@ -35,6 +35,10 @@ import shutil
import subprocess
import sys
import tempfile
+try:
+ import json
+except ImportError:
+ import simplejson as json
scripts_path = os.path.dirname(os.path.abspath(__file__))
devtools_path = os.path.dirname(scripts_path)
@@ -49,365 +53,14 @@ java_exec = "java -Xms512m -server -XX:+TieredCompilation"
generate_protocol_externs.generate_protocol_externs(protocol_externs_path, devtools_path + "/protocol.json")
jsmodule_name_prefix = "jsmodule_"
-modules = [
- {
- "name": "common",
- "dependencies": [],
- "sources": [
- "Color.js",
- "DOMExtension.js",
- "Object.js",
- "ParsedURL.js",
- "Progress.js",
- "Settings.js",
- "TextRange.js",
- "UIString.js",
- "UserMetrics.js",
- "utilities.js",
- "Geometry.js",
- ]
- },
- {
- "name": "sdk",
- "dependencies": ["common"],
- "sources": [
- "ApplicationCacheModel.js",
- "CompilerScriptMapping.js",
- "ConsoleModel.js",
- "ContentProvider.js",
- "ContentProviderBasedProjectDelegate.js",
- "ContentProviders.js",
- "CookieParser.js",
- "CSSFormatter.js",
- "CSSMetadata.js",
- "CSSStyleModel.js",
- "CSSStyleSheetMapping.js",
- "BreakpointManager.js",
- "Database.js",
- "DOMAgent.js",
- "DOMStorage.js",
- "DebuggerModel.js",
- "DebuggerScriptMapping.js",
- "FileManager.js",
- "FileSystemMapping.js",
- "FileSystemModel.js",
- "FileSystemProjectDelegate.js",
- "FileUtils.js",
- "HAREntry.js",
- "IndexedDBModel.js",
- "InspectorBackend.js",
- "IsolatedFileSystemManager.js",
- "IsolatedFileSystem.js",
- "JavaScriptFormatter.js",
- "Linkifier.js",
- "NetworkLog.js",
- "NetworkUISourceCodeProvider.js",
- "OverridesSupport.js",
- "PresentationConsoleMessageHelper.js",
- "RuntimeModel.js",
- "SASSSourceMapping.js",
- "Script.js",
- "ScriptFormatter.js",
- "ScriptFormatterWorker.js",
- "ScriptSnippetModel.js",
- "SimpleWorkspaceProvider.js",
- "SnippetStorage.js",
- "SourceMapping.js",
- "StylesSourceMapping.js",
- "TempFile.js",
- "TimelineManager.js",
- "RemoteObject.js",
- "Resource.js",
- "DefaultScriptMapping.js",
- "ResourceScriptMapping.js",
- "LiveEditSupport.js",
- "ResourceTreeModel.js",
- "ResourceType.js",
- "ResourceUtils.js",
- "SourceMap.js",
- "TracingAgent.js",
- "NetworkManager.js",
- "NetworkRequest.js",
- "UISourceCode.js",
- "Workspace.js",
- "WorkspaceController.js",
- ]
- },
- {
- "name": "ui",
- "dependencies": ["common"],
- "sources": [
- "Checkbox.js",
- "ContextMenu.js",
- "CompletionDictionary.js",
- "DOMSyntaxHighlighter.js",
- "DataGrid.js",
- "Dialog.js",
- "DockController.js",
- "Drawer.js",
- "EmptyView.js",
- "FilterBar.js",
- "GoToLineDialog.js",
- "HelpScreen.js",
- "InspectorView.js",
- "KeyboardShortcut.js",
- "OverviewGrid.js",
- "Panel.js",
- "Placard.js",
- "Popover.js",
- "ProgressIndicator.js",
- "PropertiesSection.js",
- "SearchableView.js",
- "Section.js",
- "SidebarPane.js",
- "SidebarTreeElement.js",
- "ShortcutsScreen.js",
- "ShowMoreDataGridNode.js",
- "SidebarOverlay.js",
- "SoftContextMenu.js",
- "Spectrum.js",
- "SplitView.js",
- "SidebarView.js",
- "StatusBarButton.js",
- "SuggestBox.js",
- "TabbedPane.js",
- "TextEditor.js",
- "TextPrompt.js",
- "TextUtils.js",
- "TimelineGrid.js",
- "UIUtils.js",
- "View.js",
- "ViewportControl.js",
- "treeoutline.js",
- ]
- },
- {
- "name": "components",
- "dependencies": ["sdk", "ui"],
- "sources": [
- "AdvancedSearchController.js",
- "HandlerRegistry.js",
- "ConsoleMessage.js",
- "CookiesTable.js",
- "DOMBreakpointsSidebarPane.js",
- "DOMPresentationUtils.js",
- "ElementsTreeOutline.js",
- "FontView.js",
- "ImageView.js",
- "NativeBreakpointsSidebarPane.js",
- "InspectElementModeController.js",
- "ObjectPopoverHelper.js",
- "ObjectPropertiesSection.js",
- "ScreencastView.js",
- "SourceFrame.js",
- "ResourceView.js",
- ]
- },
- {
- "name": "elements",
- "dependencies": ["components"],
- "sources": [
- "CSSNamedFlowCollectionsView.js",
- "CSSNamedFlowView.js",
- "ElementsPanel.js",
- "ElementsPanelDescriptor.js",
- "EventListenersSidebarPane.js",
- "MetricsSidebarPane.js",
- "OverridesView.js",
- "PlatformFontsSidebarPane.js",
- "PropertiesSidebarPane.js",
- "StylesSidebarPane.js",
- "RenderingOptionsView.js",
- ]
- },
- {
- "name": "network",
- "dependencies": ["components"],
- "sources": [
- "NetworkItemView.js",
- "RequestCookiesView.js",
- "RequestHeadersView.js",
- "RequestHTMLView.js",
- "RequestJSONView.js",
- "RequestPreviewView.js",
- "RequestResponseView.js",
- "RequestTimingView.js",
- "RequestView.js",
- "ResourceWebSocketFrameView.js",
- "NetworkPanel.js",
- "NetworkPanelDescriptor.js",
- ]
- },
- {
- "name": "resources",
- "dependencies": ["components"],
- "sources": [
- "ApplicationCacheItemsView.js",
- "CookieItemsView.js",
- "DatabaseQueryView.js",
- "DatabaseTableView.js",
- "DirectoryContentView.js",
- "DOMStorageItemsView.js",
- "FileContentView.js",
- "FileSystemView.js",
- "IndexedDBViews.js",
- "ResourcesPanel.js",
- ]
- },
- {
- "name": "workers",
- "dependencies": ["components"],
- "sources": [
- "WorkerManager.js",
- ]
- },
- {
- "name": "scripts",
- "dependencies": ["components", "workers"],
- "sources": [
- "BreakpointsSidebarPane.js",
- "CSSSourceFrame.js",
- "CallStackSidebarPane.js",
- "FilePathScoreFunction.js",
- "FilteredItemSelectionDialog.js",
- "JavaScriptSourceFrame.js",
- "NavigatorOverlayController.js",
- "NavigatorView.js",
- "RevisionHistoryView.js",
- "ScopeChainSidebarPane.js",
- "SourcesNavigator.js",
- "SourcesPanel.js",
- "SourcesPanelDescriptor.js",
- "SourcesSearchScope.js",
- "StyleSheetOutlineDialog.js",
- "TabbedEditorContainer.js",
- "UISourceCodeFrame.js",
- "WatchExpressionsSidebarPane.js",
- "WorkersSidebarPane.js",
- ]
- },
- {
- "name": "console",
- "dependencies": ["components"],
- "sources": [
- "ConsoleView.js",
- "ConsolePanel.js",
- ]
- },
- {
- "name": "timeline",
- "dependencies": ["components"],
- "sources": [
- "DOMCountersGraph.js",
- "MemoryStatistics.js",
- "PieChart.js",
- "TimelineEventOverview.js",
- "TimelineFrameOverview.js",
- "TimelineMemoryOverview.js",
- "TimelineModel.js",
- "TimelineOverviewPane.js",
- "TimelinePanel.js",
- "TimelinePanelDescriptor.js",
- "TimelinePresentationModel.js",
- "TimelineFrameController.js"
- ]
- },
- {
- "name": "audits",
- "dependencies": ["components"],
- "sources": [
- "AuditCategories.js",
- "AuditController.js",
- "AuditFormatters.js",
- "AuditLauncherView.js",
- "AuditResultView.js",
- "AuditRules.js",
- "AuditsPanel.js",
- ]
- },
- {
- "name": "codemirror",
- "dependencies": ["components"],
- "sources": [
- "CodeMirrorTextEditor.js",
- "CodeMirrorUtils.js",
- ]
- },
- {
- "name": "layers",
- "dependencies": ["components"],
- "sources": [
- "LayerTreeModel.js",
- "LayersPanel.js",
- "LayersPanelDescriptor.js",
- "LayerTree.js",
- "Layers3DView.js",
- "LayerDetailsView.js",
- "PaintProfilerView.js",
- ]
- },
- {
- "name": "extensions",
- "dependencies": ["components"],
- "sources": [
- "ExtensionAPI.js",
- "ExtensionAuditCategory.js",
- "ExtensionPanel.js",
- "ExtensionRegistryStub.js",
- "ExtensionServer.js",
- "ExtensionView.js",
- ]
- },
- {
- "name": "settings",
- "dependencies": ["components", "extensions"],
- "sources": [
- "SettingsScreen.js",
- "EditFileSystemDialog.js",
- ]
- },
- {
- "name": "tests",
- "dependencies": ["components"],
- "sources": [
- "TestController.js",
- ]
- },
- {
- "name": "profiler",
- "dependencies": ["components", "workers"],
- "sources": [
- "AllocationProfile.js",
- "BottomUpProfileDataGridTree.js",
- "CPUProfileView.js",
- "FlameChart.js",
- "HeapSnapshot.js",
- "HeapSnapshotDataGrids.js",
- "HeapSnapshotGridNodes.js",
- "HeapSnapshotLoader.js",
- "HeapSnapshotProxy.js",
- "HeapSnapshotView.js",
- "HeapSnapshotWorker.js",
- "HeapSnapshotWorkerDispatcher.js",
- "JSHeapSnapshot.js",
- "ProfileDataGridTree.js",
- "ProfilesPanel.js",
- "ProfilesPanelDescriptor.js",
- "ProfileLauncherView.js",
- "TopDownProfileDataGridTree.js",
- "CanvasProfileView.js",
- "CanvasReplayStateView.js",
- ]
- },
- {
- "name": "host_stub",
- "dependencies": ["components", "profiler", "timeline"],
- "sources": [
- "InspectorFrontendAPI.js",
- "InspectorFrontendHostStub.js",
- ]
- }
-]
+js_modules_name = "frontend_modules.json"
+
+try:
+ with open(os.path.join(scripts_path, js_modules_name), "rt") as js_modules_file:
+ modules = json.loads(js_modules_file.read())
+except:
+ print "ERROR: Failed to read %s" % js_modules_name
+ raise
# `importScript` function must not be used in any files
# except module headers. Refer to devtools.gyp file for
« 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