[Windows] Generate Optimized WebInspectorUI in Release Build
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Apr 2014 21:29:09 +0000 (21:29 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Apr 2014 21:29:09 +0000 (21:29 +0000)
https://bugs.webkit.org/show_bug.cgi?id=120120

Reviewed by Timothy Hatcher.

* Scripts/copy-user-interface-resources.pl: Copied from Scripts/copy-user-interface-resources.sh.
* Scripts/copy-user-interface-resources.sh: Removed.
* Scripts/remove-console-asserts.pl:
* WebInspectorUI.vcxproj/WebInspectorUI.make: Added.
* WebInspectorUI.vcxproj/WebInspectorUI.vcxproj: Switch to Makefile style.
* WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters: Ditto.
* WebInspectorUI.vcxproj/WebInspectorUIPostBuild.cmd: More work should
be done in the new build-webinspectorui.sh file.
* WebInspectorUI.vcxproj/build-webinspectorui.sh: Added.
* WebInspectorUI.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166962 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/Scripts/copy-user-interface-resources.pl [new file with mode: 0755]
Source/WebInspectorUI/Scripts/copy-user-interface-resources.sh [deleted file]
Source/WebInspectorUI/Scripts/remove-console-asserts.pl
Source/WebInspectorUI/WebInspectorUI.vcxproj/WebInspectorUI.make [new file with mode: 0644]
Source/WebInspectorUI/WebInspectorUI.vcxproj/WebInspectorUI.vcxproj
Source/WebInspectorUI/WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters
Source/WebInspectorUI/WebInspectorUI.vcxproj/WebInspectorUIPostBuild.cmd [deleted file]
Source/WebInspectorUI/WebInspectorUI.vcxproj/build-webinspectorui.sh [new file with mode: 0755]
Source/WebInspectorUI/WebInspectorUI.xcodeproj/project.pbxproj

index 27a8097..94a0be0 100644 (file)
@@ -1,3 +1,21 @@
+2014-04-08  Brent Fulgham  <bfulgham@apple.com>
+
+        [Windows] Generate Optimized WebInspectorUI in Release Build
+        https://bugs.webkit.org/show_bug.cgi?id=120120
+
+        Reviewed by Timothy Hatcher.
+
+        * Scripts/copy-user-interface-resources.pl: Copied from Scripts/copy-user-interface-resources.sh.
+        * Scripts/copy-user-interface-resources.sh: Removed.
+        * Scripts/remove-console-asserts.pl:
+        * WebInspectorUI.vcxproj/WebInspectorUI.make: Added.
+        * WebInspectorUI.vcxproj/WebInspectorUI.vcxproj: Switch to Makefile style.
+        * WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters: Ditto.
+        * WebInspectorUI.vcxproj/WebInspectorUIPostBuild.cmd: More work should
+        be done in the new build-webinspectorui.sh file.
+        * WebInspectorUI.vcxproj/build-webinspectorui.sh: Added.
+        * WebInspectorUI.xcodeproj/project.pbxproj:
+
 2014-04-08  Timothy Hatcher  <timothy@apple.com>
 
         Fix corrupt APPLE_IMAGES_LICENSE.rtf after r165676.
diff --git a/Source/WebInspectorUI/Scripts/copy-user-interface-resources.pl b/Source/WebInspectorUI/Scripts/copy-user-interface-resources.pl
new file mode 100755 (executable)
index 0000000..6dafeb1
--- /dev/null
@@ -0,0 +1,163 @@
+#!/usr/bin/perl -w
+
+use File::Copy qw(copy);
+use File::Path qw(make_path);
+use File::Spec;
+
+my $useDirCopy = 0;
+
+# Not all systems (e.g., OS X) include File::Copy::Recursive. Only
+# use it if we have it installed.
+eval "use File::Copy::Recursive";
+unless ($@) {
+    $useDirCopy = 1;
+    File::Copy::Recursive->import();
+}
+
+sub ditto($$)
+{
+    my ($source, $destination) = @_;
+
+    if ($useDirCopy) {
+        File::Copy::Recursive::dircopy($source, $destination) or die "Unable to copy directory $source to $destination: $!";
+    } elsif ($^O eq 'darwin') {
+        system('ditto', $source, $destination);
+    } else {
+        die "Please install the PEP module File::Copy::Recursive";
+    }
+}
+
+sub seedFile($$)
+{
+    my ($targetFile, $seedText) = @_;
+
+    if (open(TARGET_FILE, '>', $targetFile)) {
+        print TARGET_FILE $seedText;
+        close(TARGET_FILE);
+    }
+}
+
+my $LICENSE = <<'EOF';
+/*
+ * Copyright (C) 2007-2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2009-2011 Google Inc. All rights reserved.
+ * Copyright (C) 2009-2010 Joseph Pecoraro. All rights reserved.
+ * Copyright (C) 2008 Matt Lilek. All rights reserved.
+ * Copyright (C) 2008-2009 Anthony Ricaud <rik@webkit.org>
+ * Copyright (C) 2009 280 North Inc. All Rights Reserved.
+ * Copyright (C) 2010 Nikita Vasilyev. All rights reserved.
+ * Copyright (C) 2011 Brian Grinstead All rights reserved.
+ * Copyright (C) 2013 Matt Holden <jftholden@yahoo.com>
+ * Copyright (C) 2013 Samsung Electronics. All rights reserved.
+ * Copyright (C) 2013 Seokju Kwon (seokju.kwon@gmail.com)
+ * Copyright (C) 2013 Adobe Systems Inc. All rights reserved.
+ * Copyright (C) 2013 University of Washington. 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.
+ */
+EOF
+
+my $derivedSourcesDir = $ENV{'DERIVED_SOURCES_DIR'};
+my $scriptsRoot = File::Spec->catdir($ENV{'SRCROOT'}, 'Scripts');
+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');
+my $codeMirrorPath = File::Spec->catdir($uiRoot, 'External', 'CodeMirror');
+
+my $codeMirrorLicenseFile = File::Spec->catfile($codeMirrorPath, 'LICENSE');
+open(CMLFILE, '<', $codeMirrorLicenseFile) or die "Unable to open $codeMirrorLicenseFile: $!";
+my $CODE_MIRROR_LICENSE = "/*\n";
+while (<CMLFILE>) {
+    $CODE_MIRROR_LICENSE .= ' * ' . $_;
+}
+close(CMLFILE);
+$CODE_MIRROR_LICENSE .= " */\n";
+
+make_path($protocolDir, $targetResourcePath);
+
+# Copy over dynamically loaded files from other frameworks, even if we aren't combining resources.
+copy(File::Spec->catfile($ENV{'JAVASCRIPTCORE_PRIVATE_HEADERS_DIR'}, 'InspectorJSBackendCommands.js'), File::Spec->catfile($protocolDir, 'InspectorJSBackendCommands.js')) or die "Copy of InspectorJSBackendCommands.js failed: $!";
+copy(File::Spec->catfile($ENV{'WEBCORE_PRIVATE_HEADERS_DIR'}, 'InspectorWebBackendCommands.js'), File::Spec->catfile($protocolDir, 'InspectorWebBackendCommands.js')) or die "Copy of InspectorWebBackendCommands.js failed: $!";
+
+if (defined $ENV{'COMBINE_INSPECTOR_RESOURCES'} && ($ENV{'COMBINE_INSPECTOR_RESOURCES'} eq 'YES')) {
+    my $combineResourcesCmd = File::Spec->catfile($scriptsRoot, 'combine-resources.pl');
+
+    # Combine the JavaScript and CSS files in Production builds into single files (Main.js and Main.css).
+    system($combineResourcesCmd, '--input-html', File::Spec->catfile($uiRoot, 'Main.html'), '--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).
+    my $derivedSourcesMainHTML = File::Spec->catfile($derivedSourcesDir, 'Main.html');
+    system($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');
+
+    # Remove console.assert calls from the Main.js file.
+    my $derivedSourcesMainJS = File::Spec->catfile($derivedSourcesDir, 'Main.js');
+    system(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');
+    if (open(INPUT_MAIN, '<', $derivedSourcesMainCSS)) {
+        local $/;
+        my $cssContents = <INPUT_MAIN>;
+        close(INPUT_MAIN);
+        open(OUTPUT_MAIN, '>', $derivedSourcesMainCSS);
+        $cssContents =~ s/\.\.\/Images/Images/g;
+        print OUTPUT_MAIN $cssContents;
+        close(OUTPUT_MAIN);
+    }
+
+    # Export the license into Main.js.
+    my $targetMainJS = File::Spec->catfile($targetResourcePath, 'Main.js');
+    seedFile($targetMainJS, $LICENSE);
+
+    my $targetMainCSS = File::Spec->catfile($targetResourcePath, 'Main.css');
+    seedFile($targetMainCSS, $LICENSE);
+
+    # Export the license into CodeMirror.js and CodeMirror.css.
+    my $targetCodeMirrorJS = File::Spec->catfile($targetResourcePath, 'CodeMirror.js');
+    seedFile($targetCodeMirrorJS, $LICENSE);
+
+    my $targetCodeMirrorCSS = File::Spec->catfile($targetResourcePath, 'CodeMirror.css');
+    seedFile($targetCodeMirrorCSS, $LICENSE);
+
+    # 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');
+    system(qq(python "$jsMinScript" < "$derivedSourcesMainJS" >> "$targetMainJS")) and die "Failed to minify $derivedSourcesMainJS: $!";
+    system(qq(python "$cssMinScript" < "$derivedSourcesMainCSS" >> "$targetMainCSS")) and die "Failed to minify $derivedSourcesMainCSS: $!";
+
+    # Minify the CodeMirror.js and CodeMirror.css files, appending to the license that was exported above.
+    my $derivedSouressCodeMirrorJS = File::Spec->catfile($derivedSourcesDir, 'CodeMirror.js');
+    my $derivedSourcesCodeMirrorCSS = File::Spec->catfile($derivedSourcesDir, 'CodeMirror.css');
+    system(qq(python "$jsMinScript" < "$derivedSouressCodeMirrorJS" >> "$targetCodeMirrorJS")) and die "Failed to minify $derivedSouressCodeMirrorJS: $!";
+    system(qq(python "$cssMinScript" < "$derivedSourcesCodeMirrorCSS" >> "$targetCodeMirrorCSS")) and die "Failed to minify $derivedSourcesCodeMirrorCSS: $!";
+
+    # Copy over Main.html and the Images directory.
+    copy($derivedSourcesMainHTML, File::Spec->catfile($targetResourcePath, 'Main.html'));
+
+    ditto(File::Spec->catdir($uiRoot, 'Images'), File::Spec->catdir($targetResourcePath, 'Images'));
+
+    # Copy the Legacy directory.
+    ditto(File::Spec->catfile($uiRoot, 'Protocol', 'Legacy'), File::Spec->catfile($protocolDir, 'Legacy'));
+} else {
+    # Keep the files separate for engineering builds.
+    ditto($uiRoot, $targetResourcePath);
+}
diff --git a/Source/WebInspectorUI/Scripts/copy-user-interface-resources.sh b/Source/WebInspectorUI/Scripts/copy-user-interface-resources.sh
deleted file mode 100755 (executable)
index 22c9b6b..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/bin/sh
-
-LICENSE=$(cat <<EOF
-/*
- * Copyright (C) 2007-2014 Apple Inc. All rights reserved.
- * Copyright (C) 2009-2011 Google Inc. All rights reserved.
- * Copyright (C) 2009-2010 Joseph Pecoraro. All rights reserved.
- * Copyright (C) 2008 Matt Lilek. All rights reserved.
- * Copyright (C) 2008-2009 Anthony Ricaud <rik@webkit.org>
- * Copyright (C) 2009 280 North Inc. All Rights Reserved.
- * Copyright (C) 2010 Nikita Vasilyev. All rights reserved.
- * Copyright (C) 2011 Brian Grinstead All rights reserved.
- * Copyright (C) 2013 Matt Holden <jftholden@yahoo.com>
- * Copyright (C) 2013 Samsung Electronics. All rights reserved.
- * Copyright (C) 2013 Seokju Kwon (seokju.kwon@gmail.com)
- * Copyright (C) 2013 Adobe Systems Inc. All rights reserved.
- * Copyright (C) 2013 University of Washington. 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.
- */
-EOF
-)
-
-CODE_MIRROR_LICENSE=$(echo "/*" && sed 's/^/ * /' "${SRCROOT}/UserInterface/External/CodeMirror/LICENSE" && echo " */")
-
-# Copy over dynamically loaded files from other frameworks, even if we aren't combining resources.
-ditto "${JAVASCRIPTCORE_PRIVATE_HEADERS_DIR}/InspectorJSBackendCommands.js" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Protocol/InspectorJSBackendCommands.js"
-ditto "${WEBCORE_PRIVATE_HEADERS_DIR}/InspectorWebBackendCommands.js" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Protocol/InspectorWebBackendCommands.js"
-
-if [[ ${COMBINE_INSPECTOR_RESOURCES:=YES} == "YES" ]]; then
-    # Combine the JavaScript and CSS files in Production builds into single files (Main.js and Main.css).
-    "${SRCROOT}/Scripts/combine-resources.pl" --input-html "${SRCROOT}/UserInterface/Main.html" --derived-sources-dir "${DERIVED_SOURCES_DIR}" --output-dir "${DERIVED_SOURCES_DIR}" --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).
-    "${SRCROOT}/Scripts/combine-resources.pl" --input-dir "External/CodeMirror" --input-html "${DERIVED_SOURCES_DIR}/Main.html" --input-html-dir "${SRCROOT}/UserInterface" --derived-sources-dir "${DERIVED_SOURCES_DIR}" --output-dir "${DERIVED_SOURCES_DIR}" --output-script-name "CodeMirror.js" --output-style-name "CodeMirror.css"
-
-    # Remove console.assert calls from the Main.js file.
-    "${SRCROOT}/Scripts/remove-console-asserts.pl" --input-script "${DERIVED_SOURCES_DIR}/Main.js" --output-script "${DERIVED_SOURCES_DIR}/Main.js"
-
-    # Fix Image URLs in the Main.css file by removing the "../".
-    sed -i "" -e "s/\.\.\/Images/Images/g" "${DERIVED_SOURCES_DIR}/Main.css"
-
-    # Export the license into Main.js.
-    echo "${LICENSE}" > "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Main.js"
-
-    # Export the license into CodeMirror.js and CodeMirror.css.
-    echo "${CODE_MIRROR_LICENSE}" > "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/CodeMirror.js"
-    echo "${CODE_MIRROR_LICENSE}" > "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/CodeMirror.css"
-
-    # Minify the Main.js and Main.css files, with Main.js appending to the license that was exported above.
-    python "${SRCROOT}/Scripts/jsmin.py" <"${DERIVED_SOURCES_DIR}/Main.js" >>"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Main.js"
-    python "${SRCROOT}/Scripts/cssmin.py" <"${DERIVED_SOURCES_DIR}/Main.css" >"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Main.css"
-
-    # Minify the CodeMirror.js and CodeMirror.css files, appending to the license that was exported above.
-    python "${SRCROOT}/Scripts/jsmin.py" <"${DERIVED_SOURCES_DIR}/CodeMirror.js" >>"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/CodeMirror.js"
-    python "${SRCROOT}/Scripts/cssmin.py" <"${DERIVED_SOURCES_DIR}/CodeMirror.css" >>"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/CodeMirror.css"
-
-    # Copy over Main.html and the Images directory.
-    ditto "${DERIVED_SOURCES_DIR}/Main.html" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Main.html"
-    ditto "${SRCROOT}/UserInterface/Images" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Images"
-
-    # Copy the Legacy directory.
-    ditto "${SRCROOT}/UserInterface/Protocol/Legacy" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Protocol/Legacy"
-else
-    # Keep the files separate for engineering builds.
-    ditto "${SRCROOT}/UserInterface" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
-fi
index b65bac1..19ec1cf 100755 (executable)
@@ -16,7 +16,7 @@ unless (defined $inputScriptFilename and defined $outputScriptFilename) {
     exit;
 }
 
-open IN, $inputScriptFilename or die;
+open IN, $inputScriptFilename or die "Couldn't open $inputScriptFilename: $!";
 our ($out, $tempFilename) = tempfile(UNLINK => 0) or die;
 
 our $previousLine = "";
diff --git a/Source/WebInspectorUI/WebInspectorUI.vcxproj/WebInspectorUI.make b/Source/WebInspectorUI/WebInspectorUI.vcxproj/WebInspectorUI.make
new file mode 100644 (file)
index 0000000..f86f083
--- /dev/null
@@ -0,0 +1,11 @@
+make:\r
+       bash build-webinspectorui.sh "%ConfigurationBuildDir%" "%WebKit_Libraries%" windows "%PlatformArchitecture%"\r
+       if errorlevel 1 exit 1\r
+\r
+       xcopy /y /e "..\Localizations\en.lproj\*" "%ConfigurationBuildDir%\bin%PlatformArchitecture%\WebKit.resources\WebInspectorUI"
+       if errorlevel 1 exit 1\r
+\r
+       if exist "%CONFIGURATIONBUILDDIR%\buildfailed" del "%CONFIGURATIONBUILDDIR%\buildfailed"
+\r
+clean:\r
+       if exist "%ConfigurationBuildDir%\bin%PlatformArchitecture%\WebKit.resources\WebInspectorUI" del /s /q "%ConfigurationBuildDir%\bin%PlatformArchitecture%\WebKit.resources\WebInspectorUI"\r
index 30671b6..3ba1809 100644 (file)
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
+    <ConfigurationType>Makefile</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
     <PlatformToolset>v120_xp</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
+    <ConfigurationType>Makefile</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
     <PlatformToolset>v120_xp</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Production|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
+    <ConfigurationType>Makefile</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
     <PlatformToolset>v120_xp</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
+    <ConfigurationType>Makefile</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>MultiByte</CharacterSet>
     <PlatformToolset>v120_xp</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
+    <ConfigurationType>Makefile</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
     <PlatformToolset>v120_xp</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
+    <ConfigurationType>Makefile</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
     <PlatformToolset>v120</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
+    <ConfigurationType>Makefile</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
     <PlatformToolset>v120</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Production|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
+    <ConfigurationType>Makefile</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
     <PlatformToolset>v120</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
+    <ConfigurationType>Makefile</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>MultiByte</CharacterSet>
     <PlatformToolset>v120_xp</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
+    <ConfigurationType>Makefile</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
     <PlatformToolset>v120_xp</PlatformToolset>
     <Import Project="$(WebKit_Libraries)\tools\vsprops\debug.props" />
   </ImportGroup>
   <PropertyGroup Label="UserMacros" />
-  <PropertyGroup />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Production|Win32'" />
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <WarningLevel>Level3</WarningLevel>
     <None Include="..\Info.plist" />
     <None Include="..\Localizations\en.lproj\localizedStrings.js" />
     <None Include="..\Scripts\combine-resources.pl" />
-    <None Include="..\Scripts\copy-user-interface-resources.sh" />
+    <None Include="..\Scripts\copy-user-interface-resources.pl" />
     <None Include="..\Scripts\cssmin.py" />
     <None Include="..\Scripts\jsmin.py" />
     <None Include="..\Scripts\remove-console-asserts.pl" />
     <None Include="..\UserInterface\TreeOutline.js" />
     <None Include="..\UserInterface\Utilities.js" />
     <None Include="..\UserInterface\WebInspector.js" />
-    <None Include="WebInspectorUIPostBuild.cmd" />
+    <None Include="build-webinspectorui.sh" />
+    <None Include="WebInspectorUI.make" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
+</Project>
\ No newline at end of file
index c87ca0c..46b0285 100644 (file)
     <None Include="..\Scripts\combine-resources.pl">
       <Filter>Scripts</Filter>
     </None>
-    <None Include="..\Scripts\copy-user-interface-resources.sh">
+    <None Include="..\Scripts\copy-user-interface-resources.pl">
       <Filter>Scripts</Filter>
     </None>
     <None Include="..\Scripts\cssmin.py">
     <None Include="..\Scripts\update-pretty-printer.rb">
       <Filter>Scripts</Filter>
     </None>
-    <None Include="WebInspectorUIPostBuild.cmd" />
+    <None Include="WebInspectorUI.make" />
+    <None Include="build-webinspectorui.sh" />
   </ItemGroup>
-</Project>
+</Project>
\ No newline at end of file
diff --git a/Source/WebInspectorUI/WebInspectorUI.vcxproj/WebInspectorUIPostBuild.cmd b/Source/WebInspectorUI/WebInspectorUI.vcxproj/WebInspectorUIPostBuild.cmd
deleted file mode 100644 (file)
index f217f18..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-mkdir 2>NUL "%CONFIGURATIONBUILDDIR%\bin%PlatformArchitecture%\WebKit.resources\WebInspectorUI"
-xcopy /y /e "%PROJECTDIR%..\UserInterface\*" "%CONFIGURATIONBUILDDIR%\bin%PlatformArchitecture%\WebKit.resources\WebInspectorUI"
-xcopy /y /d "%PROJECTDIR%..\Localizations\en.lproj\*" "%CONFIGURATIONBUILDDIR%\bin%PlatformArchitecture%\WebKit.resources\WebInspectorUI"
-mkdir 2>NUL "%CONFIGURATIONBUILDDIR%\bin%PlatformArchitecture%\WebKit.resources\WebInspectorUI\Protocol"
-xcopy /y /d "%CONFIGURATIONBUILDDIR%\obj%PlatformArchitecture%\JavaScriptCore\DerivedSources\InspectorJSBackendCommands.js" "%CONFIGURATIONBUILDDIR%\bin%PlatformArchitecture%\WebKit.resources\WebInspectorUI\Protocol"
-xcopy /y /d "%CONFIGURATIONBUILDDIR%\obj%PlatformArchitecture%\WebCore\DerivedSources\InspectorWebBackendCommands.js" "%CONFIGURATIONBUILDDIR%\bin%PlatformArchitecture%\WebKit.resources\WebInspectorUI\Protocol"
-if exist "%CONFIGURATIONBUILDDIR%\buildfailed" del "%CONFIGURATIONBUILDDIR%\buildfailed"
diff --git a/Source/WebInspectorUI/WebInspectorUI.vcxproj/build-webinspectorui.sh b/Source/WebInspectorUI/WebInspectorUI.vcxproj/build-webinspectorui.sh
new file mode 100755 (executable)
index 0000000..2723387
--- /dev/null
@@ -0,0 +1,48 @@
+#!/usr/bin/bash
+
+# Copyright (C) 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. 
+# 3.  Neither the name of Apple puter, Inc. ("Apple") nor the names of
+#     its contributors may be used to endorse or promote products derived
+#     from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE 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 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.
+
+XSRCROOT="`pwd`/.."
+XSRCROOT=`realpath "$XSRCROOT"`
+export XSRCROOT
+export SRCROOT=$XSRCROOT
+
+XDSTROOT="$1"
+export XDSTROOT
+
+export TARGET_BUILD_DIR="$XDSTROOT/bin${4}/WebKit.resources"
+export JAVASCRIPTCORE_PRIVATE_HEADERS_DIR="$XDSTROOT/obj${4}/JavaScriptCore/DerivedSources"
+export WEBCORE_PRIVATE_HEADERS_DIR="$XDSTROOT/obj${4}/WebCore/DerivedSources"
+export DERIVED_SOURCES_DIR="$XDSTROOT/obj${4}/WebInspectorUI/DerivedSources"
+
+export UNLOCALIZED_RESOURCES_FOLDER_PATH="WebInspectorUI"
+
+if [[ ${TARGET_BUILD_DIR} =~ "Release" ]] || [[ ${TARGET_BUILD_DIR} =~ "Production" ]]; then
+    export COMBINE_INSPECTOR_RESOURCES="YES";
+fi
+
+perl "${SRCROOT}/Scripts/copy-user-interface-resources.pl"
index 4356b38..6773ac7 100644 (file)
@@ -22,7 +22,7 @@
                1C60FF1414E6E35D006CD77D /* en */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = en; path = Localizations/en.lproj/localizedStrings.js; sourceTree = "<group>"; };
                1C60FF1914E73C64006CD77D /* combine-resources.pl */ = {isa = PBXFileReference; lastKnownFileType = text.script.perl; path = "combine-resources.pl"; sourceTree = "<group>"; };
                1C60FF1A14E73DCA006CD77D /* remove-console-asserts.pl */ = {isa = PBXFileReference; lastKnownFileType = text.script.perl; path = "remove-console-asserts.pl"; sourceTree = "<group>"; };
-               1C60FFE114E79B0F006CD77D /* copy-user-interface-resources.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "copy-user-interface-resources.sh"; sourceTree = "<group>"; };
+               1C60FFE114E79B0F006CD77D /* copy-user-interface-resources.pl */ = {isa = PBXFileReference; lastKnownFileType = text.script.perl; path = "copy-user-interface-resources.pl"; sourceTree = "<group>"; };
                1C78EE131760E115002F6AA5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
                1C78EE1617611340002F6AA5 /* WebInspectorUI.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = WebInspectorUI.c; sourceTree = "<group>"; };
                996231EB18D1811700C03FDA /* WebCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -55,7 +55,7 @@
                        isa = PBXGroup;
                        children = (
                                1C60FF1914E73C64006CD77D /* combine-resources.pl */,
-                               1C60FFE114E79B0F006CD77D /* copy-user-interface-resources.sh */,
+                               1C60FFE114E79B0F006CD77D /* copy-user-interface-resources.pl */,
                                1C435CAC14E7B287004E10EA /* cssmin.py */,
                                1C435CAD14E7B287004E10EA /* jsmin.py */,
                                1C60FF1A14E73DCA006CD77D /* remove-console-asserts.pl */,
                        name = "Copy User Interface Resources";
                        runOnlyForDeploymentPostprocessing = 0;
                        shellPath = /bin/sh;
-                       shellScript = "sh \"${SRCROOT}/Scripts/copy-user-interface-resources.sh\"";
+                       shellScript = "/usr/bin/perl \"${SRCROOT}/Scripts/copy-user-interface-resources.pl\"";
                };
 /* End PBXShellScriptBuildPhase section */