compile-front-end.py [plain text]
import os
inspector_frontend_path = "Source/WebCore/inspector/front-end"
externs = ["externs.js", "protocol-externs.js"]
jsmodule_name_prefix = "jsmodule_"
modules = [
{
"target_name": "util",
"dependencies": [],
"sources": [
"DOMExtension.js",
"utilities.js",
"treeoutline.js",
]
},
{
"target_name": "common",
"dependencies": ["util"],
"sources": [
"Object.js",
"Settings.js",
"UserMetrics.js",
"HandlerRegistry.js",
"InspectorFrontendHostStub.js",
]
},
{
"target_name": "sdk",
"dependencies": ["common"],
"sources": [
"InspectorBackend.js",
"ApplicationCacheModel.js",
"Color.js",
"CompilerScriptMapping.js",
"ConsoleModel.js",
"ContentProvider.js",
"ContentProviders.js",
"CookieParser.js",
"CSSCompletions.js",
"CSSKeywordCompletions.js",
"CSSStyleModel.js",
"BreakpointManager.js",
"Database.js",
"DOMAgent.js",
"DOMStorage.js",
"DebuggerModel.js",
"DebuggerPresentationModel.js",
"HAREntry.js",
"IndexedDBModel.js",
"Linkifier.js",
"NetworkLog.js",
"Placard.js",
"Script.js",
"ScriptFormatter.js",
"ScriptMapping.js",
"SnippetsModel.js",
"TimelineManager.js",
"TimelineModel.js",
"RawSourceCode.js",
"RemoteObject.js",
"Resource.js",
"ResourceScriptMapping.js",
"ResourceTreeModel.js",
"ResourceType.js",
"ResourceUtils.js",
"NetworkManager.js",
"NetworkRequest.js",
"UISourceCode.js",
"UserAgentSupport.js",
]
},
{
"target_name": "ui",
"dependencies": ["common"],
"sources": [
"AdvancedSearchController.js",
"Checkbox.js",
"ContextMenu.js",
"CookiesTable.js",
"DOMSyntaxHighlighter.js",
"DataGrid.js",
"Dialog.js",
"Drawer.js",
"EmptyView.js",
"HelpScreen.js",
"InspectorView.js",
"KeyboardShortcut.js",
"Panel.js",
"PanelEnablerView.js",
"Popover.js",
"PropertiesSection.js",
"SearchController.js",
"Section.js",
"SidebarPane.js",
"SidebarTreeElement.js",
"ShortcutsScreen.js",
"ShowMoreDataGridNode.js",
"SidebarOverlay.js",
"SoftContextMenu.js",
"SourceTokenizer.js",
"Spectrum.js",
"SplitView.js",
"StatusBarButton.js",
"TabbedPane.js",
"TextEditorModel.js",
"TextEditorHighlighter.js",
"TextPrompt.js",
"TextViewer.js",
"Toolbar.js",
"UIUtils.js",
"View.js",
]
},
{
"target_name": "components",
"dependencies": ["sdk", "ui"],
"sources": [
"ConsoleMessage.js",
"BreakpointsSidebarPane.js",
"DOMBreakpointsSidebarPane.js",
"DOMPresentationUtils.js",
"ElementsTreeOutline.js",
"EventListenersSidebarPane.js",
"FilteredItemSelectionDialog.js",
"GoToLineDialog.js",
"NavigatorOverlayController.js",
"NavigatorView.js",
"JavaScriptContextManager.js",
"JavaScriptSource.js",
"ObjectPopoverHelper.js",
"ObjectPropertiesSection.js",
"PropertiesSidebarPane.js",
"SourceFrame.js",
"TimelineGrid.js",
]
},
{
"target_name": "elements",
"dependencies": ["components"],
"sources": [
"StylesSidebarPane.js",
"MetricsSidebarPane.js",
"ElementsPanel.js",
]
},
{
"target_name": "network",
"dependencies": ["components"],
"sources": [
"FontView.js",
"ImageView.js",
"NetworkItemView.js",
"RequestCookiesView.js",
"RequestHeadersView.js",
"RequestHTMLView.js",
"RequestJSONView.js",
"RequestPreviewView.js",
"RequestResponseView.js",
"RequestTimingView.js",
"RequestView.js",
"ResourceView.js",
"ResourceWebSocketFrameView.js",
"NetworkPanel.js",
]
},
{
"target_name": "resources",
"dependencies": ["components"],
"sources": [
"ApplicationCacheItemsView.js",
"CookieItemsView.js",
"DatabaseQueryView.js",
"DatabaseTableView.js",
"DOMStorageItemsView.js",
"IndexedDBViews.js",
"ResourcesPanel.js",
]
},
{
"target_name": "scripts",
"dependencies": ["components"],
"sources": [
"CallStackSidebarPane.js",
"ScopeChainSidebarPane.js",
"JavaScriptSourceFrame.js",
"TabbedEditorContainer.js",
"ScriptsNavigator.js",
"ScriptsPanel.js",
"ScriptsSearchScope.js",
"WatchExpressionsSidebarPane.js",
"WorkerManager.js",
"WorkersSidebarPane.js",
]
},
{
"target_name": "console",
"dependencies": ["components"],
"sources": [
"ConsoleView.js",
"ConsolePanel.js",
]
},
{
"target_name": "timeline",
"dependencies": ["components"],
"sources": [
"MemoryStatistics.js",
"TimelineOverviewPane.js",
"TimelinePanel.js",
"TimelinePresentationModel.js",
"TimelineFrameController.js"
]
},
{
"target_name": "audits",
"dependencies": ["components"],
"sources": [
"AuditCategories.js",
"AuditFormatters.js",
"AuditLauncherView.js",
"AuditResultView.js",
"AuditRules.js",
"AuditsPanel.js",
]
},
{
"target_name": "styles",
"dependencies": ["components"],
"sources": [
"StylesPanel.js",
]
},
{
"target_name": "extensions",
"dependencies": ["components"],
"sources": [
"ExtensionAPI.js",
"ExtensionAuditCategory.js",
"ExtensionPanel.js",
"ExtensionRegistryStub.js",
"ExtensionServer.js",
]
},
{
"target_name": "inspector",
"dependencies": ["components", "extensions"],
"sources": [
"SettingsScreen.js",
]
},
{
"target_name": "tests",
"dependencies": ["components"],
"sources": [
"TestController.js",
]
},
{
"target_name": "profiler",
"dependencies": ["components"],
"sources": [
"BottomUpProfileDataGridTree.js",
"CSSSelectorProfileView.js",
"HeapSnapshot.js",
"HeapSnapshotDataGrids.js",
"HeapSnapshotGridNodes.js",
"HeapSnapshotLoader.js",
"HeapSnapshotProxy.js",
"HeapSnapshotView.js",
"HeapSnapshotWorker.js",
"HeapSnapshotWorkerDispatcher.js",
"ProfileDataGridTree.js",
"ProfilesPanel.js",
"ProfileLauncherView.js",
"ProfileView.js",
"TopDownProfileDataGridTree.js",
]
},
]
command = "java -jar ~/closure/compiler.jar --summary_detail_level 3 --compilation_level SIMPLE_OPTIMIZATIONS --warning_level VERBOSE --language_in ECMASCRIPT5 --accept_const_keyword \\\n"
for extern in externs:
command += " --externs " + inspector_frontend_path + "/" + extern
command += " \\\n"
for module in modules:
command += " --module " + jsmodule_name_prefix + module["target_name"] + ":"
command += str(len(module["sources"]))
firstDependency = True
for dependency in module["dependencies"]:
if firstDependency:
command += ":"
else:
command += ","
firstDependency = False
command += jsmodule_name_prefix + dependency
command += " \\\n"
for script in module["sources"]:
command += " --js " + inspector_frontend_path + "/" + script
command += " \\\n"
command += "\n"
os.system(command)