Changeset 205692 in webkit


Ignore:
Timestamp:
Sep 8, 2016 9:33:11 PM (8 years ago)
Author:
BJ Burg
Message:

Web Inspector: get rid of extra copies of jsmin.py and cssmin.py
https://bugs.webkit.org/show_bug.cgi?id=161770
<rdar://problem/28216813>

Reviewed by Joseph Pecoraro.

  • Scripts/copy-user-interface-resources-dryrun.rb:
  • Keep track of the original working directory.
  • Stage scripts from PrivateHeaders into the temporary directory.
  • Add a comment to clarify what this script is simulating.
  • Use system instead of exec so we can print an error message.
  • Scripts/copy-user-interface-resources.pl:
  • Use jsmin.py and cssmin.py from JavaScriptCore instead of

WebInspectorUI. There are no differences between the two copies.

  • Scripts/cssmin.py: Removed.
  • Scripts/jsmin.py: Removed.
  • WebInspectorUI.xcodeproj/project.pbxproj:
  • Remove unused copies of jsmin.py and cssmin.py.
Location:
trunk/Source/WebInspectorUI
Files:
2 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r205676 r205692  
     12016-09-08  Brian Burg  <bburg@apple.com>
     2
     3        Web Inspector: get rid of extra copies of jsmin.py and cssmin.py
     4        https://bugs.webkit.org/show_bug.cgi?id=161770
     5        <rdar://problem/28216813>
     6
     7        Reviewed by Joseph Pecoraro.
     8
     9        * Scripts/copy-user-interface-resources-dryrun.rb:
     10        - Keep track of the original working directory.
     11        - Stage scripts from PrivateHeaders into the temporary directory.
     12        - Add a comment to clarify what this script is simulating.
     13        - Use system instead of exec so we can print an error message.
     14
     15        * Scripts/copy-user-interface-resources.pl:
     16        - Use jsmin.py and cssmin.py from JavaScriptCore instead of
     17        WebInspectorUI. There are no differences between the two copies.
     18
     19        * Scripts/cssmin.py: Removed.
     20        * Scripts/jsmin.py: Removed.
     21
     22        * WebInspectorUI.xcodeproj/project.pbxproj:
     23        - Remove unused copies of jsmin.py and cssmin.py.
     24
    1252016-09-08  Matt Baker  <mattbaker@apple.com>
    226
  • trunk/Source/WebInspectorUI/Scripts/copy-user-interface-resources-dryrun.rb

    r205418 r205692  
    3232end
    3333
     34JAVASCRIPTCORE_PATH = File.expand_path File.join(File.dirname(__FILE__), "..", "..", "JavaScriptCore")
    3435WEB_INSPECTOR_PATH = File.expand_path File.join(File.dirname(__FILE__), "..")
    3536COPY_USER_INTERFACE_RESOURCES_PATH = File.join WEB_INSPECTOR_PATH, "Scripts", "copy-user-interface-resources.pl"
    3637
     38# This script simulates processing user interface resources located in SRCROOT.
     39# It places processed files in the specified output directory. This is most similar
     40# to an isolated OBJROOT since it includes DerivedSources. It doesn't place files
     41# into their DSTROOT locations, such as inside of WebInspectorUI.framework.
    3742$output_directory = File.expand_path ARGV[0]
     43$start_directory = FileUtils.pwd
    3844
    3945Dir.mktmpdir do |tmpdir|
     
    4753  # Setup the environment and run.
    4854  ENV["DERIVED_SOURCES_DIR"] = tmpdir
     55  # Stage some scripts expected to be in various framework PrivateHeaders.
    4956  ENV["JAVASCRIPTCORE_PRIVATE_HEADERS_DIR"] = tmpdir
     57  FileUtils.cp(File.join(JAVASCRIPTCORE_PATH, "Scripts", "cssmin.py"), tmpdir)
     58  FileUtils.cp(File.join(JAVASCRIPTCORE_PATH, "Scripts", "jsmin.py"), tmpdir)
    5059  ENV["SRCROOT"] = WEB_INSPECTOR_PATH
    5160  ENV["TARGET_BUILD_DIR"] = $output_directory
     
    5362  ENV["COMBINE_INSPECTOR_RESOURCES"] = "YES"
    5463  ENV["COMBINE_TEST_RESOURCES"] = "YES"
    55   exec COPY_USER_INTERFACE_RESOURCES_PATH
     64  ENV["FORCE_TOOL_INSTALL"] = "NO"
     65  FileUtils.cd $start_directory
     66  system(COPY_USER_INTERFACE_RESOURCES_PATH) or raise "Failed to process user interface resources."
    5667
    5768end
  • trunk/Source/WebInspectorUI/Scripts/copy-user-interface-resources.pl

    r205418 r205692  
    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'});
     
    223224
    224225    # 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');
     226    my $jsMinScript = File::Spec->catfile($sharedScriptsRoot, 'jsmin.py');
     227    my $cssMinScript = File::Spec->catfile($sharedScriptsRoot, 'cssmin.py');
    227228    system(qq("$python" "$jsMinScript" < "$derivedSourcesMainJS" >> "$targetMainJS")) and die "Failed to minify $derivedSourcesMainJS: $!";
    228229    system(qq("$python" "$cssMinScript" < "$derivedSourcesMainCSS" >> "$targetMainCSS")) and die "Failed to minify $derivedSourcesMainCSS: $!";
  • trunk/Source/WebInspectorUI/WebInspectorUI.xcodeproj/project.pbxproj

    r205418 r205692  
    1313
    1414/* 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>"; };
    1715                1C60FE2F14E5F3CD006CD77D /* Base.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = "<group>"; };
    1816                1C60FE3114E5F3CD006CD77D /* DebugRelease.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = DebugRelease.xcconfig; sourceTree = "<group>"; };
     
    5553                                1C60FF1914E73C64006CD77D /* combine-resources.pl */,
    5654                                1C60FFE114E79B0F006CD77D /* copy-user-interface-resources.pl */,
    57                                 1C435CAC14E7B287004E10EA /* cssmin.py */,
    58                                 1C435CAD14E7B287004E10EA /* jsmin.py */,
    5955                                1C60FF1A14E73DCA006CD77D /* remove-console-asserts.pl */,
    6056                        );
Note: See TracChangeset for help on using the changeset viewer.