Web Inspector: Test Resources should not be included in Production builds unless...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 9 Jan 2016 06:32:23 +0000 (06:32 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 9 Jan 2016 06:32:23 +0000 (06:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=152941
<rdar://problem/24119013>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-01-08
Reviewed by Dan Bernstein.

* Configurations/Base.xcconfig:
Combine inspector resources in production, but not test resources.

* Configurations/DebugRelease.xcconfig:
Do not combine inspector resources in Release/Debug. Combine test resources.

* Configurations/WebInspectorUIFramework.xcconfig:
Simplify by moving to other config files.

* Scripts/copy-user-interface-resources.pl:
Have FORCE_TOOL_INSTALL combine test resources as well.

* WebInspectorUI.vcxproj/build-webinspectorui.pl:
Only combine test resources in non-Production.

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

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/Configurations/Base.xcconfig
Source/WebInspectorUI/Configurations/DebugRelease.xcconfig
Source/WebInspectorUI/Configurations/WebInspectorUIFramework.xcconfig
Source/WebInspectorUI/Scripts/copy-user-interface-resources.pl
Source/WebInspectorUI/WebInspectorUI.vcxproj/build-webinspectorui.pl

index c8291a8..24ace60 100644 (file)
@@ -1,5 +1,28 @@
 2016-01-08  Joseph Pecoraro  <pecoraro@apple.com>
 
+        Web Inspector: Test Resources should not be included in Production builds unless FORCE_TOOL_INSTALL
+        https://bugs.webkit.org/show_bug.cgi?id=152941
+        <rdar://problem/24119013>
+
+        Reviewed by Dan Bernstein.
+
+        * Configurations/Base.xcconfig:
+        Combine inspector resources in production, but not test resources.
+
+        * Configurations/DebugRelease.xcconfig:
+        Do not combine inspector resources in Release/Debug. Combine test resources.
+
+        * Configurations/WebInspectorUIFramework.xcconfig:
+        Simplify by moving to other config files.
+
+        * Scripts/copy-user-interface-resources.pl:
+        Have FORCE_TOOL_INSTALL combine test resources as well.
+
+        * WebInspectorUI.vcxproj/build-webinspectorui.pl:
+        Only combine test resources in non-Production.
+
+2016-01-08  Joseph Pecoraro  <pecoraro@apple.com>
+
         Web Inspector: Initiated section of Resource Details Sidebar should not display as empty and should update as the list changes
         https://bugs.webkit.org/show_bug.cgi?id=152907
         <rdar://problem/24109927>
index 536ac70..3ad2435 100644 (file)
@@ -66,3 +66,6 @@ OTHER_LDFLAGS_VERSIONED_FRAMEWORK_PATH = -Wl,-dyld_env -Wl,DYLD_VERSIONED_FRAMEW
 OTHER_CFLAGS = $(ASAN_OTHER_CFLAGS);
 OTHER_CPLUSPLUSFLAGS = $(ASAN_OTHER_CPLUSPLUSFLAGS);
 OTHER_LDFLAGS = $(ASAN_OTHER_LDFLAGS);
+
+COMBINE_INSPECTOR_RESOURCES = YES;
+COMBINE_TEST_RESOURCES = NO;
index 6164baa..3ba590f 100644 (file)
@@ -18,3 +18,6 @@ SDKROOT[sdk=iphone*] = $(SDKROOT);
 SDKROOT = $(SDKROOT_$(PLATFORM_NAME)_$(USE_INTERNAL_SDK));
 SDKROOT_macosx_ = macosx;
 SDKROOT_macosx_YES = macosx.internal;
+
+COMBINE_INSPECTOR_RESOURCES = NO;
+COMBINE_TEST_RESOURCES = YES;
index 0a13021..7babcdb 100644 (file)
@@ -32,14 +32,4 @@ JAVASCRIPTCORE_PRIVATE_HEADERS_DIR_Production[sdk=iphone*] = $(SDKROOT)/$(SYSTEM
 JAVASCRIPTCORE_PRIVATE_HEADERS_DIR_Production[sdk=macosx*] = $(SDKROOT)$(PRODUCTION_FRAMEWORKS_DIR)/JavaScriptCore.framework/PrivateHeaders;
 JAVASCRIPTCORE_PRIVATE_HEADERS_engineering = $(BUILT_PRODUCTS_DIR)/JavaScriptCore.framework/PrivateHeaders;
 
-COMBINE_INSPECTOR_RESOURCES = $(COMBINE_INSPECTOR_RESOURCES_$(CONFIGURATION));
-COMBINE_INSPECTOR_RESOURCES_Debug = NO;
-COMBINE_INSPECTOR_RESOURCES_Release = NO;
-COMBINE_INSPECTOR_RESOURCES_Production = YES;
-
-COMBINE_TEST_RESOURCES = $(COMBINE_TEST_RESOURCES_$(CONFIGURATION));
-COMBINE_TEST_RESOURCES_Debug = YES;
-COMBINE_TEST_RESOURCES_Release = YES;
-COMBINE_TEST_RESOURCES_Production = YES;
-
 SKIP_INSTALL[sdk=iphone*] = YES;
index 3d26b1f..1334cf8 100755 (executable)
@@ -137,16 +137,20 @@ 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'}, 'InspectorBackendCommands.js'), File::Spec->catfile($protocolDir, 'InspectorBackendCommands.js')) or die "Copy of InspectorBackendCommands.js failed: $!";
 
-if (defined $ENV{'FORCE_TOOL_INSTALL'} && ($ENV{'FORCE_TOOL_INSTALL'} eq 'YES')) {
+my $forceToolInstall = defined $ENV{'FORCE_TOOL_INSTALL'} && ($ENV{'FORCE_TOOL_INSTALL'} eq 'YES');
+my $shouldCombineMain = defined $ENV{'COMBINE_INSPECTOR_RESOURCES'} && ($ENV{'COMBINE_INSPECTOR_RESOURCES'} eq 'YES');
+my $shouldCombineTest = defined $ENV{'COMBINE_TEST_RESOURCES'} && ($ENV{'COMBINE_TEST_RESOURCES'} eq 'YES');
+my $combineResourcesCmd = File::Spec->catfile($scriptsRoot, 'combine-resources.pl');
+
+if ($forceToolInstall) {
     # Copy all files over individually to ensure we have Test.html / Test.js and files included from Test.html.
     # We may then proceed to include combined & optimized resources which will output mostly to different paths
     # but overwrite Main.html / Main.js with optimized versions.
     ditto($uiRoot, $targetResourcePath);
-}
 
-my $shouldCombineMain = defined $ENV{'COMBINE_INSPECTOR_RESOURCES'} && ($ENV{'COMBINE_INSPECTOR_RESOURCES'} eq 'YES');
-my $shouldCombineTest = defined $ENV{'COMBINE_TEST_RESOURCES'} && ($ENV{'COMBINE_TEST_RESOURCES'} eq 'YES');
-my $combineResourcesCmd = File::Spec->catfile($scriptsRoot, 'combine-resources.pl');
+    # Also force combining test resources for tool installs.
+    $shouldCombineTest = 1;
+}
 
 if ($shouldCombineMain) {
     # Remove Debug JavaScript and CSS files in Production builds.
@@ -239,7 +243,7 @@ if ($shouldCombineMain) {
 }
 
 if ($shouldCombineTest) {
-    # Combine the JavaScript files for testing into a single file (TestCombined.js ).
+    # Combine the JavaScript files for testing into a single file (TestCombined.js).
     system($combineResourcesCmd, '--input-html', File::Spec->catfile($uiRoot, 'Test.html'), '--derived-sources-dir', $derivedSourcesDir, '--output-dir', $derivedSourcesDir, '--output-script-name', 'TestCombined.js', '--output-style-name', 'TestCombined.css');
 
     my $derivedSourcesTestHTML = File::Spec->catfile($derivedSourcesDir, 'Test.html');
index 6a34896..1b421c3 100755 (executable)
@@ -62,10 +62,13 @@ $ENV{'DERIVED_SOURCES_DIR'} = $DERIVED_SOURCES_DIR;
 
 $ENV{'UNLOCALIZED_RESOURCES_FOLDER_PATH'} = 'WebInspectorUI';
 
-$ENV{'COMBINE_TEST_RESOURCES'} = 'YES';
 if (($TARGET_BUILD_DIR =~ /Release/) || ($TARGET_BUILD_DIR =~ /Production/)) {
     $ENV{'COMBINE_INSPECTOR_RESOURCES'} = 'YES';
-} 
+}
+
+if ($TARGET_BUILD_DIR !~ /Production/) {
+    $ENV{'COMBINE_TEST_RESOURCES'} = 'YES';
+}
 
 my $targetResourcePath = File::Spec->catdir($ENV{'TARGET_BUILD_DIR'}, $ENV{'UNLOCALIZED_RESOURCES_FOLDER_PATH'});
 my $protocolDir = File::Spec->catdir($targetResourcePath, 'Protocol');