Web Inspector: unify Main.html and Test.html sources and generate different copies...
authorbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 4 Sep 2016 04:34:57 +0000 (04:34 +0000)
committerbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 4 Sep 2016 04:34:57 +0000 (04:34 +0000)
commit89a6ca8f0041f052e7b6923dc98dac04e2ca3f37
tree7585ec01f7219419583843f3a4e7af464e30f56d
parentd3128145c849085b0681c6e8d37869e00be936ea
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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@205415 268f45cc-cd09-0410-ab3c-d52691b4dbfc
25 files changed:
ChangeLog
Source/CMakeLists.txt
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/PlatformEfl.cmake
Source/PlatformWin.cmake
Source/WebInspectorUI/CMakeLists.txt [new file with mode: 0644]
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/Configurations/WebInspectorUIFramework.xcconfig
Source/WebInspectorUI/DerivedSources.make [new file with mode: 0644]
Source/WebInspectorUI/PlatformGTK.cmake [new file with mode: 0644]
Source/WebInspectorUI/Scripts/combine-resources.pl
Source/WebInspectorUI/Scripts/copy-user-interface-resources-dryrun.rb
Source/WebInspectorUI/Scripts/copy-user-interface-resources.pl
Source/WebInspectorUI/Scripts/cssmin.py [deleted file]
Source/WebInspectorUI/Scripts/generate-webinspectorui-derived-sources [new file with mode: 0755]
Source/WebInspectorUI/Scripts/jsmin.py [deleted file]
Source/WebInspectorUI/Scripts/preprocess-main-resource.pl [new file with mode: 0755]
Source/WebInspectorUI/UserInterface/Inspector.html.in [moved from Source/WebInspectorUI/UserInterface/Main.html with 97% similarity]
Source/WebInspectorUI/UserInterface/Test.html [deleted file]
Source/WebInspectorUI/WebInspectorUI.xcodeproj/project.pbxproj
Source/WebKit2/ChangeLog
Source/WebKit2/PlatformGTK.cmake
Source/cmake/WebKitFS.cmake
Source/cmake/WebKitMacros.cmake