+2016-09-01 Brian Burg <bburg@apple.com>
+
+ Web Inspector: unify Main.html and Test.html sources and generate different copies with the preprocessor
+ https://bugs.webkit.org/show_bug.cgi?id=161212
+ <rdar://problem/28017961>
+
+ Reviewed by Joseph Pecoraro.
+
+ Rearrange some CMake rules so most Inspector UI work is done in WebInspectorUI.
+
+ * Source/CMakeLists.txt: Add 'WebInspectorUI' subdirectory.
+ * Source/PlatformEfl.cmake:
+ - Move the rule to copy InspectorBackendCommands.js into WebInspectorUI/CMakeLists.txt.
+ - Add a FIXME to use the cross-port list of Inspector resources instead of copying everything.
+ - Add new dependency so generated WebInspectorUI files are made by web-inspector-resources.
+ - Copy over generated files Main.html and Test.html.
+
+ * Source/PlatformWin.cmake:
+ - Add a FIXME to use the cross-port list of Inspector resources instead of copying everything.
+ - Add new dependency so generated WebInspectorUI files are made by web-inspector-resources.
+ - Copy over generated files Main.html and Test.html.
+
+ * Source/cmake/WebKitFS.cmake:
+ - Set up WEBINSPECTORUI_DIR and use it.
+ - Move directory creation commands here from JavaScriptCore.
+
+ * Source/cmake/WebKitMacros.cmake:
+ Add a helper to turn a CMake list into a space-delimited string of elements.
+
2016-09-01 Brian Burg <bburg@apple.com>
Update root .gitignore for latest WebKitLibraries
add_subdirectory(WebCore)
endif ()
+if (ENABLE_WEBKIT OR ENABLE_WEBKIT2)
+ add_subdirectory(WebInspectorUI)
+endif ()
+
if (ENABLE_WEBKIT)
add_subdirectory(WebKit)
endif ()
VERBATIM)
# Inspector Backend Dispatchers, Frontend Dispatchers, Type Builders
-file(MAKE_DIRECTORY ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol)
-file(MAKE_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector)
add_custom_command(
OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendDispatchers.cpp
${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendDispatchers.h
+2016-09-01 Brian Burg <bburg@apple.com>
+
+ Web Inspector: unify Main.html and Test.html sources and generate different copies with the preprocessor
+ https://bugs.webkit.org/show_bug.cgi?id=161212
+ <rdar://problem/28017961>
+
+ Reviewed by Joseph Pecoraro.
+
+ * CMakeLists.txt: Remove some unnecessary MAKE_DIRECTORY commands.
+
2016-09-03 Joseph Pecoraro <pecoraro@apple.com>
Use ASCIILiteral in some more places
add_subdirectory(${WEBCORE_DIR}/platform/efl/DefaultTheme)
-# DerivedSources/JavaScriptCore/inspector/InspectorBackendCommands.js is
-# expected in DerivedSources/WebInspectorUI/UserInterface/Protocol/.
-add_custom_command(
- OUTPUT ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
- DEPENDS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendCommands.js
- COMMAND cp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendCommands.js ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
-)
-
+# FIXME: This should move to Source/WebInspectorUI/PlatformWin.cmake and use the WebInspectorUI_RESOURCES list.
add_custom_target(
web-inspector-resources ALL
COMMAND ${CMAKE_COMMAND} -E copy_directory ${WEBINSPECTORUI_DIR}/UserInterface ${WEB_INSPECTOR_DIR}
COMMAND ${CMAKE_COMMAND} -E copy ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js ${WEB_INSPECTOR_DIR}/Protocol
+ COMMAND ${CMAKE_COMMAND} -E copy ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Main.html ${WEB_INSPECTOR_DIR}/UserInterface
+ COMMAND ${CMAKE_COMMAND} -E copy ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Test.html ${WEB_INSPECTOR_DIR}/UserInterface
COMMAND ${CMAKE_COMMAND} -E copy ${WEBINSPECTORUI_DIR}/Localizations/en.lproj/localizedStrings.js ${WEB_INSPECTOR_DIR}
COMMAND ${CMAKE_COMMAND} -E copy ${WEBKIT2_DIR}/UIProcess/InspectorServer/front-end/inspectorPageIndex.html ${WEB_INSPECTOR_DIR}
- DEPENDS JavaScriptCore WebCore ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
+ DEPENDS JavaScriptCore WebCore ${WebInspectorUI_RESOURCES}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
install(DIRECTORY "${CMAKE_BINARY_DIR}/${WEB_INSPECTOR_DIR}"
-set(WEBINSPECTORUI_DIR "${CMAKE_SOURCE_DIR}/Source/WebInspectorUI")
set(WEB_INSPECTOR_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/WebKit.resources/WebInspectorUI)
+# FIXME: This should move to Source/WebInspectorUI/PlatformWin.cmake and use the WebInspectorUI_RESOURCES list.
add_custom_target(
web-inspector-resources ALL
COMMAND ${CMAKE_COMMAND} -E copy_directory ${WEBINSPECTORUI_DIR}/UserInterface ${WEB_INSPECTOR_DIR}
- COMMAND ${CMAKE_COMMAND} -E copy ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendCommands.js ${WEB_INSPECTOR_DIR}/Protocol
+ COMMAND ${CMAKE_COMMAND} -E copy ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js ${WEB_INSPECTOR_DIR}/Protocol
+ COMMAND ${CMAKE_COMMAND} -E copy ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Main.html ${WEB_INSPECTOR_DIR}/UserInterface
+ COMMAND ${CMAKE_COMMAND} -E copy ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Test.html ${WEB_INSPECTOR_DIR}/UserInterface
COMMAND ${CMAKE_COMMAND} -E copy ${WEBINSPECTORUI_DIR}/Localizations/en.lproj/localizedStrings.js ${WEB_INSPECTOR_DIR}
COMMAND ${CMAKE_COMMAND} -E copy ${WEBKIT2_DIR}/UIProcess/InspectorServer/front-end/inspectorPageIndex.html ${WEB_INSPECTOR_DIR}
- DEPENDS JavaScriptCore WebCore
+ DEPENDS JavaScriptCore WebCore generate-inspector-resources
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
--- /dev/null
+set_property(DIRECTORY . PROPERTY FOLDER "WebInspectorUI")
+
+# FIXME: Mac CMake needs to additionally include image resources in PlatformMac.cmake.
+file(GLOB_RECURSE WebInspectorUI_RESOURCES
+ ${WEBINSPECTORUI_DIR}/UserInterface/*.html
+ ${WEBINSPECTORUI_DIR}/UserInterface/*.js
+ ${WEBINSPECTORUI_DIR}/UserInterface/*.css
+)
+
+set(WebInspectorUI_DERIVED_SOURCES
+ ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
+ ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Main.html
+ ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Test.html
+)
+list(APPEND WebInspectorUI_RESOURCES ${WebInspectorUI_DERIVED_SOURCES})
+
+# This variable is a hook for ports to toggle ENGINEERING_BUILD=1 based on some condition.
+set(COMMON_RESOURCE_DEFINES)
+
+# Copy InspectorBackendCommands.js from JavaScriptCore to WebInspectorUI.
+add_custom_command(
+ OUTPUT ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
+ DEPENDS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendCommands.js
+ COMMAND ${CMAKE_COMMAND} -E copy ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendCommands.js ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
+)
+
+WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
+
+set(MAIN_RESOURCE_DEFINES
+ ${COMMON_RESOURCE_DEFINES}
+ INCLUDE_UI_RESOURCES=1
+)
+
+set(TEST_RESOURCE_DEFINES
+ ${COMMON_RESOURCE_DEFINES}
+ INCLUDE_TEST_RESOURCES=1
+)
+
+macro(PROCESS_INSPECTOR_MAIN_RESOURCE _defines _out_file)
+ TO_LIST_WITH_SPACES("${_defines}" _defines_with_space_separator)
+ add_custom_command(
+ OUTPUT ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/${_out_file}
+ MAIN_DEPENDENCY ${WEBINSPECTORUI_DIR}/Scripts/preprocess-main-resource.pl
+ DEPENDS ${WEBINSPECTORUI_DIR}/UserInterface/Inspector.html.in
+ COMMAND ${PERL_EXECUTABLE} -I${WEBCORE_DIR}/bindings/scripts ${WEBINSPECTORUI_DIR}/Scripts/preprocess-main-resource.pl --defines="${_defines_with_space_separator}" ${WEBINSPECTORUI_DIR}/UserInterface/Inspector.html.in > ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/${_out_file}
+ )
+endmacro()
+
+PROCESS_INSPECTOR_MAIN_RESOURCE("${MAIN_RESOURCE_DEFINES}" Main.html)
+PROCESS_INSPECTOR_MAIN_RESOURCE("${TEST_RESOURCE_DEFINES}" Test.html)
+
+# Force generation of derived sources here since they are eventually needed by WebKit2.
+# They can't be generated in WebKit2 because WebInspectorUI_RESOURCES is out of scope.
+add_custom_target(generate-inspector-resources ALL
+ DEPENDS ${WebInspectorUI_RESOURCES}
+)
+2016-09-01 Brian Burg <bburg@apple.com>
+
+ Web Inspector: unify Main.html and Test.html sources and generate different copies with the preprocessor
+ https://bugs.webkit.org/show_bug.cgi?id=161212
+ <rdar://problem/28017961>
+
+ Reviewed by Joseph Pecoraro.
+
+ Add a Derived Sources build phase to WebInspectorUI project. Generate
+ Test.html and Main.html from a combined Inspector.html.in which has preprocessor
+ macros to include/exclude files not needed by all main resource versions.
+
+ Similarly, start generating these Inspector files in WebInspectorUI/CMakeLists.txt.
+ Move platform-specific bundling commands into PlatformGTK.cmake.
+
+ * CMakeLists.txt: Added.
+ Set up a list of common frontend resources that specific ports can extend, such as
+ with their own port-specific image resources. This list is the input to port-specific
+ packaging/bundling scripts. Eventually, minification and concatenation should happen
+ independently of the specific port by constructing the list of resources dynamically.
+
+ To ensure resources are always generated in WebInspectorUI and accessible from WebKit2,
+ add a dummy target that is always out of date and depends on generated files, causing
+ them to be built.
+
+ Also create a macro to run the preprocessor over Inspector.html.in using various
+ preprocessor macro definitions. These are customizable by ports to control the
+ appearance of ENGINEERING_BUILD, which guards resources not meant for shipping builds.
+
+ * Configurations/WebInspectorUIFramework.xcconfig:
+ We need to use preprocessor.pm from WebCore. On Mac, this is a private header.
+ Teach xcodebuild how to compute WEBCORE_PRIVATE_HEADERS_DIR. This is copied
+ from WebKit2's configuration files.
+
+ * PlatformGTK.cmake: Added.
+ Add GTK image resources to the resource list. Generate GResource catalog and embedded
+ C file into DerivedSources. WebKit2 will copy over this file and compile it.
+
+ * Scripts/combine-resources.pl:
+ (concatenateFiles):
+ Remove the --strip option as this patch removes the only use of it.
+
+ * DerivedSources.make: Added.
+ Generate Test.html and Main.html from the new combined Inspector.html.in.
+ The 'preprocess_main_resource' rule was copied from WebCore's DerivedSources.make.
+
+ * Scripts/cssmin.py: Removed.
+ * Scripts/jsmin.py: Removed.
+ These scripts are copied from JavaScriptCore but nobody uses these copies. Remove them.
+
+ * Scripts/copy-user-interface-resources-dryrun.rb: Do some cleanup.
+ - Stage scripts from SRCROOT into the tmpdir so dryrun doesn't require
+ a previous build to process WebInspectorUI resources.
+ - Run DerivedSources.make before copying/processing resources.
+ - Add some environment variables for new phase and group by script affected.
+ - Add a comment to clarify what this script is simulating.
+
+ * Scripts/copy-user-interface-resources.pl:
+ - Use Main.html and Test.html from DerivedSources/ instead of SRCROOT.
+ - Copy over Main.html and Test.html manually if not combining resources.
+ - Remove the command to strip files from Debug/ for production. This is
+ now redundant with ENGINEERING_BUILD guards in Inspector.html.in.
+ - Use jsmin.py from JavaScriptCore instead of the local copy.
+ - Wrap all multi-argument 'system' invocations so they are readable.
+
+ * Scripts/generate-webinspectorui-derived-sources: Added.
+ Added boilerplate script to run DerivedSources.make for Mac port.
+
+ * Scripts/preprocess-main-resource.pl: Added.
+ Trivially invoke the preprocessor on $0 using the given defines.
+
+ * UserInterface/Inspector.html.in: Renamed from Source/WebInspectorUI/UserInterface/Main.html.
+ * UserInterface/Test.html: Removed.
+ Combine Test.html and Main.html into Inspector.html.in. Add these guards:
+ - INCLUDE_TEST_RESOURCES: for resources excluded from Main.html.
+ - INCLUDE_UI_RESOURCES: for resources excluded from model tests.
+ - ENGINEERING_BUILD: for resources not to be shipped (Debug/ directory).
+
+ * WebInspectorUI.xcodeproj/project.pbxproj:
+ - Add new aggregate target 'Derived Sources' to project 'WebInspectorUI'.
+ - Add dependency on 'Derived Sources' to WebInspectorUI.framework.
+ - Remove unused copies of jsmin.py and cssmin.py.
+
2016-09-03 Devin Rousso <dcrousso+webkit@gmail.com>
Web Inspector: Change Cmd-D from kill line to selecting next occurrence
JAVASCRIPTCORE_PRIVATE_HEADERS_DIR_Production[sdk=macosx*] = $(SDKROOT)$(PRODUCTION_FRAMEWORKS_DIR)/JavaScriptCore.framework/PrivateHeaders;
JAVASCRIPTCORE_PRIVATE_HEADERS_engineering = $(BUILT_PRODUCTS_DIR)/JavaScriptCore.framework/PrivateHeaders;
+UMBRELLA_FRAMEWORKS_DIR = $(UMBRELLA_FRAMEWORKS_DIR_$(CONFIGURATION));
+UMBRELLA_FRAMEWORKS_DIR_Debug = $(UMBRELLA_FRAMEWORKS_DIR_engineering);
+UMBRELLA_FRAMEWORKS_DIR_Release = $(UMBRELLA_FRAMEWORKS_DIR_engineering);
+UMBRELLA_FRAMEWORKS_DIR_Production[sdk=iphone*] = $(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks;
+UMBRELLA_FRAMEWORKS_DIR_Production[sdk=macosx*] = $(SDKROOT)$(UMBRELLA_FRAMEWORKS_DIR_Production_macosx_USE_OVERRIDE_FRAMEWORKS_DIR_$(WK_USE_OVERRIDE_FRAMEWORKS_DIR));
+UMBRELLA_FRAMEWORKS_DIR_Production_macosx_USE_OVERRIDE_FRAMEWORKS_DIR_NO = $(NEXT_ROOT)$(SYSTEM_LIBRARY_DIR)/Frameworks/WebKit.framework/Versions/A/Frameworks;
+UMBRELLA_FRAMEWORKS_DIR_Production_macosx_USE_OVERRIDE_FRAMEWORKS_DIR_YES = $(WK_OVERRIDE_FRAMEWORKS_DIR);
+UMBRELLA_FRAMEWORKS_DIR_engineering = $(BUILT_PRODUCTS_DIR);
+
+WEBCORE_PRIVATE_HEADERS_DIR = $(UMBRELLA_FRAMEWORKS_DIR)/WebCore.framework/PrivateHeaders;
+
SKIP_INSTALL[sdk=iphone*] = YES;
--- /dev/null
+# Copyright (C) 2016 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+VPATH = \
+ $(WebInspectorUI) \
+#
+
+PERL = perl
+
+# For Perl modules whose directory needs to be added to Perl's search path.
+COMMON_SCRIPTS = \
+ $(WEBCORE_PRIVATE_HEADERS_DIR)/preprocessor.pm \
+#
+
+SCRIPTS = \
+ $(COMMON_SCRIPTS) \
+ $(WebInspectorUI)/Scripts/preprocess-main-resource.pl \
+#
+
+.PHONY : all
+
+PROCESSED_RESOURCE_FILES = \
+ Main.html \
+ Test.html \
+#
+
+COMMON_RESOURCE_DEFINES=$(ENGINEERING_BUILD_DEFINES)
+TEST_RESOURCE_DEFINES=INCLUDE_TEST_RESOURCES $(COMMON_RESOURCE_DEFINES)
+MAIN_RESOURCE_DEFINES=INCLUDE_UI_RESOURCES $(COMMON_RESOURCE_DEFINES)
+
+all: \
+ $(PROCESSED_RESOURCE_FILES) \
+#
+
+preprocess_main_resource = $(PERL) $(addprefix -I , $(sort $(dir $(1)))) $(WebInspectorUI)/Scripts/preprocess-main-resource.pl
+
+Main.html : $(WebInspectorUI)/UserInterface/Inspector.html.in $(SCRIPTS)
+ $(call preprocess_main_resource, $(COMMON_SCRIPTS)) --defines="$(MAIN_RESOURCE_DEFINES)" $< > $@
+
+Test.html : $(WebInspectorUI)/UserInterface/Inspector.html.in $(SCRIPTS)
+ $(call preprocess_main_resource, $(COMMON_SCRIPTS)) --defines="$(TEST_RESOURCE_DEFINES)" $< > $@
--- /dev/null
+file(GLOB WebInspectorUI_GTK_RESOURCES
+ ${WEBINSPECTORUI_DIR}/UserInterface/Images/gtk/*.png
+ ${WEBINSPECTORUI_DIR}/UserInterface/Images/gtk/*.svg
+)
+
+list(APPEND WebInspectorUI_RESOURCES
+ ${WebInspectorUI_GTK_RESOURCES}
+)
+
+# In developer mode, include resources that shouldn't be included in shipping builds.
+if (DEVELOPER_MODE)
+ list(APPEND COMMON_RESOURCE_DEFINES ENGINEERING_BUILD=1)
+endif ()
+
+add_custom_command(
+ OUTPUT ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/InspectorGResourceBundle.xml
+ DEPENDS ${WebInspectorUI_RESOURCES} ${TOOLS_DIR}/gtk/generate-inspector-gresource-manifest.py
+ COMMAND ${PYTHON_EXECUTABLE} ${TOOLS_DIR}/gtk/generate-inspector-gresource-manifest.py --output=${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/InspectorGResourceBundle.xml ${WebInspectorUI_RESOURCES}
+ VERBATIM
+)
+
+add_custom_command(
+ OUTPUT ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/InspectorGResourceBundle.c
+ DEPENDS ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/InspectorGResourceBundle.xml
+ COMMAND glib-compile-resources --generate --sourcedir=${WEBINSPECTORUI_DIR} --sourcedir=${DERIVED_SOURCES_WEBINSPECTORUI_DIR} --target=${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/InspectorGResourceBundle.c ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/InspectorGResourceBundle.xml
+ VERBATIM
+)
+
+# Force the bundle to be generated. WebKit2 will copy it into its own Derived Sources directory and build it.
+add_custom_target(package-inspector-resources ALL
+ DEPENDS ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/InspectorGResourceBundle.c
+)
\ No newline at end of file
our $derivedSourcesDirectory;
our $htmlDirectory;
our $htmlFile;
-our $strip;
GetOptions('output-dir=s' => \$outputDirectory,
'output-script-name=s' => \$outputScriptName,
'derived-sources-dir=s' => \$derivedSourcesDirectory,
'input-dir=s' => \$inputDirectory,
'input-html-dir=s' => \$htmlDirectory,
- 'input-html=s' => \$htmlFile,
- 'strip' => \$strip);
+ 'input-html=s' => \$htmlFile);
-unless (defined $htmlFile and defined $derivedSourcesDirectory and defined $outputDirectory and (defined $strip or defined $outputScriptName or defined $outputStylesheetName)) {
- print "Usage: $0 --input-html <path> --derived-sources-dir <path> --output-dir <path> [--output-script-name <name>] [--output-style-name <name>] [--strip]\n";
+unless (defined $htmlFile and defined $derivedSourcesDirectory and defined $outputDirectory and (defined $outputScriptName or defined $outputStylesheetName)) {
+ print "Usage: $0 --input-html <path> --derived-sources-dir <path> --output-dir <path> [--output-script-name <name>] [--output-style-name <name>]\n";
exit;
}
# Don't use \s so we can control the newlines we consume.
my $replacementExpression = "([\t ]*)" . $tagExpression . "[\t ]*\n+";
- if (defined $strip) {
- # Just strip all occurrences of the pattern.
- $headContents =~ s/$replacementExpression//gi;
- } else {
- # Replace the first occurrence with a token so we can inject the concatenated tag in the same place
- # as the first file that got consolidated. This makes sure we preserve some order if there are other
- # items in the head that we didn't consolidate.
- $headContents =~ s/$replacementExpression/$1%CONCATENATED%\n/i;
- $headContents =~ s/$replacementExpression//gi;
- $headContents =~ s/%CONCATENATED%/$concatenatedTag/;
- }
+ # Replace the first occurrence with a token so we can inject the concatenated tag in the same place
+ # as the first file that got consolidated. This makes sure we preserve some order if there are other
+ # items in the head that we didn't consolidate.
+ $headContents =~ s/$replacementExpression/$1%CONCATENATED%\n/i;
+ $headContents =~ s/$replacementExpression//gi;
+ $headContents =~ s/%CONCATENATED%/$concatenatedTag/;
}
my $inputDirectoryPattern = "(?!External\/)(?!Workers\/)[^\"]*";
exit 1
end
+JAVASCRIPTCORE_PATH = File.expand_path File.join(File.dirname(__FILE__), "..", "..", "JavaScriptCore")
+WEBCORE_PATH = File.expand_path File.join(File.dirname(__FILE__), "..", "..", "WebCore")
WEB_INSPECTOR_PATH = File.expand_path File.join(File.dirname(__FILE__), "..")
+GENERATE_DERIVED_SOURCES_PATH = File.join WEB_INSPECTOR_PATH, "Scripts", "generate-webinspectorui-derived-sources"
COPY_USER_INTERFACE_RESOURCES_PATH = File.join WEB_INSPECTOR_PATH, "Scripts", "copy-user-interface-resources.pl"
+# This script simulates processing user interface resources located in SRCROOT.
+# It places processed files in the specified output directory. This is most similar
+# to an isolated OBJROOT since it includes DerivedSources. It doesn't place files
+# into their DSTROOT locations, such as inside of WebInspectorUI.framework.
$output_directory = File.expand_path ARGV[0]
+$start_directory = FileUtils.pwd
Dir.mktmpdir do |tmpdir|
# Create the output directory if needed.
FileUtils.mkdir_p $output_directory
-
+
# Create empty derived sources expected to exist.
FileUtils.touch(File.join(tmpdir, 'InspectorBackendCommands.js'))
-
- # Setup the environment and run.
- ENV["DERIVED_SOURCES_DIR"] = tmpdir
+
+ # Stage some scripts expected to be in various framework PrivateHeaders.
ENV["JAVASCRIPTCORE_PRIVATE_HEADERS_DIR"] = tmpdir
+ ENV["WEBCORE_PRIVATE_HEADERS_DIR"] = tmpdir
+ FileUtils.cp(File.join(JAVASCRIPTCORE_PATH, "Scripts", "cssmin.py"), tmpdir)
+ FileUtils.cp(File.join(JAVASCRIPTCORE_PATH, "Scripts", "jsmin.py"), tmpdir)
+ FileUtils.cp(File.join(WEBCORE_PATH, "bindings", "scripts", "preprocessor.pm"), tmpdir)
+
+ # Setup the environment and generate derived sources.
ENV["SRCROOT"] = WEB_INSPECTOR_PATH
+ ENV["BUILT_PRODUCTS_DIR"] = $output_directory
+ ENV["ACTION"] = "install"
+ FileUtils.cd $start_directory
+ system(GENERATE_DERIVED_SOURCES_PATH) or raise "Failed to generate derived sources."
+
+ # Setup the environment and combine/process/stage resources.
+ ENV["DERIVED_SOURCES_DIR"] = File.join($output_directory, "DerivedSources", "WebInspectorUI")
ENV["TARGET_BUILD_DIR"] = $output_directory
ENV["UNLOCALIZED_RESOURCES_FOLDER_PATH"] = ""
ENV["COMBINE_INSPECTOR_RESOURCES"] = "YES"
ENV["COMBINE_TEST_RESOURCES"] = "YES"
- exec COPY_USER_INTERFACE_RESOURCES_PATH
+ ENV["FORCE_TOOL_INSTALL"] = "NO"
+ FileUtils.cd $start_directory
+ system(COPY_USER_INTERFACE_RESOURCES_PATH) or raise "Failed to process user interface resources."
end
my $inspectorLicense = <<'EOF';
/*
- * Copyright (C) 2007-2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2007-2016 Apple Inc. All rights reserved.
* Copyright (C) 2008 Matt Lilek. All rights reserved.
* Copyright (C) 2008-2009 Anthony Ricaud <rik@webkit.org>
* Copyright (C) 2009-2010 Joseph Pecoraro. All rights reserved.
my $python = ($OSNAME =~ /cygwin/) ? "/usr/bin/python" : "python";
my $derivedSourcesDir = $ENV{'DERIVED_SOURCES_DIR'};
my $scriptsRoot = File::Spec->catdir($ENV{'SRCROOT'}, 'Scripts');
+my $sharedScriptsRoot = File::Spec->catdir($ENV{'JAVASCRIPTCORE_PRIVATE_HEADERS_DIR'});
my $uiRoot = File::Spec->catdir($ENV{'SRCROOT'}, 'UserInterface');
my $targetResourcePath = File::Spec->catdir($ENV{'TARGET_BUILD_DIR'}, $ENV{'UNLOCALIZED_RESOURCES_FOLDER_PATH'});
my $protocolDir = File::Spec->catdir($targetResourcePath, 'Protocol');
# We may then proceed to include combined & optimized resources which will output mostly to different paths
# but overwrite Main.html / Main.js with optimized versions.
ditto($uiRoot, $targetResourcePath);
+ copy(File::Spec->catfile($derivedSourcesDir, "Main.html"), $targetResourcePath) or die "Copy of Main.html failed: $!";
+ copy(File::Spec->catfile($derivedSourcesDir, "Test.html"), $targetResourcePath) or die "Copy of Test.html failed: $!";
+ unlink File::Spec->catfile($targetResourcePath, "Inspector.html.in");
# Also force combining test resources for tool installs.
$shouldCombineTest = 1;
}
if ($shouldCombineMain) {
- # Remove Debug JavaScript and CSS files in Production builds.
- system($perl, $combineResourcesCmd, '--input-dir', 'Debug', '--input-html', File::Spec->catfile($uiRoot, 'Main.html'), '--input-html-dir', $uiRoot, '--derived-sources-dir', $derivedSourcesDir, '--output-dir', $derivedSourcesDir, '--output-script-name', 'Debug.js', '--output-style-name', 'Debug.css', '--strip');
-
# Combine the JavaScript and CSS files in Production builds into single files (Main.js and Main.css).
my $derivedSourcesMainHTML = File::Spec->catfile($derivedSourcesDir, 'Main.html');
- system($perl, $combineResourcesCmd, '--input-html', $derivedSourcesMainHTML, '--input-html-dir', $uiRoot, '--derived-sources-dir', $derivedSourcesDir, '--output-dir', $derivedSourcesDir, '--output-script-name', 'Main.js', '--output-style-name', 'Main.css');
+ system($perl, $combineResourcesCmd,
+ '--input-html', $derivedSourcesMainHTML,
+ '--input-html-dir', $uiRoot,
+ '--derived-sources-dir', $derivedSourcesDir,
+ '--output-dir', $derivedSourcesDir,
+ '--output-script-name', 'Main.js',
+ '--output-style-name', 'Main.css');
# Combine the CodeMirror JavaScript and CSS files in Production builds into single files (CodeMirror.js and CodeMirror.css).
- system($perl, $combineResourcesCmd, '--input-dir', 'External/CodeMirror', '--input-html', $derivedSourcesMainHTML, '--input-html-dir', $uiRoot, '--derived-sources-dir', $derivedSourcesDir, '--output-dir', $derivedSourcesDir, '--output-script-name', 'CodeMirror.js', '--output-style-name', 'CodeMirror.css');
+ system($perl, $combineResourcesCmd,
+ '--input-dir', 'External/CodeMirror',
+ '--input-html', $derivedSourcesMainHTML,
+ '--input-html-dir', $uiRoot,
+ '--derived-sources-dir', $derivedSourcesDir,
+ '--output-dir', $derivedSourcesDir,
+ '--output-script-name', 'CodeMirror.js',
+ '--output-style-name', 'CodeMirror.css');
# Combine the Esprima JavaScript files in Production builds into a single file (Esprima.js).
- system($perl, $combineResourcesCmd, '--input-dir', 'External/Esprima', '--input-html', $derivedSourcesMainHTML, '--input-html-dir', $uiRoot, '--derived-sources-dir', $derivedSourcesDir, '--output-dir', $derivedSourcesDir, '--output-script-name', 'Esprima.js');
+ system($perl, $combineResourcesCmd,
+ '--input-dir', 'External/Esprima',
+ '--input-html', $derivedSourcesMainHTML,
+ '--input-html-dir', $uiRoot,
+ '--derived-sources-dir', $derivedSourcesDir,
+ '--output-dir', $derivedSourcesDir,
+ '--output-script-name', 'Esprima.js');
# Combine the ESLint JavaScript files in Production builds into a single file (ESLint.js).
- system($perl, $combineResourcesCmd, '--input-dir', 'External/ESLint', '--input-html', $derivedSourcesMainHTML, '--input-html-dir', $uiRoot, '--derived-sources-dir', $derivedSourcesDir, '--output-dir', $derivedSourcesDir, '--output-script-name', 'ESLint.js');
+ system($perl, $combineResourcesCmd,
+ '--input-dir', 'External/ESLint',
+ '--input-html', $derivedSourcesMainHTML,
+ '--input-html-dir', $uiRoot,
+ '--derived-sources-dir', $derivedSourcesDir,
+ '--output-dir', $derivedSourcesDir,
+ '--output-script-name', 'ESLint.js');
# Remove console.assert calls from the Main.js file.
my $derivedSourcesMainJS = File::Spec->catfile($derivedSourcesDir, 'Main.js');
- system($perl, File::Spec->catfile($scriptsRoot, 'remove-console-asserts.pl'), '--input-script', $derivedSourcesMainJS, '--output-script', $derivedSourcesMainJS);
+ system($perl, File::Spec->catfile($scriptsRoot, 'remove-console-asserts.pl'),
+ '--input-script', $derivedSourcesMainJS,
+ '--output-script', $derivedSourcesMainJS);
# Fix Image URLs in the Main.css file by removing the "../".
my $derivedSourcesMainCSS = File::Spec->catfile($derivedSourcesDir, 'Main.css');
seedFile($targetESLintJS, $eslintLicense);
# Minify the Main.js and Main.css files, with Main.js appending to the license that was exported above.
- my $jsMinScript = File::Spec->catfile($scriptsRoot, 'jsmin.py');
- my $cssMinScript = File::Spec->catfile($scriptsRoot, 'cssmin.py');
+ my $jsMinScript = File::Spec->catfile($sharedScriptsRoot, 'jsmin.py');
+ my $cssMinScript = File::Spec->catfile($sharedScriptsRoot, 'cssmin.py');
system(qq("$python" "$jsMinScript" < "$derivedSourcesMainJS" >> "$targetMainJS")) and die "Failed to minify $derivedSourcesMainJS: $!";
system(qq("$python" "$cssMinScript" < "$derivedSourcesMainCSS" >> "$targetMainCSS")) and die "Failed to minify $derivedSourcesMainCSS: $!";
ditto(File::Spec->catfile($uiRoot, 'Workers'), $workersDir);
# Remove console.assert calls from the Worker js files.
- system($perl, File::Spec->catfile($scriptsRoot, 'remove-console-asserts.pl'), '--input-directory', $workersDir);
+ system($perl, File::Spec->catfile($scriptsRoot, 'remove-console-asserts.pl'),
+ '--input-directory', $workersDir);
# Fix import references in Workers directories. This rewrites "../../External/script.js" import paths to their new locations.
- system($perl, File::Spec->catfile($scriptsRoot, 'fix-worker-imports-for-optimized-builds.pl'), '--input-directory', $workersDir) and die "Failed to update Worker imports for optimized builds.";
+ system($perl, File::Spec->catfile($scriptsRoot, 'fix-worker-imports-for-optimized-builds.pl'),
+ '--input-directory', $workersDir)
+ and die "Failed to update Worker imports for optimized builds.";
} else {
# Keep the files separate for engineering builds.
ditto($uiRoot, $targetResourcePath);
+ copy(File::Spec->catfile($derivedSourcesDir, 'Main.html'), File::Spec->catfile($targetResourcePath, 'Main.html')) or die "Copy of Main.html failed: $!";
+ copy(File::Spec->catfile($derivedSourcesDir, 'Test.html'), File::Spec->catfile($targetResourcePath, 'Test.html')) or die "Copy of Test.html failed: $!";;
+ unlink File::Spec->catfile($targetResourcePath, 'Inspector.html.in');
}
if ($shouldCombineTest) {
- # Combine the JavaScript files for testing into a single file (TestCombined.js).
- system($perl, $combineResourcesCmd, '--input-html', File::Spec->catfile($uiRoot, 'Test.html'), '--derived-sources-dir', $derivedSourcesDir, '--output-dir', $derivedSourcesDir, '--output-script-name', 'TestCombined.js', '--output-style-name', 'TestCombined.css');
-
my $derivedSourcesTestHTML = File::Spec->catfile($derivedSourcesDir, 'Test.html');
- my $derivedSourcesTestJS = File::Spec->catfile($derivedSourcesDir, 'TestCombined.js');
+
+ # Combine the JavaScript files for testing into a single file (TestCombined.js).
+ system($perl, $combineResourcesCmd,
+ '--input-html', $derivedSourcesTestHTML,
+ '--input-html-dir', $uiRoot,
+ '--derived-sources-dir', $derivedSourcesDir,
+ '--output-dir', $derivedSourcesDir,
+ '--output-script-name', 'TestCombined.js',
+ '--output-style-name', 'TestCombined.css');
+
+ my $derivedSourcesTestCombinedJS = File::Spec->catfile($derivedSourcesDir, 'TestCombined.js');
# Combine the Esprima JavaScript files for testing into a single file (Esprima.js).
- system($perl, $combineResourcesCmd, '--input-dir', 'External/Esprima', '--input-html', $derivedSourcesTestHTML, '--input-html-dir', $uiRoot, '--derived-sources-dir', $derivedSourcesDir, '--output-dir', $derivedSourcesDir, '--output-script-name', 'TestEsprima.js');
+ system($perl, $combineResourcesCmd,
+ '--input-dir', 'External/Esprima',
+ '--input-html', $derivedSourcesTestHTML,
+ '--input-html-dir', $uiRoot,
+ '--derived-sources-dir', $derivedSourcesDir,
+ '--output-dir', $derivedSourcesDir,
+ '--output-script-name', 'TestEsprima.js');
# Export the license into TestCombined.js.
my $targetTestJS = File::Spec->catfile($targetResourcePath, 'TestCombined.js');
seedFile($targetTestJS, $inspectorLicense);
+ # Append TestCombined.js to the license that was exported above.
+ appendFile($targetTestJS, $derivedSourcesTestCombinedJS);
+
# Export the license into Esprima.js.
my $targetEsprimaJS = File::Spec->catfile($targetResourcePath, 'TestEsprima.js');
seedFile($targetEsprimaJS, $esprimaLicense);
- # Append TestCombined.js to the license that was exported above.
- appendFile($targetTestJS, $derivedSourcesTestJS);
-
# Append Esprima.js to the license that was exported above.
my $derivedSourcesEsprimaJS = File::Spec->catfile($derivedSourcesDir, 'TestEsprima.js');
appendFile($targetEsprimaJS, $derivedSourcesEsprimaJS);
# Copy over Test.html.
- copy($derivedSourcesTestHTML, File::Spec->catfile($targetResourcePath, 'Test.html'));
+ copy($derivedSourcesTestHTML, File::Spec->catfile($targetResourcePath, 'Test.html')) or die "Copy of Test.html failed: $!";
# Copy the Legacy directory.
ditto(File::Spec->catfile($uiRoot, 'Protocol', 'Legacy'), File::Spec->catfile($protocolDir, 'Legacy'));
+++ /dev/null
-#!/usr/bin/python
-
-# Copyright (C) 2013 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
-# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-# THE POSSIBILITY OF SUCH DAMAGE.
-
-import re
-
-def cssminify(css):
- rules = (
- (r"\/\*.*?\*\/", ""), # delete comments
- (r"\n", ""), # delete new lines
- (r"\s+", " "), # change multiple spaces to one space
- (r"\s?([;{},~>!])\s?", r"\1"), # delete space where it is not needed
- (r":\s", ":"), # delete spaces after colons, but not before. E.g. do not break selectors "a :focus", "b :matches(...)", "c :not(...)" where the leading space is significant
- (r"\s?([-+])(?:\s(?![0-9(])(?!var))", r"\1"), # delete whitespace around + and - when not followed by a number, paren, or var(). E.g. strip for selector "a + b" but not "calc(a + b)" which requires spaces.
- (r";}", "}") # change ';}' to '}' because the semicolon is not needed
- )
-
- css = css.replace("\r\n", "\n")
- for rule in rules:
- css = re.compile(rule[0], re.MULTILINE | re.UNICODE | re.DOTALL).sub(rule[1], css)
- return css
-
-if __name__ == "__main__":
- import sys
- if sys.version_info[0] == 3 and sys.stdin.encoding != 'UTF-8':
- import io
- sys.stdin = io.TextIOWrapper(sys.stdin.buffer, encoding='UTF-8')
- sys.stdout.write(cssminify(sys.stdin.read()))
--- /dev/null
+#!/bin/sh
+
+# Copyright (C) 2016 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+
+mkdir -p "${BUILT_PRODUCTS_DIR}/DerivedSources/WebInspectorUI"
+cd "${BUILT_PRODUCTS_DIR}/DerivedSources/WebInspectorUI"
+
+export WebInspectorUI="${SRCROOT}"
+
+/bin/ln -sfh "${WEBCORE_PRIVATE_HEADERS_DIR}" WebCorePrivateHeaders
+export WebCore_SCRIPTS_DIR="WebCorePrivateHeaders"
+
+if [ ! $CC ]; then
+ export CC="`xcrun -find clang`"
+fi
+
+if [ "${ACTION}" = "build" -o "${ACTION}" = "install" -o "${ACTION}" = "installhdrs" ]; then
+ make --no-builtin-rules -f "${WebInspectorUI}/DerivedSources.make" -j `/usr/sbin/sysctl -n hw.activecpu`
+fi
+++ /dev/null
-# This code is original from jsmin by Douglas Crockford, it was translated to
-# Python by Baruch Even. It was rewritten by Dave St.Germain for speed.
-#
-# The MIT License (MIT)
-#
-# Copyright (c) 2013 Dave St.Germain
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-
-import sys
-is_3 = sys.version_info >= (3, 0)
-if is_3:
- import io
-else:
- import StringIO
- try:
- import cStringIO
- except ImportError:
- cStringIO = None
-
-
-__all__ = ['jsmin', 'JavascriptMinify']
-__version__ = '2.0.9'
-
-
-def jsmin(js):
- """
- returns a minified version of the javascript string
- """
- if not is_3:
- if cStringIO and not isinstance(js, unicode):
- # strings can use cStringIO for a 3x performance
- # improvement, but unicode (in python2) cannot
- klass = cStringIO.StringIO
- else:
- klass = StringIO.StringIO
- else:
- klass = io.StringIO
- ins = klass(js)
- outs = klass()
- JavascriptMinify(ins, outs).minify()
- return outs.getvalue()
-
-
-class JavascriptMinify(object):
- """
- Minify an input stream of javascript, writing
- to an output stream
- """
-
- def __init__(self, instream=None, outstream=None):
- self.ins = instream
- self.outs = outstream
-
- def minify(self, instream=None, outstream=None):
- if instream and outstream:
- self.ins, self.outs = instream, outstream
-
- self.is_return = False
- self.return_buf = ''
-
- def write(char):
- # all of this is to support literal regular expressions.
- # sigh
- if char in 'return':
- self.return_buf += char
- self.is_return = self.return_buf == 'return'
- self.outs.write(char)
- if self.is_return:
- self.return_buf = ''
-
- read = self.ins.read
-
- space_strings = "abcdefghijklmnopqrstuvwxyz"\
- "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$\\"
- starters, enders = '{[(+-', '}])+-"\''
- newlinestart_strings = starters + space_strings
- newlineend_strings = enders + space_strings
- do_newline = False
- do_space = False
- escape_slash_count = 0
- doing_single_comment = False
- previous_before_comment = ''
- doing_multi_comment = False
- in_re = False
- in_quote = ''
- quote_buf = []
-
- previous = read(1)
- if previous == '\\':
- escape_slash_count += 1
- next1 = read(1)
- if previous == '/':
- if next1 == '/':
- doing_single_comment = True
- elif next1 == '*':
- doing_multi_comment = True
- previous = next1
- next1 = read(1)
- else:
- write(previous)
- elif not previous:
- return
- elif previous >= '!':
- if previous in "'\"":
- in_quote = previous
- write(previous)
- previous_non_space = previous
- else:
- previous_non_space = ' '
- if not next1:
- return
-
- while 1:
- next2 = read(1)
- if not next2:
- last = next1.strip()
- if not (doing_single_comment or doing_multi_comment)\
- and last not in ('', '/'):
- if in_quote:
- write(''.join(quote_buf))
- write(last)
- break
- if doing_multi_comment:
- if next1 == '*' and next2 == '/':
- doing_multi_comment = False
- next2 = read(1)
- elif doing_single_comment:
- if next1 in '\r\n':
- doing_single_comment = False
- while next2 in '\r\n':
- next2 = read(1)
- if not next2:
- break
- if previous_before_comment in ')}]':
- do_newline = True
- elif previous_before_comment in space_strings:
- write('\n')
- elif in_quote:
- quote_buf.append(next1)
-
- if next1 == in_quote:
- numslashes = 0
- for c in reversed(quote_buf[:-1]):
- if c != '\\':
- break
- else:
- numslashes += 1
- if numslashes % 2 == 0:
- in_quote = ''
- write(''.join(quote_buf))
- elif next1 in '\r\n':
- if previous_non_space in newlineend_strings \
- or previous_non_space > '~':
- while 1:
- if next2 < '!':
- next2 = read(1)
- if not next2:
- break
- else:
- if next2 in newlinestart_strings \
- or next2 > '~' or next2 == '/':
- do_newline = True
- break
- elif next1 < '!' and not in_re:
- if (previous_non_space in space_strings \
- or previous_non_space > '~') \
- and (next2 in space_strings or next2 > '~'):
- do_space = True
- elif previous_non_space in '-+' and next2 == previous_non_space:
- # protect against + ++ or - -- sequences
- do_space = True
- elif self.is_return and next2 == '/':
- # returning a regex...
- write(' ')
- elif next1 == '/':
- if do_space:
- write(' ')
- if in_re:
- if previous != '\\' or (not escape_slash_count % 2) or next2 in 'gimy':
- in_re = False
- write('/')
- elif next2 == '/':
- doing_single_comment = True
- previous_before_comment = previous_non_space
- elif next2 == '*':
- doing_multi_comment = True
- previous = next1
- next1 = next2
- next2 = read(1)
- else:
- in_re = previous_non_space in '(,=:[?!&|' or self.is_return # literal regular expression
- write('/')
- else:
- if do_space:
- do_space = False
- write(' ')
- if do_newline:
- write('\n')
- do_newline = False
-
- write(next1)
- if not in_re and next1 in "'\"`":
- in_quote = next1
- quote_buf = []
-
- previous = next1
- next1 = next2
-
- if previous >= '!':
- previous_non_space = previous
-
- if previous == '\\':
- escape_slash_count += 1
- else:
- escape_slash_count = 0
-
-if __name__ == '__main__':
- minifier = JavascriptMinify(sys.stdin, sys.stdout)
- minifier.minify()
- sys.stdout.write('\n')
--- /dev/null
+#!/usr/bin/perl -w
+
+# Copyright (C) 2016 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+use strict;
+use Getopt::Long;
+use preprocessor;
+
+my $usage = "Usage: $0 --defines=\"...\" FILENAME.html.in\n";
+
+my $defines;
+GetOptions('defines=s' => \$defines) or die $usage;
+
+my $input = shift or die $usage;
+die "Need to provide an HTML file as input." unless $input =~ /(\w+)\.html\.in$/;
+
+print applyPreprocessor($input, $defines);
<!--
- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2013, 2014, 2016 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+#if !INCLUDE_TEST_RESOURCES
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; img-src * file: blob: resource:; connect-src * ws:; media-src * blob:; font-src * blob:; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline'">
+#endif
+#if INCLUDE_UI_RESOURCES
<link rel="stylesheet" href="External/CodeMirror/codemirror.css">
<link rel="stylesheet" href="Views/ApplicationCacheFrameContentView.css">
<link rel="stylesheet" href="Controllers/CodeMirrorCompletionController.css">
<link rel="stylesheet" href="Controllers/CodeMirrorDragToAdjustNumberController.css">
<link rel="stylesheet" href="Controllers/CodeMirrorTokenTrackingController.css">
+#endif // INCLUDE_UI_RESOURCES
+#if ENGINEERING_BUILD && !INCLUDE_TEST_RESOURCES
<link rel="stylesheet" href="Debug/UncaughtExceptionReporter.css">
-
<script src="Debug/UncaughtExceptionReporter.js"></script>
+#endif
<script src="External/CodeMirror/codemirror.js"></script>
+ <script src="External/CodeMirror/css.js"></script>
+ <script src="External/CodeMirror/htmlmixed.js"></script>
+ <script src="External/CodeMirror/javascript.js"></script>
+
+#if INCLUDE_UI_RESOURCES
<script src="External/CodeMirror/clojure.js"></script>
<script src="External/CodeMirror/closebrackets.js"></script>
<script src="External/CodeMirror/coffeescript.js"></script>
<script src="External/CodeMirror/comment.js"></script>
- <script src="External/CodeMirror/css.js"></script>
- <script src="External/CodeMirror/htmlmixed.js"></script>
- <script src="External/CodeMirror/javascript.js"></script>
<script src="External/CodeMirror/livescript.js"></script>
<script src="External/CodeMirror/matchbrackets.js"></script>
<script src="External/CodeMirror/overlay.js"></script>
<script src="External/CodeMirror/sql.js"></script>
<script src="External/CodeMirror/sublime.js"></script>
<script src="External/CodeMirror/xml.js"></script>
+#endif
<script src="External/Esprima/esprima.js"></script>
<script src="Base/ListMultimap.js"></script>
<script src="Base/Object.js"></script>
+#if INCLUDE_TEST_RESOURCES
+ <script src="Test/TestHarness.js"></script>
+ <script src="Test/FrontendTestHarness.js"></script>
+ <script src="Test/TestSuite.js"></script>
+ <script src="Test/Test.js"></script>
+#else
+ <script src="Base/Main.js"></script>
+#endif
+
<script src="Base/DOMUtilities.js"></script>
<script src="Base/EventListener.js"></script>
<script src="Base/EventListenerSet.js"></script>
<script src="Models/ProfileNodeCall.js"></script>
<script src="Models/PropertyDescriptor.js"></script>
<script src="Models/PropertyPath.js"></script>
- <script src="Models/PropertyPreview.js"></script>
+ <script src="Models/PropertyPreview.js"></script>
<script src="Models/RenderingFrameTimelineRecord.js"></script>
<script src="Models/ReplayDashboard.js"></script>
<script src="Models/ReplaySession.js"></script>
<script src="Proxies/HeapSnapshotProxy.js"></script>
<script src="Proxies/HeapSnapshotWorkerProxy.js"></script>
+ <script src="Views/CodeMirrorAdditions.js"></script>
+ <script src="Views/CodeMirrorFormatters.js"></script>
+
+#if INCLUDE_UI_RESOURCES
<script src="Views/View.js"></script>
<script src="Views/ConsoleCommandView.js"></script>
<script src="Views/ChartDetailsSectionRow.js"></script>
<script src="Views/CircleChart.js"></script>
<script src="Views/ClusterContentView.js"></script>
- <script src="Views/CodeMirrorAdditions.js"></script>
<script src="Views/CodeMirrorEditor.js"></script>
- <script src="Views/CodeMirrorFormatters.js"></script>
<script src="Views/CodeMirrorTextMarkers.js"></script>
<script src="Views/ColorPicker.js"></script>
<script src="Views/ColorWheel.js"></script>
<script src="Views/VisualStyleTimingEditor.js"></script>
<script src="Views/VisualStyleURLInput.js"></script>
<script src="Views/VisualStyleUnitSlider.js"></script>
+#endif // INCLUDE_UI_RESOURCES
- <script src="Controllers/Annotator.js"></script>
- <script src="Controllers/CodeMirrorEditingController.js"></script>
+ <script src="Controllers/Formatter.js"></script>
+ <script src="Controllers/FormatterSourceMap.js"></script>
+ <script src="Controllers/ResourceQueryController.js"></script>
<script src="Controllers/AnalyzerManager.js"></script>
<script src="Controllers/ApplicationCacheManager.js"></script>
- <script src="Controllers/BasicBlockAnnotator.js"></script>
<script src="Controllers/BranchManager.js"></script>
- <script src="Controllers/BreakpointPopoverController.js"></script>
<script src="Controllers/CSSStyleManager.js"></script>
- <script src="Controllers/CodeMirrorColorEditingController.js"></script>
- <script src="Controllers/CodeMirrorCompletionController.js"></script>
- <script src="Controllers/CodeMirrorBezierEditingController.js"></script>
- <script src="Controllers/CodeMirrorDragToAdjustNumberController.js"></script>
- <script src="Controllers/CodeMirrorGradientEditingController.js"></script>
- <script src="Controllers/CodeMirrorSpringEditingController.js"></script>
- <script src="Controllers/CodeMirrorTokenTrackingController.js"></script>
- <script src="Controllers/CodeMirrorTextKillController.js"></script>
- <script src="Controllers/DOMTreeManager.js"></script>
+ <script src="Controllers/CSSStyleManager.js"></script>
<script src="Controllers/DashboardManager.js"></script>
<script src="Controllers/DebuggerManager.js"></script>
- <script src="Controllers/DragToAdjustController.js"></script>
- <script src="Controllers/Formatter.js"></script>
- <script src="Controllers/FormatterSourceMap.js"></script>
+ <script src="Controllers/DOMTreeManager.js"></script>
<script src="Controllers/FrameResourceManager.js"></script>
<script src="Controllers/HeapManager.js"></script>
<script src="Controllers/IssueManager.js"></script>
- <script src="Controllers/JavaScriptLogViewController.js"></script>
- <script src="Controllers/JavaScriptRuntimeCompletionProvider.js"></script>
<script src="Controllers/LayerTreeManager.js"></script>
<script src="Controllers/LogManager.js"></script>
<script src="Controllers/MemoryManager.js"></script>
<script src="Controllers/ProbeManager.js"></script>
<script src="Controllers/ReplayManager.js"></script>
- <script src="Controllers/ResourceQueryController.js"></script>
<script src="Controllers/RuntimeManager.js"></script>
<script src="Controllers/SourceMapManager.js"></script>
<script src="Controllers/StorageManager.js"></script>
<script src="Controllers/TimelineManager.js"></script>
+
+#if INCLUDE_UI_RESOURCES
+ <script src="Controllers/Annotator.js"></script>
+ <script src="Controllers/CodeMirrorEditingController.js"></script>
+
+ <script src="Controllers/BasicBlockAnnotator.js"></script>
+ <script src="Controllers/BreakpointPopoverController.js"></script>
+ <script src="Controllers/CodeMirrorColorEditingController.js"></script>
+ <script src="Controllers/CodeMirrorCompletionController.js"></script>
+ <script src="Controllers/CodeMirrorBezierEditingController.js"></script>
+ <script src="Controllers/CodeMirrorDragToAdjustNumberController.js"></script>
+ <script src="Controllers/CodeMirrorGradientEditingController.js"></script>
+ <script src="Controllers/CodeMirrorSpringEditingController.js"></script>
+ <script src="Controllers/CodeMirrorTokenTrackingController.js"></script>
+ <script src="Controllers/CodeMirrorTextKillController.js"></script>
+ <script src="Controllers/DragToAdjustController.js"></script>
+ <script src="Controllers/JavaScriptLogViewController.js"></script>
+ <script src="Controllers/JavaScriptRuntimeCompletionProvider.js"></script>
<script src="Controllers/TypeTokenAnnotator.js"></script>
<script src="Controllers/VisualStyleCompletionsController.js"></script>
+#endif
<script src="Workers/Formatter/FormatterContentBuilder.js"></script>
- <script src="Base/Main.js"></script>
-
+#if ENGINEERING_BUILD
<script src="Debug/Bootstrap.js"></script>
<script src="Debug/CapturingProtocolTracer.js"></script>
<script src="Debug/ProtocolTrace.js"></script>
+#endif
<script>
WebInspector.loaded();
+
+#if INCLUDE_TEST_RESOURCES
+ // Debug logging is synchronous on the test page.
+ InspectorTest.forceDebugLogging = false;
+
+ // Tee all TestHarness commands to stderr from within the Inspector.
+ InspectorTest.dumpActivityToSystemConsole = false;
+
+ // Best used in combination with dumpActivityToSystemConsole.
+ InspectorBackend.dumpInspectorProtocolMessages = false;
+#endif
</script>
</head>
<body>
+++ /dev/null
-<!--
- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
- * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--->
-<!DOCTYPE html>
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <!--
- These resources should match the order and groups used in Main.html.
- -->
- <script src="External/CodeMirror/codemirror.js"></script>
- <script src="External/CodeMirror/css.js"></script>
- <script src="External/CodeMirror/htmlmixed.js"></script>
- <script src="External/CodeMirror/javascript.js"></script>
- <script src="External/Esprima/esprima.js"></script>
-
- <script src="Base/WebInspector.js"></script>
- <script src="Base/InspectorFrontendHostStub.js"></script>
- <script src="Base/LinkedList.js"></script>
- <script src="Base/ListMultimap.js"></script>
- <script src="Base/Object.js"></script>
-
- <script src="Test/TestHarness.js"></script>
- <script src="Test/FrontendTestHarness.js"></script>
- <script src="Test/TestSuite.js"></script>
-
- <script src="Test/Test.js"></script>
-
- <script src="Base/DOMUtilities.js"></script>
- <script src="Base/EventListener.js"></script>
- <script src="Base/EventListenerSet.js"></script>
- <script src="Base/URLUtilities.js"></script>
- <script src="Base/Utilities.js"></script>
- <script src="Base/Setting.js"></script>
- <script src="Base/YieldableTask.js"></script>
-
- <script src="Protocol/ProtocolTracer.js"></script>
- <script src="Protocol/LoggingProtocolTracer.js"></script>
-
- <script src="Protocol/InspectorBackend.js"></script>
- <script src="Protocol/InspectorFrontendAPI.js"></script>
- <script src="Protocol/LoadInspectorBackendCommands.js"></script>
- <script src="Protocol/MessageDispatcher.js"></script>
-
- <script src="Protocol/InspectorObserver.js"></script>
- <script src="Protocol/CSSObserver.js"></script>
- <script src="Protocol/ConsoleObserver.js"></script>
- <script src="Protocol/DOMObserver.js"></script>
- <script src="Protocol/DOMStorageObserver.js"></script>
- <script src="Protocol/DebuggerObserver.js"></script>
- <script src="Protocol/HeapObserver.js"></script>
- <script src="Protocol/NetworkObserver.js"></script>
- <script src="Protocol/PageObserver.js"></script>
- <script src="Protocol/RemoteObject.js"></script>
- <script src="Protocol/ReplayObserver.js"></script>
- <script src="Protocol/RuntimeObserver.js"></script>
- <script src="Protocol/TimelineObserver.js"></script>
-
- <script src="Models/BreakpointAction.js"></script>
- <script src="Models/ConsoleMessage.js"></script>
- <script src="Models/Instrument.js"></script>
- <script src="Models/SourceCode.js"></script>
- <script src="Models/SourceCodeLocation.js"></script>
- <script src="Models/Timeline.js"></script>
- <script src="Models/TimelineRange.js"></script>
- <script src="Models/TimelineRecord.js"></script>
-
- <script src="Models/Breakpoint.js"></script>
- <script src="Models/CSSCompletions.js"></script>
- <script src="Models/CSSKeywordCompletions.js"></script>
- <script src="Models/CSSMedia.js"></script>
- <script src="Models/CSSProperty.js"></script>
- <script src="Models/CSSRule.js"></script>
- <script src="Models/CSSSelector.js"></script>
- <script src="Models/CSSStyleDeclaration.js"></script>
- <script src="Models/CSSStyleSheet.js"></script>
- <script src="Models/CallFrame.js"></script>
- <script src="Models/CallingContextTree.js"></script>
- <script src="Models/CallingContextTreeNode.js"></script>
- <script src="Models/CollectionEntry.js"></script>
- <script src="Models/CollectionEntryPreview.js"></script>
- <script src="Models/Color.js"></script>
- <script src="Models/ConsoleCommandResultMessage.js"></script>
- <script src="Models/ContentFlow.js"></script>
- <script src="Models/CookieStorageObject.js"></script>
- <script src="Models/DOMNode.js"></script>
- <script src="Models/DOMNodeStyles.js"></script>
- <script src="Models/DOMStorageObject.js"></script>
- <script src="Models/DOMTree.js"></script>
- <script src="Models/ExecutionContext.js"></script>
- <script src="Models/ExecutionContextList.js"></script>
- <script src="Models/FPSInstrument.js"></script>
- <script src="Models/Frame.js"></script>
- <script src="Models/GarbageCollection.js"></script>
- <script src="Models/Geometry.js"></script>
- <script src="Models/HeapAllocationsInstrument.js"></script>
- <script src="Models/HeapAllocationsTimelineRecord.js"></script>
- <script src="Models/IndexedDatabase.js"></script>
- <script src="Models/IndexedDatabaseObjectStore.js"></script>
- <script src="Models/IndexedDatabaseObjectStoreIndex.js"></script>
- <script src="Models/IssueMessage.js"></script>
- <script src="Models/LayoutInstrument.js"></script>
- <script src="Models/LayoutTimelineRecord.js"></script>
- <script src="Models/LazySourceCodeLocation.js"></script>
- <script src="Models/MemoryCategory.js"></script>
- <script src="Models/MemoryInstrument.js"></script>
- <script src="Models/MemoryTimeline.js"></script>
- <script src="Models/MemoryTimelineRecord.js"></script>
- <script src="Models/NetworkInstrument.js"></script>
- <script src="Models/NetworkTimeline.js"></script>
- <script src="Models/ObjectPreview.js"></script>
- <script src="Models/Probe.js"></script>
- <script src="Models/ProbeSet.js"></script>
- <script src="Models/ProbeSetDataFrame.js"></script>
- <script src="Models/ProbeSetDataTable.js"></script>
- <script src="Models/Profile.js"></script>
- <script src="Models/ProfileNode.js"></script>
- <script src="Models/ProfileNodeCall.js"></script>
- <script src="Models/PropertyDescriptor.js"></script>
- <script src="Models/PropertyPreview.js"></script>
- <script src="Models/RenderingFrameTimelineRecord.js"></script>
- <script src="Models/ReplaySession.js"></script>
- <script src="Models/ReplaySessionSegment.js"></script>
- <script src="Models/Resource.js"></script>
- <script src="Models/ResourceCollection.js"></script>
- <script src="Models/ResourceQueryMatch.js"></script>
- <script src="Models/ResourceQueryResult.js"></script>
- <script src="Models/ResourceTimelineRecord.js"></script>
- <script src="Models/ResourceTimingData.js"></script>
- <script src="Models/Revision.js"></script>
- <script src="Models/ScopeChainNode.js"></script>
- <script src="Models/Script.js"></script>
- <script src="Models/ScriptInstrument.js"></script>
- <script src="Models/ScriptSyntaxTree.js"></script>
- <script src="Models/ScriptTimelineRecord.js"></script>
- <script src="Models/SourceCodeRevision.js"></script>
- <script src="Models/SourceCodeTimeline.js"></script>
- <script src="Models/SourceMapResource.js"></script>
- <script src="Models/StackTrace.js"></script>
- <script src="Models/TextRange.js"></script>
- <script src="Models/TimelineMarker.js"></script>
- <script src="Models/TimelineRecording.js"></script>
-
- <script src="Proxies/FormatterWorkerProxy.js"></script>
- <script src="Proxies/HeapSnapshotDiffProxy.js"></script>
- <script src="Proxies/HeapSnapshotEdgeProxy.js"></script>
- <script src="Proxies/HeapSnapshotNodeProxy.js"></script>
- <script src="Proxies/HeapSnapshotProxy.js"></script>
- <script src="Proxies/HeapSnapshotWorkerProxy.js"></script>
-
- <script src="Controllers/CSSStyleManager.js"></script>
- <script src="Controllers/DOMTreeManager.js"></script>
- <script src="Controllers/DebuggerManager.js"></script>
- <script src="Controllers/FrameResourceManager.js"></script>
- <script src="Controllers/HeapManager.js"></script>
- <script src="Controllers/IssueManager.js"></script>
- <script src="Controllers/LogManager.js"></script>
- <script src="Controllers/MemoryManager.js"></script>
- <script src="Controllers/ProbeManager.js"></script>
- <script src="Controllers/ReplayManager.js"></script>
- <script src="Controllers/RuntimeManager.js"></script>
- <script src="Controllers/StorageManager.js"></script>
- <script src="Controllers/TimelineManager.js"></script>
-
- <script src="Controllers/Formatter.js"></script>
- <script src="Controllers/ResourceQueryController.js"></script>
- <script src="Workers/Formatter/FormatterContentBuilder.js"></script>
- <script src="Views/CodeMirrorAdditions.js"></script>
- <script src="Views/CodeMirrorFormatters.js"></script>
-
- <script type="text/javascript">
- WebInspector.loaded();
-
- // Debug logging is synchronous on the test page.
- InspectorTest.forceDebugLogging = false;
-
- // Tee all TestHarness commands to stderr from within the Inspector.
- InspectorTest.dumpActivityToSystemConsole = false;
-
- // Best used in combination with dumpActivityToSystemConsole.
- InspectorBackend.dumpInspectorProtocolMessages = false;
- </script>
-</head>
-<body>
-</body>
-</html>
objectVersion = 46;
objects = {
+/* Begin PBXAggregateTarget section */
+ 99E9A7F21D70BAD300C247A6 /* Derived Sources */ = {
+ isa = PBXAggregateTarget;
+ buildConfigurationList = 99E9A7F31D70BAD300C247A6 /* Build configuration list for PBXAggregateTarget "Derived Sources" */;
+ buildPhases = (
+ 99E9A7F91D70BAF600C247A6 /* Generate Derived Sources */,
+ );
+ dependencies = (
+ );
+ name = "Derived Sources";
+ productName = "Derived Sources";
+ };
+/* End PBXAggregateTarget section */
+
/* Begin PBXBuildFile section */
1C60FF1614E6E3F7006CD77D /* localizedStrings.js in Resources */ = {isa = PBXBuildFile; fileRef = 1C60FF1314E6E35D006CD77D /* localizedStrings.js */; };
1C78EE1717611340002F6AA5 /* WebInspectorUI.c in Sources */ = {isa = PBXBuildFile; fileRef = 1C78EE1617611340002F6AA5 /* WebInspectorUI.c */; };
/* End PBXBuildFile section */
+/* Begin PBXContainerItemProxy section */
+ 99E9A7F71D70BADD00C247A6 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = A54C224D148B23DE00373FA3 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 99E9A7F21D70BAD300C247A6;
+ remoteInfo = "Derived Sources";
+ };
+/* End PBXContainerItemProxy section */
+
/* Begin PBXFileReference section */
- 1C435CAC14E7B287004E10EA /* cssmin.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; path = cssmin.py; sourceTree = "<group>"; };
- 1C435CAD14E7B287004E10EA /* jsmin.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; path = jsmin.py; sourceTree = "<group>"; };
1C60FE2F14E5F3CD006CD77D /* Base.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = "<group>"; };
1C60FE3114E5F3CD006CD77D /* DebugRelease.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = DebugRelease.xcconfig; sourceTree = "<group>"; };
1C60FE3214E5F3CD006CD77D /* Version.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Version.xcconfig; sourceTree = "<group>"; };
children = (
1C60FF1914E73C64006CD77D /* combine-resources.pl */,
1C60FFE114E79B0F006CD77D /* copy-user-interface-resources.pl */,
- 1C435CAC14E7B287004E10EA /* cssmin.py */,
- 1C435CAD14E7B287004E10EA /* jsmin.py */,
1C60FF1A14E73DCA006CD77D /* remove-console-asserts.pl */,
);
path = Scripts;
buildRules = (
);
dependencies = (
+ 99E9A7F81D70BADD00C247A6 /* PBXTargetDependency */,
);
name = WebInspectorUI;
productName = WebInspector;
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0700;
ORGANIZATIONNAME = Apple;
+ TargetAttributes = {
+ 99E9A7F21D70BAD300C247A6 = {
+ CreatedOnToolsVersion = 8.0;
+ ProvisioningStyle = Automatic;
+ };
+ };
};
buildConfigurationList = A54C2250148B23DE00373FA3 /* Build configuration list for PBXProject "WebInspectorUI" */;
compatibilityVersion = "Xcode 3.2";
projectRoot = "";
targets = (
A54C2256148B23DF00373FA3 /* WebInspectorUI */,
+ 99E9A7F21D70BAD300C247A6 /* Derived Sources */,
);
};
/* End PBXProject section */
name = "Copy User Interface Resources";
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "/usr/bin/perl \"${SRCROOT}/Scripts/copy-user-interface-resources.pl\"";
+ shellScript = "# This is defined differently for Make/xcodebuild vs CMake ports.\nDERIVED_SOURCES_DIR=\"${BUILT_PRODUCTS_DIR}/DerivedSources/WebInspectorUI\"\n\n/usr/bin/perl \"${SRCROOT}/Scripts/copy-user-interface-resources.pl\"";
+ };
+ 99E9A7F91D70BAF600C247A6 /* Generate Derived Sources */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Generate Derived Sources";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "GENERATE_DERIVED_SOURCES_PATH=\"${SRCROOT}/Scripts/generate-webinspectorui-derived-sources\"\n[[ -x \"${GENERATE_DERIVED_SOURCES_PATH}\" ]] && exec \"${GENERATE_DERIVED_SOURCES_PATH}\"\nexit 0\n";
};
/* End PBXShellScriptBuildPhase section */
};
/* End PBXSourcesBuildPhase section */
+/* Begin PBXTargetDependency section */
+ 99E9A7F81D70BADD00C247A6 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 99E9A7F21D70BAD300C247A6 /* Derived Sources */;
+ targetProxy = 99E9A7F71D70BADD00C247A6 /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
/* Begin PBXVariantGroup section */
1C60FF1314E6E35D006CD77D /* localizedStrings.js */ = {
isa = PBXVariantGroup;
};
name = Production;
};
+ 99E9A7F41D70BAD300C247A6 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 1C60FE3314E5F3CD006CD77D /* WebInspectorUIFramework.xcconfig */;
+ buildSettings = {
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Debug;
+ };
+ 99E9A7F51D70BAD300C247A6 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 1C60FE3314E5F3CD006CD77D /* WebInspectorUIFramework.xcconfig */;
+ buildSettings = {
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Release;
+ };
+ 99E9A7F61D70BAD300C247A6 /* Production */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 1C60FE3314E5F3CD006CD77D /* WebInspectorUIFramework.xcconfig */;
+ buildSettings = {
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Production;
+ };
A54C226A148B23DF00373FA3 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 1C60FE3114E5F3CD006CD77D /* DebugRelease.xcconfig */;
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
+ 99E9A7F31D70BAD300C247A6 /* Build configuration list for PBXAggregateTarget "Derived Sources" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 99E9A7F41D70BAD300C247A6 /* Debug */,
+ 99E9A7F51D70BAD300C247A6 /* Release */,
+ 99E9A7F61D70BAD300C247A6 /* Production */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Production;
+ };
A54C2250148B23DE00373FA3 /* Build configuration list for PBXProject "WebInspectorUI" */ = {
isa = XCConfigurationList;
buildConfigurations = (
+2016-09-01 Brian Burg <bburg@apple.com>
+
+ Web Inspector: unify Main.html and Test.html sources and generate different copies with the preprocessor
+ https://bugs.webkit.org/show_bug.cgi?id=161212
+ <rdar://problem/28017961>
+
+ Reviewed by Joseph Pecoraro.
+
+ Rearrange CMake rules so that most Inspector UI work is done in WebInspectorUI.
+
+ * PlatformGTK.cmake:
+ - Move the list of Inspector resources into WebInspectorUI/CMakeLists.txt.
+ - Move generation of InspectorGResourceBundle into WebInspectorUI.
+ - Copy over InspectorGResourceBundle.c into WebKit2's Derived Sources before compiling.
+
2016-09-03 Wenson Hsieh <wenson_hsieh@apple.com>
Refactor the heuristic for showing media controls to take all media sessions into account
)
list(APPEND WebKit2_DERIVED_SOURCES
- ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.c
${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2InspectorGResourceBundle.c
${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2ResourcesGResourceBundle.c
${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.h
)
-set(InspectorFiles
- ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/*.html
- ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Base/*.js
- ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Controllers/*.css
- ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Controllers/*.js
- ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Debug/*.css
- ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Debug/*.js
- ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/CodeMirror/*.css
- ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/CodeMirror/*.js
- ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/ESLint/*.js
- ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/Esprima/*.js
- ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Models/*.js
- ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Protocol/*.js
- ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Proxies/*.js
- ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Test/*.js
- ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Views/*.css
- ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Views/*.js
- ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Workers/Formatter/*.js
- ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Workers/HeapSnapshot/*.js
- ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Images/gtk/*.png
- ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Images/gtk/*.svg
- ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
-)
-
-file(GLOB InspectorFilesDependencies
- ${InspectorFiles}
-)
-
-# DerivedSources/JavaScriptCore/inspector/InspectorBackendCommands.js is
-# expected in DerivedSources/WebInspectorUI/UserInterface/Protocol/.
-add_custom_command(
- OUTPUT ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
- DEPENDS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendCommands.js
- COMMAND cp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendCommands.js ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
-)
-
# This is necessary because of a conflict between the GTK+ API WebKitVersion.h and one generated by WebCore.
list(INSERT WebKit2_INCLUDE_DIRECTORIES 0
"${FORWARDING_HEADERS_WEBKIT2GTK_DIR}"
COMMAND glib-mkenums --template ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitEnumTypes.cpp.template ${WebKit2GTK_ENUM_GENERATION_HEADERS} | sed s/web_kit/webkit/ > ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitEnumTypes.cpp
VERBATIM)
-add_custom_command(
- OUTPUT ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.xml
- DEPENDS ${InspectorFilesDependencies}
- ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
- ${TOOLS_DIR}/gtk/generate-inspector-gresource-manifest.py
- COMMAND ${PYTHON_EXECUTABLE} ${TOOLS_DIR}/gtk/generate-inspector-gresource-manifest.py --output=${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.xml ${InspectorFiles} ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
- VERBATIM
-)
-
-add_custom_command(
- OUTPUT ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.c
- DEPENDS ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.xml
- COMMAND glib-compile-resources --generate --sourcedir=${CMAKE_SOURCE_DIR}/Source/WebInspectorUI --sourcedir=${DERIVED_SOURCES_WEBINSPECTORUI_DIR} --target=${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.c ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.xml
- VERBATIM
-)
-
add_custom_command(
OUTPUT ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2InspectorGResourceBundle.c
DEPENDS ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKit2InspectorGResourceBundle.xml
)
endif ()
+add_custom_command(
+ OUTPUT ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.c
+ DEPENDS ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/InspectorGResourceBundle.c
+ COMMAND cp ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/InspectorGResourceBundle.c ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectrGResourceBundle.c
+)
+list(APPEND WebKit2_DERIVED_SOURCES
+ ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.c
+)
+
file(WRITE ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2ResourcesGResourceBundle.xml
"<?xml version=1.0 encoding=UTF-8?>\n"
"<gresources>\n"
if (NOT WEBCORE_DIR)
set(WEBCORE_DIR "${CMAKE_SOURCE_DIR}/Source/WebCore")
endif ()
+if (NOT WEBINSPECTORUI_DIR)
+ set(WEBINSPECTORUI_DIR "${CMAKE_SOURCE_DIR}/Source/WebInspectorUI")
+endif ()
if (NOT WEBKIT_DIR)
set(WEBKIT_DIR "${CMAKE_SOURCE_DIR}/Source/WebKit")
endif ()
set(DERIVED_SOURCES_WEBINSPECTORUI_DIR "${CMAKE_BINARY_DIR}/DerivedSources/WebInspectorUI")
file(MAKE_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR})
+file(MAKE_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Source/JavaScriptCore/runtime)
file(MAKE_DIRECTORY ${DERIVED_SOURCES_WEBINSPECTORUI_DIR})
endforeach ()
endmacro()
+
+# Converts a CMake list to a string containing elements separated by spaces.
+macro(TO_LIST_WITH_SPACES _in_list _out_string)
+ set(${_out_string} "")
+ foreach (_item ${_in_list})
+ set(${_out_string} "${${_out_string}} ${_item}")
+ endforeach ()
+ string(STRIP "${${_out_string}}" ${_out_string})
+endmacro()