Changeset 205415 in webkit


Ignore:
Timestamp:
Sep 3, 2016 9:34:57 PM (8 years ago)
Author:
BJ Burg
Message:

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.

Source/JavaScriptCore:

  • CMakeLists.txt: Remove some unnecessary MAKE_DIRECTORY commands.

Source/WebInspectorUI:

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.

Source/WebKit2:

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.
Location:
trunk
Files:
4 added
3 deleted
16 edited
1 copied
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r205310 r205415  
     12016-09-01  Brian Burg  <bburg@apple.com>
     2
     3        Web Inspector: unify Main.html and Test.html sources and generate different copies with the preprocessor
     4        https://bugs.webkit.org/show_bug.cgi?id=161212
     5        <rdar://problem/28017961>
     6
     7        Reviewed by Joseph Pecoraro.
     8
     9        Rearrange some CMake rules so most Inspector UI work is done in WebInspectorUI.
     10
     11        * Source/CMakeLists.txt: Add 'WebInspectorUI' subdirectory.
     12        * Source/PlatformEfl.cmake:
     13        - Move the rule to copy InspectorBackendCommands.js into WebInspectorUI/CMakeLists.txt.
     14        - Add a FIXME to use the cross-port list of Inspector resources instead of copying everything.
     15        - Add new dependency so generated WebInspectorUI files are made by web-inspector-resources.
     16        - Copy over generated files Main.html and Test.html.
     17
     18        * Source/PlatformWin.cmake:
     19        - Add a FIXME to use the cross-port list of Inspector resources instead of copying everything.
     20        - Add new dependency so generated WebInspectorUI files are made by web-inspector-resources.
     21        - Copy over generated files Main.html and Test.html.
     22
     23        * Source/cmake/WebKitFS.cmake:
     24        - Set up WEBINSPECTORUI_DIR and use it.
     25        - Move directory creation commands here from JavaScriptCore.
     26
     27        * Source/cmake/WebKitMacros.cmake:
     28        Add a helper to turn a CMake list into a space-delimited string of elements.
     29
    1302016-09-01  Brian Burg  <bburg@apple.com>
    231
  • trunk/Source/CMakeLists.txt

    r198766 r205415  
    2525if (ENABLE_WEBCORE)
    2626    add_subdirectory(WebCore)
     27endif ()
     28
     29if (ENABLE_WEBKIT OR ENABLE_WEBKIT2)
     30    add_subdirectory(WebInspectorUI)
    2731endif ()
    2832
  • trunk/Source/JavaScriptCore/CMakeLists.txt

    r205198 r205415  
    12001200
    12011201# Inspector Backend Dispatchers, Frontend Dispatchers, Type Builders
    1202 file(MAKE_DIRECTORY ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol)
    1203 file(MAKE_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector)
    12041202add_custom_command(
    12051203    OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendDispatchers.cpp
  • trunk/Source/JavaScriptCore/ChangeLog

    r205405 r205415  
     12016-09-01  Brian Burg  <bburg@apple.com>
     2
     3        Web Inspector: unify Main.html and Test.html sources and generate different copies with the preprocessor
     4        https://bugs.webkit.org/show_bug.cgi?id=161212
     5        <rdar://problem/28017961>
     6
     7        Reviewed by Joseph Pecoraro.
     8
     9        * CMakeLists.txt: Remove some unnecessary MAKE_DIRECTORY commands.
     10
    1112016-09-03  Joseph Pecoraro  <pecoraro@apple.com>
    212
  • trunk/Source/PlatformEfl.cmake

    r182315 r205415  
    11add_subdirectory(${WEBCORE_DIR}/platform/efl/DefaultTheme)
    22
    3 # DerivedSources/JavaScriptCore/inspector/InspectorBackendCommands.js is
    4 # expected in DerivedSources/WebInspectorUI/UserInterface/Protocol/.
    5 add_custom_command(
    6     OUTPUT ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
    7     DEPENDS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendCommands.js
    8     COMMAND cp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendCommands.js ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
    9 )
    10 
     3# FIXME: This should move to Source/WebInspectorUI/PlatformWin.cmake and use the WebInspectorUI_RESOURCES list.
    114add_custom_target(
    125    web-inspector-resources ALL
    136    COMMAND ${CMAKE_COMMAND} -E copy_directory ${WEBINSPECTORUI_DIR}/UserInterface ${WEB_INSPECTOR_DIR}
    147    COMMAND ${CMAKE_COMMAND} -E copy ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js ${WEB_INSPECTOR_DIR}/Protocol
     8    COMMAND ${CMAKE_COMMAND} -E copy ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Main.html ${WEB_INSPECTOR_DIR}/UserInterface
     9    COMMAND ${CMAKE_COMMAND} -E copy ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Test.html ${WEB_INSPECTOR_DIR}/UserInterface
    1510    COMMAND ${CMAKE_COMMAND} -E copy ${WEBINSPECTORUI_DIR}/Localizations/en.lproj/localizedStrings.js ${WEB_INSPECTOR_DIR}
    1611    COMMAND ${CMAKE_COMMAND} -E copy ${WEBKIT2_DIR}/UIProcess/InspectorServer/front-end/inspectorPageIndex.html ${WEB_INSPECTOR_DIR}
    17     DEPENDS JavaScriptCore WebCore ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
     12    DEPENDS JavaScriptCore WebCore ${WebInspectorUI_RESOURCES}
    1813    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
    1914)
  • trunk/Source/PlatformWin.cmake

    r191958 r205415  
    1 set(WEBINSPECTORUI_DIR "${CMAKE_SOURCE_DIR}/Source/WebInspectorUI")
    21set(WEB_INSPECTOR_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/WebKit.resources/WebInspectorUI)
    32
     3# FIXME: This should move to Source/WebInspectorUI/PlatformWin.cmake and use the WebInspectorUI_RESOURCES list.
    44add_custom_target(
    55    web-inspector-resources ALL
    66    COMMAND ${CMAKE_COMMAND} -E copy_directory ${WEBINSPECTORUI_DIR}/UserInterface ${WEB_INSPECTOR_DIR}
    7     COMMAND ${CMAKE_COMMAND} -E copy ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendCommands.js ${WEB_INSPECTOR_DIR}/Protocol
     7    COMMAND ${CMAKE_COMMAND} -E copy ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js ${WEB_INSPECTOR_DIR}/Protocol
     8    COMMAND ${CMAKE_COMMAND} -E copy ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Main.html ${WEB_INSPECTOR_DIR}/UserInterface
     9    COMMAND ${CMAKE_COMMAND} -E copy ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Test.html ${WEB_INSPECTOR_DIR}/UserInterface
    810    COMMAND ${CMAKE_COMMAND} -E copy ${WEBINSPECTORUI_DIR}/Localizations/en.lproj/localizedStrings.js ${WEB_INSPECTOR_DIR}
    911    COMMAND ${CMAKE_COMMAND} -E copy ${WEBKIT2_DIR}/UIProcess/InspectorServer/front-end/inspectorPageIndex.html ${WEB_INSPECTOR_DIR}
    10     DEPENDS JavaScriptCore WebCore
     12    DEPENDS JavaScriptCore WebCore generate-inspector-resources
    1113    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
    1214)
  • trunk/Source/WebInspectorUI/ChangeLog

    r205414 r205415  
     12016-09-01  Brian Burg  <bburg@apple.com>
     2
     3        Web Inspector: unify Main.html and Test.html sources and generate different copies with the preprocessor
     4        https://bugs.webkit.org/show_bug.cgi?id=161212
     5        <rdar://problem/28017961>
     6
     7        Reviewed by Joseph Pecoraro.
     8
     9        Add a Derived Sources build phase to WebInspectorUI project. Generate
     10        Test.html and Main.html from a combined Inspector.html.in which has preprocessor
     11        macros to include/exclude files not needed by all main resource versions.
     12
     13        Similarly, start generating these Inspector files in WebInspectorUI/CMakeLists.txt.
     14        Move platform-specific bundling commands into PlatformGTK.cmake.
     15
     16        * CMakeLists.txt: Added.
     17        Set up a list of common frontend resources that specific ports can extend, such as
     18        with their own port-specific image resources. This list is the input to port-specific
     19        packaging/bundling scripts. Eventually, minification and concatenation should happen
     20        independently of the specific port by constructing the list of resources dynamically.
     21
     22        To ensure resources are always generated in WebInspectorUI and accessible from WebKit2,
     23        add a dummy target that is always out of date and depends on generated files, causing
     24        them to be built.
     25
     26        Also create a macro to run the preprocessor over Inspector.html.in using various
     27        preprocessor macro definitions. These are customizable by ports to control the
     28        appearance of ENGINEERING_BUILD, which guards resources not meant for shipping builds.
     29
     30        * Configurations/WebInspectorUIFramework.xcconfig:
     31        We need to use preprocessor.pm from WebCore. On Mac, this is a private header.
     32        Teach xcodebuild how to compute WEBCORE_PRIVATE_HEADERS_DIR. This is copied
     33        from WebKit2's configuration files.
     34
     35        * PlatformGTK.cmake: Added.
     36        Add GTK image resources to the resource list. Generate GResource catalog and embedded
     37        C file into DerivedSources. WebKit2 will copy over this file and compile it.
     38
     39        * Scripts/combine-resources.pl:
     40        (concatenateFiles):
     41        Remove the --strip option as this patch removes the only use of it.
     42
     43        * DerivedSources.make: Added.
     44        Generate Test.html and Main.html from the new combined Inspector.html.in.
     45        The 'preprocess_main_resource' rule was copied from WebCore's DerivedSources.make.
     46
     47        * Scripts/cssmin.py: Removed.
     48        * Scripts/jsmin.py: Removed.
     49        These scripts are copied from JavaScriptCore but nobody uses these copies. Remove them.
     50
     51        * Scripts/copy-user-interface-resources-dryrun.rb: Do some cleanup.
     52        - Stage scripts from SRCROOT into the tmpdir so dryrun doesn't require
     53          a previous build to process WebInspectorUI resources.
     54        - Run DerivedSources.make before copying/processing resources.
     55        - Add some environment variables for new phase and group by script affected.
     56        - Add a comment to clarify what this script is simulating.
     57
     58        * Scripts/copy-user-interface-resources.pl:
     59        - Use Main.html and Test.html from DerivedSources/ instead of SRCROOT.
     60        - Copy over Main.html and Test.html manually if not combining resources.
     61        - Remove the command to strip files from Debug/ for production. This is
     62          now redundant with ENGINEERING_BUILD guards in Inspector.html.in.
     63        - Use jsmin.py from JavaScriptCore instead of the local copy.
     64        - Wrap all multi-argument 'system' invocations so they are readable.
     65
     66        * Scripts/generate-webinspectorui-derived-sources: Added.
     67        Added boilerplate script to run DerivedSources.make for Mac port.
     68
     69        * Scripts/preprocess-main-resource.pl: Added.
     70        Trivially invoke the preprocessor on $0 using the given defines.
     71
     72        * UserInterface/Inspector.html.in: Renamed from Source/WebInspectorUI/UserInterface/Main.html.
     73        * UserInterface/Test.html: Removed.
     74        Combine Test.html and Main.html into Inspector.html.in. Add these guards:
     75        - INCLUDE_TEST_RESOURCES: for resources excluded from Main.html.
     76        - INCLUDE_UI_RESOURCES: for resources excluded from model tests.
     77        - ENGINEERING_BUILD: for resources not to be shipped (Debug/ directory).
     78
     79        * WebInspectorUI.xcodeproj/project.pbxproj:
     80        - Add new aggregate target 'Derived Sources' to project 'WebInspectorUI'.
     81        - Add dependency on 'Derived Sources' to WebInspectorUI.framework.
     82        - Remove unused copies of jsmin.py and cssmin.py.
     83
    1842016-09-03  Devin Rousso  <dcrousso+webkit@gmail.com>
    285
  • trunk/Source/WebInspectorUI/Configurations/WebInspectorUIFramework.xcconfig

    r194821 r205415  
    3131JAVASCRIPTCORE_PRIVATE_HEADERS_engineering = $(BUILT_PRODUCTS_DIR)/JavaScriptCore.framework/PrivateHeaders;
    3232
     33UMBRELLA_FRAMEWORKS_DIR = $(UMBRELLA_FRAMEWORKS_DIR_$(CONFIGURATION));
     34UMBRELLA_FRAMEWORKS_DIR_Debug = $(UMBRELLA_FRAMEWORKS_DIR_engineering);
     35UMBRELLA_FRAMEWORKS_DIR_Release = $(UMBRELLA_FRAMEWORKS_DIR_engineering);
     36UMBRELLA_FRAMEWORKS_DIR_Production[sdk=iphone*] = $(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks;
     37UMBRELLA_FRAMEWORKS_DIR_Production[sdk=macosx*] = $(SDKROOT)$(UMBRELLA_FRAMEWORKS_DIR_Production_macosx_USE_OVERRIDE_FRAMEWORKS_DIR_$(WK_USE_OVERRIDE_FRAMEWORKS_DIR));
     38UMBRELLA_FRAMEWORKS_DIR_Production_macosx_USE_OVERRIDE_FRAMEWORKS_DIR_NO = $(NEXT_ROOT)$(SYSTEM_LIBRARY_DIR)/Frameworks/WebKit.framework/Versions/A/Frameworks;
     39UMBRELLA_FRAMEWORKS_DIR_Production_macosx_USE_OVERRIDE_FRAMEWORKS_DIR_YES = $(WK_OVERRIDE_FRAMEWORKS_DIR);
     40UMBRELLA_FRAMEWORKS_DIR_engineering = $(BUILT_PRODUCTS_DIR);
     41
     42WEBCORE_PRIVATE_HEADERS_DIR = $(UMBRELLA_FRAMEWORKS_DIR)/WebCore.framework/PrivateHeaders;
     43
    3344SKIP_INSTALL[sdk=iphone*] = YES;
  • trunk/Source/WebInspectorUI/Scripts/combine-resources.pl

    r198353 r205415  
    3636our $htmlDirectory;
    3737our $htmlFile;
    38 our $strip;
    3938
    4039GetOptions('output-dir=s' => \$outputDirectory,
     
    4443           'input-dir=s' => \$inputDirectory,
    4544           'input-html-dir=s' => \$htmlDirectory,
    46            'input-html=s' => \$htmlFile,
    47            'strip' => \$strip);
     45           'input-html=s' => \$htmlFile);
    4846
    49 unless (defined $htmlFile and defined $derivedSourcesDirectory and defined $outputDirectory and (defined $strip or defined $outputScriptName or defined $outputStylesheetName)) {
    50     print "Usage: $0 --input-html <path> --derived-sources-dir <path> --output-dir <path> [--output-script-name <name>] [--output-style-name <name>] [--strip]\n";
     47unless (defined $htmlFile and defined $derivedSourcesDirectory and defined $outputDirectory and (defined $outputScriptName or defined $outputStylesheetName)) {
     48    print "Usage: $0 --input-html <path> --derived-sources-dir <path> --output-dir <path> [--output-script-name <name>] [--output-style-name <name>]\n";
    5149    exit;
    5250}
     
    9189    my $replacementExpression = "([\t ]*)" . $tagExpression . "[\t ]*\n+";
    9290
    93     if (defined $strip) {
    94         # Just strip all occurrences of the pattern.
    95         $headContents =~ s/$replacementExpression//gi;
    96     } else {
    97         # Replace the first occurrence with a token so we can inject the concatenated tag in the same place
    98         # as the first file that got consolidated. This makes sure we preserve some order if there are other
    99         # items in the head that we didn't consolidate.
    100         $headContents =~ s/$replacementExpression/$1%CONCATENATED%\n/i;
    101         $headContents =~ s/$replacementExpression//gi;
    102         $headContents =~ s/%CONCATENATED%/$concatenatedTag/;
    103     }
     91    # Replace the first occurrence with a token so we can inject the concatenated tag in the same place
     92    # as the first file that got consolidated. This makes sure we preserve some order if there are other
     93    # items in the head that we didn't consolidate.
     94    $headContents =~ s/$replacementExpression/$1%CONCATENATED%\n/i;
     95    $headContents =~ s/$replacementExpression//gi;
     96    $headContents =~ s/%CONCATENATED%/$concatenatedTag/;
    10497}
    10598
  • trunk/Source/WebInspectorUI/Scripts/copy-user-interface-resources-dryrun.rb

    r199168 r205415  
    3232end
    3333
     34JAVASCRIPTCORE_PATH = File.expand_path File.join(File.dirname(__FILE__), "..", "..", "JavaScriptCore")
     35WEBCORE_PATH = File.expand_path File.join(File.dirname(__FILE__), "..", "..", "WebCore")
    3436WEB_INSPECTOR_PATH = File.expand_path File.join(File.dirname(__FILE__), "..")
     37GENERATE_DERIVED_SOURCES_PATH = File.join WEB_INSPECTOR_PATH, "Scripts", "generate-webinspectorui-derived-sources"
    3538COPY_USER_INTERFACE_RESOURCES_PATH = File.join WEB_INSPECTOR_PATH, "Scripts", "copy-user-interface-resources.pl"
    3639
     40# This script simulates processing user interface resources located in SRCROOT.
     41# It places processed files in the specified output directory. This is most similar
     42# to an isolated OBJROOT since it includes DerivedSources. It doesn't place files
     43# into their DSTROOT locations, such as inside of WebInspectorUI.framework.
    3744$output_directory = File.expand_path ARGV[0]
     45$start_directory = FileUtils.pwd
    3846
    3947Dir.mktmpdir do |tmpdir|
     
    4149  # Create the output directory if needed.
    4250  FileUtils.mkdir_p $output_directory
    43  
     51
    4452  # Create empty derived sources expected to exist.
    4553  FileUtils.touch(File.join(tmpdir, 'InspectorBackendCommands.js'))
    46  
    47   # Setup the environment and run.
    48   ENV["DERIVED_SOURCES_DIR"] = tmpdir
     54
     55  # Stage some scripts expected to be in various framework PrivateHeaders.
    4956  ENV["JAVASCRIPTCORE_PRIVATE_HEADERS_DIR"] = tmpdir
     57  ENV["WEBCORE_PRIVATE_HEADERS_DIR"] = tmpdir
     58  FileUtils.cp(File.join(JAVASCRIPTCORE_PATH, "Scripts", "cssmin.py"), tmpdir)
     59  FileUtils.cp(File.join(JAVASCRIPTCORE_PATH, "Scripts", "jsmin.py"), tmpdir)
     60  FileUtils.cp(File.join(WEBCORE_PATH, "bindings", "scripts", "preprocessor.pm"), tmpdir)
     61
     62  # Setup the environment and generate derived sources.
    5063  ENV["SRCROOT"] = WEB_INSPECTOR_PATH
     64  ENV["BUILT_PRODUCTS_DIR"] = $output_directory
     65  ENV["ACTION"] = "install"
     66  FileUtils.cd $start_directory
     67  system(GENERATE_DERIVED_SOURCES_PATH) or raise "Failed to generate derived sources."
     68
     69  # Setup the environment and combine/process/stage resources.
     70  ENV["DERIVED_SOURCES_DIR"] = File.join($output_directory, "DerivedSources", "WebInspectorUI")
    5171  ENV["TARGET_BUILD_DIR"] = $output_directory
    5272  ENV["UNLOCALIZED_RESOURCES_FOLDER_PATH"] = ""
    5373  ENV["COMBINE_INSPECTOR_RESOURCES"] = "YES"
    5474  ENV["COMBINE_TEST_RESOURCES"] = "YES"
    55   exec COPY_USER_INTERFACE_RESOURCES_PATH
     75  ENV["FORCE_TOOL_INSTALL"] = "NO"
     76  FileUtils.cd $start_directory
     77  system(COPY_USER_INTERFACE_RESOURCES_PATH) or raise "Failed to process user interface resources."
    5678
    5779end
  • trunk/Source/WebInspectorUI/Scripts/copy-user-interface-resources.pl

    r200774 r205415  
    9191my $inspectorLicense = <<'EOF';
    9292/*
    93  * Copyright (C) 2007-2015 Apple Inc. All rights reserved.
     93 * Copyright (C) 2007-2016 Apple Inc. All rights reserved.
    9494 * Copyright (C) 2008 Matt Lilek. All rights reserved.
    9595 * Copyright (C) 2008-2009 Anthony Ricaud <rik@webkit.org>
     
    136136my $derivedSourcesDir = $ENV{'DERIVED_SOURCES_DIR'};
    137137my $scriptsRoot = File::Spec->catdir($ENV{'SRCROOT'}, 'Scripts');
     138my $sharedScriptsRoot = File::Spec->catdir($ENV{'JAVASCRIPTCORE_PRIVATE_HEADERS_DIR'});
    138139my $uiRoot = File::Spec->catdir($ENV{'SRCROOT'}, 'UserInterface');
    139140my $targetResourcePath = File::Spec->catdir($ENV{'TARGET_BUILD_DIR'}, $ENV{'UNLOCALIZED_RESOURCES_FOLDER_PATH'});
     
    162163    # but overwrite Main.html / Main.js with optimized versions.
    163164    ditto($uiRoot, $targetResourcePath);
     165    copy(File::Spec->catfile($derivedSourcesDir, "Main.html"), $targetResourcePath) or die "Copy of Main.html failed: $!";
     166    copy(File::Spec->catfile($derivedSourcesDir, "Test.html"), $targetResourcePath) or die "Copy of Test.html failed: $!";
     167    unlink File::Spec->catfile($targetResourcePath, "Inspector.html.in");
    164168
    165169    # Also force combining test resources for tool installs.
     
    168172
    169173if ($shouldCombineMain) {
    170     # Remove Debug JavaScript and CSS files in Production builds.
    171     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');
    172 
    173174    # Combine the JavaScript and CSS files in Production builds into single files (Main.js and Main.css).
    174175    my $derivedSourcesMainHTML = File::Spec->catfile($derivedSourcesDir, 'Main.html');
    175     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');
     176    system($perl, $combineResourcesCmd,
     177        '--input-html', $derivedSourcesMainHTML,
     178        '--input-html-dir', $uiRoot,
     179        '--derived-sources-dir', $derivedSourcesDir,
     180        '--output-dir', $derivedSourcesDir,
     181        '--output-script-name', 'Main.js',
     182        '--output-style-name', 'Main.css');
    176183
    177184    # Combine the CodeMirror JavaScript and CSS files in Production builds into single files (CodeMirror.js and CodeMirror.css).
    178     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');
     185    system($perl, $combineResourcesCmd,
     186        '--input-dir', 'External/CodeMirror',
     187        '--input-html', $derivedSourcesMainHTML,
     188        '--input-html-dir', $uiRoot,
     189        '--derived-sources-dir', $derivedSourcesDir,
     190        '--output-dir', $derivedSourcesDir,
     191        '--output-script-name', 'CodeMirror.js',
     192        '--output-style-name', 'CodeMirror.css');
    179193
    180194    # Combine the Esprima JavaScript files in Production builds into a single file (Esprima.js).
    181     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');
     195    system($perl, $combineResourcesCmd,
     196        '--input-dir', 'External/Esprima',
     197        '--input-html', $derivedSourcesMainHTML,
     198        '--input-html-dir', $uiRoot,
     199        '--derived-sources-dir', $derivedSourcesDir,
     200        '--output-dir', $derivedSourcesDir,
     201        '--output-script-name', 'Esprima.js');
    182202
    183203    # Combine the ESLint JavaScript files in Production builds into a single file (ESLint.js).
    184     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');
     204    system($perl, $combineResourcesCmd,
     205        '--input-dir', 'External/ESLint',
     206        '--input-html', $derivedSourcesMainHTML,
     207        '--input-html-dir', $uiRoot,
     208        '--derived-sources-dir', $derivedSourcesDir,
     209        '--output-dir', $derivedSourcesDir,
     210        '--output-script-name', 'ESLint.js');
    185211
    186212    # Remove console.assert calls from the Main.js file.
    187213    my $derivedSourcesMainJS = File::Spec->catfile($derivedSourcesDir, 'Main.js');
    188     system($perl, File::Spec->catfile($scriptsRoot, 'remove-console-asserts.pl'), '--input-script', $derivedSourcesMainJS, '--output-script', $derivedSourcesMainJS);
     214    system($perl, File::Spec->catfile($scriptsRoot, 'remove-console-asserts.pl'),
     215        '--input-script', $derivedSourcesMainJS,
     216        '--output-script', $derivedSourcesMainJS);
    189217
    190218    # Fix Image URLs in the Main.css file by removing the "../".
     
    223251
    224252    # Minify the Main.js and Main.css files, with Main.js appending to the license that was exported above.
    225     my $jsMinScript = File::Spec->catfile($scriptsRoot, 'jsmin.py');
    226     my $cssMinScript = File::Spec->catfile($scriptsRoot, 'cssmin.py');
     253    my $jsMinScript = File::Spec->catfile($sharedScriptsRoot, 'jsmin.py');
     254    my $cssMinScript = File::Spec->catfile($sharedScriptsRoot, 'cssmin.py');
    227255    system(qq("$python" "$jsMinScript" < "$derivedSourcesMainJS" >> "$targetMainJS")) and die "Failed to minify $derivedSourcesMainJS: $!";
    228256    system(qq("$python" "$cssMinScript" < "$derivedSourcesMainCSS" >> "$targetMainCSS")) and die "Failed to minify $derivedSourcesMainCSS: $!";
     
    258286
    259287    # Remove console.assert calls from the Worker js files.
    260     system($perl, File::Spec->catfile($scriptsRoot, 'remove-console-asserts.pl'), '--input-directory', $workersDir);
     288    system($perl, File::Spec->catfile($scriptsRoot, 'remove-console-asserts.pl'),
     289        '--input-directory', $workersDir);
    261290
    262291    # Fix import references in Workers directories. This rewrites "../../External/script.js" import paths to their new locations.
    263     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.";
     292    system($perl, File::Spec->catfile($scriptsRoot, 'fix-worker-imports-for-optimized-builds.pl'),
     293        '--input-directory', $workersDir)
     294        and die "Failed to update Worker imports for optimized builds.";
    264295} else {
    265296    # Keep the files separate for engineering builds.
    266297    ditto($uiRoot, $targetResourcePath);
     298    copy(File::Spec->catfile($derivedSourcesDir, 'Main.html'), File::Spec->catfile($targetResourcePath, 'Main.html')) or die "Copy of Main.html failed: $!";
     299    copy(File::Spec->catfile($derivedSourcesDir, 'Test.html'), File::Spec->catfile($targetResourcePath, 'Test.html')) or die "Copy of Test.html failed: $!";;
     300    unlink File::Spec->catfile($targetResourcePath, 'Inspector.html.in');
    267301}
    268302
    269303if ($shouldCombineTest) {
     304    my $derivedSourcesTestHTML = File::Spec->catfile($derivedSourcesDir, 'Test.html');
     305
    270306    # Combine the JavaScript files for testing into a single file (TestCombined.js).
    271     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');
    272 
    273     my $derivedSourcesTestHTML = File::Spec->catfile($derivedSourcesDir, 'Test.html');
    274     my $derivedSourcesTestJS = File::Spec->catfile($derivedSourcesDir, 'TestCombined.js');
     307    system($perl, $combineResourcesCmd,
     308        '--input-html', $derivedSourcesTestHTML,
     309        '--input-html-dir', $uiRoot,
     310        '--derived-sources-dir', $derivedSourcesDir,
     311        '--output-dir', $derivedSourcesDir,
     312        '--output-script-name', 'TestCombined.js',
     313        '--output-style-name', 'TestCombined.css');
     314
     315    my $derivedSourcesTestCombinedJS = File::Spec->catfile($derivedSourcesDir, 'TestCombined.js');
    275316    # Combine the Esprima JavaScript files for testing into a single file (Esprima.js).
    276     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');
     317    system($perl, $combineResourcesCmd,
     318        '--input-dir', 'External/Esprima',
     319        '--input-html', $derivedSourcesTestHTML,
     320        '--input-html-dir', $uiRoot,
     321        '--derived-sources-dir', $derivedSourcesDir,
     322        '--output-dir', $derivedSourcesDir,
     323        '--output-script-name', 'TestEsprima.js');
    277324
    278325    # Export the license into TestCombined.js.
     
    280327    seedFile($targetTestJS, $inspectorLicense);
    281328
     329    # Append TestCombined.js to the license that was exported above.
     330    appendFile($targetTestJS, $derivedSourcesTestCombinedJS);
     331
    282332    # Export the license into Esprima.js.
    283333    my $targetEsprimaJS = File::Spec->catfile($targetResourcePath, 'TestEsprima.js');
    284334    seedFile($targetEsprimaJS, $esprimaLicense);
    285335
    286     # Append TestCombined.js to the license that was exported above.
    287     appendFile($targetTestJS, $derivedSourcesTestJS);
    288 
    289336    # Append Esprima.js to the license that was exported above.
    290337    my $derivedSourcesEsprimaJS = File::Spec->catfile($derivedSourcesDir, 'TestEsprima.js');
     
    292339
    293340    # Copy over Test.html.
    294     copy($derivedSourcesTestHTML, File::Spec->catfile($targetResourcePath, 'Test.html'));
     341    copy($derivedSourcesTestHTML, File::Spec->catfile($targetResourcePath, 'Test.html')) or die "Copy of Test.html failed: $!";
    295342
    296343    # Copy the Legacy directory.
  • trunk/Source/WebInspectorUI/Scripts/generate-webinspectorui-derived-sources

    r205414 r205415  
    1 #!/usr/bin/ruby
     1#!/bin/sh
    22
    3 # Copyright (C) 2015 Apple Inc. All rights reserved.
     3# Copyright (C) 2016 Apple Inc. All rights reserved.
    44#
    55# Redistribution and use in source and binary forms, with or without
     
    2424# THE POSSIBILITY OF SUCH DAMAGE.
    2525
    26 require 'fileutils'
    27 require 'tmpdir'
     26mkdir -p "${BUILT_PRODUCTS_DIR}/DerivedSources/WebInspectorUI"
     27cd "${BUILT_PRODUCTS_DIR}/DerivedSources/WebInspectorUI"
    2828
    29 if ARGV.size != 1 || ARGV[0].include?("-h")
    30   puts "usage: #{File.basename $0} <output-directory>"
    31   exit 1
    32 end
     29export WebInspectorUI="${SRCROOT}"
    3330
    34 WEB_INSPECTOR_PATH = File.expand_path File.join(File.dirname(__FILE__), "..")
    35 COPY_USER_INTERFACE_RESOURCES_PATH = File.join WEB_INSPECTOR_PATH, "Scripts", "copy-user-interface-resources.pl"
     31/bin/ln -sfh "${WEBCORE_PRIVATE_HEADERS_DIR}" WebCorePrivateHeaders
     32export WebCore_SCRIPTS_DIR="WebCorePrivateHeaders"
    3633
    37 $output_directory = File.expand_path ARGV[0]
     34if [ ! $CC ]; then
     35    export CC="`xcrun -find clang`"
     36fi
    3837
    39 Dir.mktmpdir do |tmpdir|
    40 
    41   # Create the output directory if needed.
    42   FileUtils.mkdir_p $output_directory
    43  
    44   # Create empty derived sources expected to exist.
    45   FileUtils.touch(File.join(tmpdir, 'InspectorBackendCommands.js'))
    46  
    47   # Setup the environment and run.
    48   ENV["DERIVED_SOURCES_DIR"] = tmpdir
    49   ENV["JAVASCRIPTCORE_PRIVATE_HEADERS_DIR"] = tmpdir
    50   ENV["SRCROOT"] = WEB_INSPECTOR_PATH
    51   ENV["TARGET_BUILD_DIR"] = $output_directory
    52   ENV["UNLOCALIZED_RESOURCES_FOLDER_PATH"] = ""
    53   ENV["COMBINE_INSPECTOR_RESOURCES"] = "YES"
    54   ENV["COMBINE_TEST_RESOURCES"] = "YES"
    55   exec COPY_USER_INTERFACE_RESOURCES_PATH
    56 
    57 end
     38if [ "${ACTION}" = "build" -o "${ACTION}" = "install" -o "${ACTION}" = "installhdrs" ]; then
     39    make --no-builtin-rules -f "${WebInspectorUI}/DerivedSources.make" -j `/usr/sbin/sysctl -n hw.activecpu`
     40fi
  • trunk/Source/WebInspectorUI/UserInterface/Inspector.html.in

    r205414 r205415  
    11<!--
    2  * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
     2 * Copyright (C) 2013, 2014, 2016 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    1111 *    documentation and/or other materials provided with the distribution.
    1212 *
    13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
     13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS "AS IS"
    1414 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    1515 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     
    2727<head>
    2828    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
     29#if !INCLUDE_TEST_RESOURCES
    2930    <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'">
    30 
     31#endif
     32
     33#if INCLUDE_UI_RESOURCES
    3134    <link rel="stylesheet" href="External/CodeMirror/codemirror.css">
    3235
     
    199202    <link rel="stylesheet" href="Controllers/CodeMirrorDragToAdjustNumberController.css">
    200203    <link rel="stylesheet" href="Controllers/CodeMirrorTokenTrackingController.css">
    201 
     204#endif // INCLUDE_UI_RESOURCES
     205
     206#if ENGINEERING_BUILD && !INCLUDE_TEST_RESOURCES
    202207    <link rel="stylesheet" href="Debug/UncaughtExceptionReporter.css">
    203 
    204208    <script src="Debug/UncaughtExceptionReporter.js"></script>
     209#endif
    205210
    206211    <script src="External/CodeMirror/codemirror.js"></script>
    207212
     213    <script src="External/CodeMirror/css.js"></script>
     214    <script src="External/CodeMirror/htmlmixed.js"></script>
     215    <script src="External/CodeMirror/javascript.js"></script>
     216
     217#if INCLUDE_UI_RESOURCES
    208218    <script src="External/CodeMirror/clojure.js"></script>
    209219    <script src="External/CodeMirror/closebrackets.js"></script>
    210220    <script src="External/CodeMirror/coffeescript.js"></script>
    211221    <script src="External/CodeMirror/comment.js"></script>
    212     <script src="External/CodeMirror/css.js"></script>
    213     <script src="External/CodeMirror/htmlmixed.js"></script>
    214     <script src="External/CodeMirror/javascript.js"></script>
    215222    <script src="External/CodeMirror/livescript.js"></script>
    216223    <script src="External/CodeMirror/matchbrackets.js"></script>
     
    223230    <script src="External/CodeMirror/sublime.js"></script>
    224231    <script src="External/CodeMirror/xml.js"></script>
     232#endif
    225233
    226234    <script src="External/Esprima/esprima.js"></script>
     
    232240    <script src="Base/ListMultimap.js"></script>
    233241    <script src="Base/Object.js"></script>
     242
     243#if INCLUDE_TEST_RESOURCES
     244    <script src="Test/TestHarness.js"></script>
     245    <script src="Test/FrontendTestHarness.js"></script>
     246    <script src="Test/TestSuite.js"></script>
     247    <script src="Test/Test.js"></script>
     248#else
     249    <script src="Base/Main.js"></script>
     250#endif
    234251
    235252    <script src="Base/DOMUtilities.js"></script>
     
    349366    <script src="Models/PropertyDescriptor.js"></script>
    350367    <script src="Models/PropertyPath.js"></script>
    351     <script src="Models/PropertyPreview.js"></script>   
     368    <script src="Models/PropertyPreview.js"></script>
    352369    <script src="Models/RenderingFrameTimelineRecord.js"></script>
    353370    <script src="Models/ReplayDashboard.js"></script>
     
    390407    <script src="Proxies/HeapSnapshotWorkerProxy.js"></script>
    391408
     409    <script src="Views/CodeMirrorAdditions.js"></script>
     410    <script src="Views/CodeMirrorFormatters.js"></script>
     411
     412#if INCLUDE_UI_RESOURCES
    392413    <script src="Views/View.js"></script>
    393414
     
    475496    <script src="Views/CircleChart.js"></script>
    476497    <script src="Views/ClusterContentView.js"></script>
    477     <script src="Views/CodeMirrorAdditions.js"></script>
    478498    <script src="Views/CodeMirrorEditor.js"></script>
    479     <script src="Views/CodeMirrorFormatters.js"></script>
    480499    <script src="Views/CodeMirrorTextMarkers.js"></script>
    481500    <script src="Views/ColorPicker.js"></script>
     
    672691    <script src="Views/VisualStyleURLInput.js"></script>
    673692    <script src="Views/VisualStyleUnitSlider.js"></script>
    674 
     693#endif // INCLUDE_UI_RESOURCES
     694
     695    <script src="Controllers/Formatter.js"></script>
     696    <script src="Controllers/FormatterSourceMap.js"></script>
     697    <script src="Controllers/ResourceQueryController.js"></script>
     698
     699    <script src="Controllers/AnalyzerManager.js"></script>
     700    <script src="Controllers/ApplicationCacheManager.js"></script>
     701    <script src="Controllers/BranchManager.js"></script>
     702    <script src="Controllers/CSSStyleManager.js"></script>
     703    <script src="Controllers/CSSStyleManager.js"></script>
     704    <script src="Controllers/DashboardManager.js"></script>
     705    <script src="Controllers/DebuggerManager.js"></script>
     706    <script src="Controllers/DOMTreeManager.js"></script>
     707    <script src="Controllers/FrameResourceManager.js"></script>
     708    <script src="Controllers/HeapManager.js"></script>
     709    <script src="Controllers/IssueManager.js"></script>
     710    <script src="Controllers/LayerTreeManager.js"></script>
     711    <script src="Controllers/LogManager.js"></script>
     712    <script src="Controllers/MemoryManager.js"></script>
     713    <script src="Controllers/ProbeManager.js"></script>
     714    <script src="Controllers/ReplayManager.js"></script>
     715    <script src="Controllers/RuntimeManager.js"></script>
     716    <script src="Controllers/SourceMapManager.js"></script>
     717    <script src="Controllers/StorageManager.js"></script>
     718    <script src="Controllers/TimelineManager.js"></script>
     719
     720#if INCLUDE_UI_RESOURCES
    675721    <script src="Controllers/Annotator.js"></script>
    676722    <script src="Controllers/CodeMirrorEditingController.js"></script>
    677723
    678     <script src="Controllers/AnalyzerManager.js"></script>
    679     <script src="Controllers/ApplicationCacheManager.js"></script>
    680724    <script src="Controllers/BasicBlockAnnotator.js"></script>
    681     <script src="Controllers/BranchManager.js"></script>
    682725    <script src="Controllers/BreakpointPopoverController.js"></script>
    683     <script src="Controllers/CSSStyleManager.js"></script>
    684726    <script src="Controllers/CodeMirrorColorEditingController.js"></script>
    685727    <script src="Controllers/CodeMirrorCompletionController.js"></script>
     
    690732    <script src="Controllers/CodeMirrorTokenTrackingController.js"></script>
    691733    <script src="Controllers/CodeMirrorTextKillController.js"></script>
    692     <script src="Controllers/DOMTreeManager.js"></script>
    693     <script src="Controllers/DashboardManager.js"></script>
    694     <script src="Controllers/DebuggerManager.js"></script>
    695734    <script src="Controllers/DragToAdjustController.js"></script>
    696     <script src="Controllers/Formatter.js"></script>
    697     <script src="Controllers/FormatterSourceMap.js"></script>
    698     <script src="Controllers/FrameResourceManager.js"></script>
    699     <script src="Controllers/HeapManager.js"></script>
    700     <script src="Controllers/IssueManager.js"></script>
    701735    <script src="Controllers/JavaScriptLogViewController.js"></script>
    702736    <script src="Controllers/JavaScriptRuntimeCompletionProvider.js"></script>
    703     <script src="Controllers/LayerTreeManager.js"></script>
    704     <script src="Controllers/LogManager.js"></script>
    705     <script src="Controllers/MemoryManager.js"></script>
    706     <script src="Controllers/ProbeManager.js"></script>
    707     <script src="Controllers/ReplayManager.js"></script>
    708     <script src="Controllers/ResourceQueryController.js"></script>
    709     <script src="Controllers/RuntimeManager.js"></script>
    710     <script src="Controllers/SourceMapManager.js"></script>
    711     <script src="Controllers/StorageManager.js"></script>
    712     <script src="Controllers/TimelineManager.js"></script>
    713737    <script src="Controllers/TypeTokenAnnotator.js"></script>
    714738    <script src="Controllers/VisualStyleCompletionsController.js"></script>
     739#endif
    715740
    716741    <script src="Workers/Formatter/FormatterContentBuilder.js"></script>
    717742
    718     <script src="Base/Main.js"></script>
    719 
     743#if ENGINEERING_BUILD
    720744    <script src="Debug/Bootstrap.js"></script>
    721745    <script src="Debug/CapturingProtocolTracer.js"></script>
    722746    <script src="Debug/ProtocolTrace.js"></script>
     747#endif
    723748
    724749    <script>
    725750        WebInspector.loaded();
     751
     752#if INCLUDE_TEST_RESOURCES
     753        // Debug logging is synchronous on the test page.
     754        InspectorTest.forceDebugLogging = false;
     755
     756        // Tee all TestHarness commands to stderr from within the Inspector.
     757        InspectorTest.dumpActivityToSystemConsole = false;
     758
     759        // Best used in combination with dumpActivityToSystemConsole.
     760        InspectorBackend.dumpInspectorProtocolMessages = false;
     761#endif
    726762    </script>
    727763</head>
  • trunk/Source/WebInspectorUI/WebInspectorUI.xcodeproj/project.pbxproj

    r205089 r205415  
    77        objects = {
    88
     9/* Begin PBXAggregateTarget section */
     10                99E9A7F21D70BAD300C247A6 /* Derived Sources */ = {
     11                        isa = PBXAggregateTarget;
     12                        buildConfigurationList = 99E9A7F31D70BAD300C247A6 /* Build configuration list for PBXAggregateTarget "Derived Sources" */;
     13                        buildPhases = (
     14                                99E9A7F91D70BAF600C247A6 /* Generate Derived Sources */,
     15                        );
     16                        dependencies = (
     17                        );
     18                        name = "Derived Sources";
     19                        productName = "Derived Sources";
     20                };
     21/* End PBXAggregateTarget section */
     22
    923/* Begin PBXBuildFile section */
    1024                1C60FF1614E6E3F7006CD77D /* localizedStrings.js in Resources */ = {isa = PBXBuildFile; fileRef = 1C60FF1314E6E35D006CD77D /* localizedStrings.js */; };
     
    1226/* End PBXBuildFile section */
    1327
     28/* Begin PBXContainerItemProxy section */
     29                99E9A7F71D70BADD00C247A6 /* PBXContainerItemProxy */ = {
     30                        isa = PBXContainerItemProxy;
     31                        containerPortal = A54C224D148B23DE00373FA3 /* Project object */;
     32                        proxyType = 1;
     33                        remoteGlobalIDString = 99E9A7F21D70BAD300C247A6;
     34                        remoteInfo = "Derived Sources";
     35                };
     36/* End PBXContainerItemProxy section */
     37
    1438/* Begin PBXFileReference section */
    15                 1C435CAC14E7B287004E10EA /* cssmin.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; path = cssmin.py; sourceTree = "<group>"; };
    16                 1C435CAD14E7B287004E10EA /* jsmin.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; path = jsmin.py; sourceTree = "<group>"; };
    1739                1C60FE2F14E5F3CD006CD77D /* Base.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = "<group>"; };
    1840                1C60FE3114E5F3CD006CD77D /* DebugRelease.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = DebugRelease.xcconfig; sourceTree = "<group>"; };
     
    5577                                1C60FF1914E73C64006CD77D /* combine-resources.pl */,
    5678                                1C60FFE114E79B0F006CD77D /* copy-user-interface-resources.pl */,
    57                                 1C435CAC14E7B287004E10EA /* cssmin.py */,
    58                                 1C435CAD14E7B287004E10EA /* jsmin.py */,
    5979                                1C60FF1A14E73DCA006CD77D /* remove-console-asserts.pl */,
    6080                        );
     
    96116                        );
    97117                        dependencies = (
     118                                99E9A7F81D70BADD00C247A6 /* PBXTargetDependency */,
    98119                        );
    99120                        name = WebInspectorUI;
     
    111132                                LastUpgradeCheck = 0700;
    112133                                ORGANIZATIONNAME = Apple;
     134                                TargetAttributes = {
     135                                        99E9A7F21D70BAD300C247A6 = {
     136                                                CreatedOnToolsVersion = 8.0;
     137                                                ProvisioningStyle = Automatic;
     138                                        };
     139                                };
    113140                        };
    114141                        buildConfigurationList = A54C2250148B23DE00373FA3 /* Build configuration list for PBXProject "WebInspectorUI" */;
     
    125152                        targets = (
    126153                                A54C2256148B23DF00373FA3 /* WebInspectorUI */,
     154                                99E9A7F21D70BAD300C247A6 /* Derived Sources */,
    127155                        );
    128156                };
     
    147175                        runOnlyForDeploymentPostprocessing = 0;
    148176                        shellPath = /bin/sh;
    149                         shellScript = "/usr/bin/perl \"${SRCROOT}/Scripts/copy-user-interface-resources.pl\"";
     177                        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\"";
     178                };
     179                99E9A7F91D70BAF600C247A6 /* Generate Derived Sources */ = {
     180                        isa = PBXShellScriptBuildPhase;
     181                        buildActionMask = 2147483647;
     182                        files = (
     183                        );
     184                        inputPaths = (
     185                        );
     186                        name = "Generate Derived Sources";
     187                        outputPaths = (
     188                        );
     189                        runOnlyForDeploymentPostprocessing = 0;
     190                        shellPath = /bin/sh;
     191                        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";
    150192                };
    151193/* End PBXShellScriptBuildPhase section */
     
    162204/* End PBXSourcesBuildPhase section */
    163205
     206/* Begin PBXTargetDependency section */
     207                99E9A7F81D70BADD00C247A6 /* PBXTargetDependency */ = {
     208                        isa = PBXTargetDependency;
     209                        target = 99E9A7F21D70BAD300C247A6 /* Derived Sources */;
     210                        targetProxy = 99E9A7F71D70BADD00C247A6 /* PBXContainerItemProxy */;
     211                };
     212/* End PBXTargetDependency section */
     213
    164214/* Begin PBXVariantGroup section */
    165215                1C60FF1314E6E35D006CD77D /* localizedStrings.js */ = {
     
    189239                        name = Production;
    190240                };
     241                99E9A7F41D70BAD300C247A6 /* Debug */ = {
     242                        isa = XCBuildConfiguration;
     243                        baseConfigurationReference = 1C60FE3314E5F3CD006CD77D /* WebInspectorUIFramework.xcconfig */;
     244                        buildSettings = {
     245                                PRODUCT_NAME = "$(TARGET_NAME)";
     246                        };
     247                        name = Debug;
     248                };
     249                99E9A7F51D70BAD300C247A6 /* Release */ = {
     250                        isa = XCBuildConfiguration;
     251                        baseConfigurationReference = 1C60FE3314E5F3CD006CD77D /* WebInspectorUIFramework.xcconfig */;
     252                        buildSettings = {
     253                                PRODUCT_NAME = "$(TARGET_NAME)";
     254                        };
     255                        name = Release;
     256                };
     257                99E9A7F61D70BAD300C247A6 /* Production */ = {
     258                        isa = XCBuildConfiguration;
     259                        baseConfigurationReference = 1C60FE3314E5F3CD006CD77D /* WebInspectorUIFramework.xcconfig */;
     260                        buildSettings = {
     261                                PRODUCT_NAME = "$(TARGET_NAME)";
     262                        };
     263                        name = Production;
     264                };
    191265                A54C226A148B23DF00373FA3 /* Debug */ = {
    192266                        isa = XCBuildConfiguration;
     
    222296
    223297/* Begin XCConfigurationList section */
     298                99E9A7F31D70BAD300C247A6 /* Build configuration list for PBXAggregateTarget "Derived Sources" */ = {
     299                        isa = XCConfigurationList;
     300                        buildConfigurations = (
     301                                99E9A7F41D70BAD300C247A6 /* Debug */,
     302                                99E9A7F51D70BAD300C247A6 /* Release */,
     303                                99E9A7F61D70BAD300C247A6 /* Production */,
     304                        );
     305                        defaultConfigurationIsVisible = 0;
     306                        defaultConfigurationName = Production;
     307                };
    224308                A54C2250148B23DE00373FA3 /* Build configuration list for PBXProject "WebInspectorUI" */ = {
    225309                        isa = XCConfigurationList;
  • trunk/Source/WebKit2/ChangeLog

    r205412 r205415  
     12016-09-01  Brian Burg  <bburg@apple.com>
     2
     3        Web Inspector: unify Main.html and Test.html sources and generate different copies with the preprocessor
     4        https://bugs.webkit.org/show_bug.cgi?id=161212
     5        <rdar://problem/28017961>
     6
     7        Reviewed by Joseph Pecoraro.
     8
     9        Rearrange CMake rules so that most Inspector UI work is done in WebInspectorUI.
     10
     11        * PlatformGTK.cmake:
     12        - Move the list of Inspector resources into WebInspectorUI/CMakeLists.txt.
     13        - Move generation of InspectorGResourceBundle into WebInspectorUI.
     14        - Copy over InspectorGResourceBundle.c into WebKit2's Derived Sources before compiling.
     15
    1162016-09-03  Wenson Hsieh  <wenson_hsieh@apple.com>
    217
  • trunk/Source/WebKit2/PlatformGTK.cmake

    r205294 r205415  
    553553
    554554list(APPEND WebKit2_DERIVED_SOURCES
    555     ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.c
    556555    ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2InspectorGResourceBundle.c
    557556    ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2ResourcesGResourceBundle.c
     
    964963)
    965964
    966 set(InspectorFiles
    967     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/*.html
    968     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Base/*.js
    969     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Controllers/*.css
    970     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Controllers/*.js
    971     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Debug/*.css
    972     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Debug/*.js
    973     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/CodeMirror/*.css
    974     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/CodeMirror/*.js
    975     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/ESLint/*.js
    976     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/Esprima/*.js
    977     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Models/*.js
    978     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Protocol/*.js
    979     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Proxies/*.js
    980     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Test/*.js
    981     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Views/*.css
    982     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Views/*.js
    983     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Workers/Formatter/*.js
    984     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Workers/HeapSnapshot/*.js
    985     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Images/gtk/*.png
    986     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Images/gtk/*.svg
    987     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
    988 )
    989 
    990 file(GLOB InspectorFilesDependencies
    991     ${InspectorFiles}
    992 )
    993 
    994 # DerivedSources/JavaScriptCore/inspector/InspectorBackendCommands.js is
    995 # expected in DerivedSources/WebInspectorUI/UserInterface/Protocol/.
    996 add_custom_command(
    997     OUTPUT ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
    998     DEPENDS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendCommands.js
    999     COMMAND cp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendCommands.js ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
    1000 )
    1001 
    1002965# This is necessary because of a conflict between the GTK+ API WebKitVersion.h and one generated by WebCore.
    1003966list(INSERT WebKit2_INCLUDE_DIRECTORIES 0
     
    11471110
    11481111add_custom_command(
    1149     OUTPUT ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.xml
    1150     DEPENDS ${InspectorFilesDependencies}
    1151             ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
    1152             ${TOOLS_DIR}/gtk/generate-inspector-gresource-manifest.py
    1153     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
    1154     VERBATIM
    1155 )
    1156 
    1157 add_custom_command(
    1158     OUTPUT ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.c
    1159     DEPENDS ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.xml
    1160     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
    1161     VERBATIM
    1162 )
    1163 
    1164 add_custom_command(
    11651112    OUTPUT ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2InspectorGResourceBundle.c
    11661113    DEPENDS ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKit2InspectorGResourceBundle.xml
     
    11891136    )
    11901137endif ()
     1138
     1139add_custom_command(
     1140    OUTPUT ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.c
     1141    DEPENDS ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/InspectorGResourceBundle.c
     1142    COMMAND cp ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/InspectorGResourceBundle.c ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectrGResourceBundle.c
     1143)
     1144list(APPEND WebKit2_DERIVED_SOURCES
     1145    ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.c
     1146)
    11911147
    11921148file(WRITE ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2ResourcesGResourceBundle.xml
  • trunk/Source/cmake/WebKitFS.cmake

    r198132 r205415  
    1010if (NOT WEBCORE_DIR)
    1111    set(WEBCORE_DIR "${CMAKE_SOURCE_DIR}/Source/WebCore")
     12endif ()
     13if (NOT WEBINSPECTORUI_DIR)
     14    set(WEBINSPECTORUI_DIR "${CMAKE_SOURCE_DIR}/Source/WebInspectorUI")
    1215endif ()
    1316if (NOT WEBKIT_DIR)
     
    3336
    3437file(MAKE_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR})
     38file(MAKE_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector)
    3539file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Source/JavaScriptCore/runtime)
    3640
  • trunk/Source/cmake/WebKitMacros.cmake

    r204142 r205415  
    374374
    375375endmacro()
     376
     377# Converts a CMake list to a string containing elements separated by spaces.
     378macro(TO_LIST_WITH_SPACES _in_list _out_string)
     379    set(${_out_string} "")
     380    foreach (_item ${_in_list})
     381        set(${_out_string} "${${_out_string}} ${_item}")
     382    endforeach ()
     383    string(STRIP "${${_out_string}}" ${_out_string})
     384endmacro()
Note: See TracChangeset for help on using the changeset viewer.