Changeset 96448 in webkit
- Timestamp:
- Sep 30, 2011 6:40:31 PM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r96444 r96448 1 2011-09-30 Daniel Bates <dbates@rim.com> 2 3 Cleanup: Extract code to launch a Mac WebKit application into a common function 4 https://bugs.webkit.org/show_bug.cgi?id=68662 5 6 Reviewed by Adam Roben. 7 8 Extracts common code to launch a WebKit application on Mac OS X into a function 9 so that we can remove duplicate code. 10 11 * Scripts/run-webkit-app: Modified to use webkitdirs::runMacWebKitApp(). 12 * Scripts/webkitdirs.pm: Sorted @EXPORT list and added constant USE_OPEN_COMMAND. 13 (runMacWebKitApp): Added. 14 (runSafari): Modified to use webkitdirs::runMacWebKitApp(). 15 (runMiniBrowser): Ditto. 16 (runWebKitTestRunner): Ditto. 17 (runTestWebKitAPI): Ditto. 18 1 19 2011-09-29 David Levin <levin@chromium.org> 2 20 -
trunk/Tools/Scripts/run-webkit-app
r39852 r96448 35 35 36 36 setConfiguration(); 37 my $productDir = productDir();38 37 39 38 die "Did not specify an application to open (e.g. run-webkit-app AppName).\n" unless length($ARGV[0]) > 0; … … 42 41 checkFrameworks(); 43 42 44 # Set up DYLD_FRAMEWORK_PATH to point to the product directory. 45 print "Start $ARGV[0] with DYLD_FRAMEWORK_PATH set to point to built WebKit in $productDir.\n"; 46 $ENV{DYLD_FRAMEWORK_PATH} = $productDir; 47 $ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = "YES"; 48 49 unshift(@ARGV, "-a"); 50 exec "open", @ARGV; 43 my $appPath = shift(@ARGV); 44 exit exitStatus(runMacWebKitApp($appPath, USE_OPEN_COMMAND)); -
trunk/Tools/Scripts/webkitdirs.pm
r96235 r96448 44 44 $VERSION = 1.00; 45 45 @ISA = qw(Exporter); 46 @EXPORT = qw(&chdirWebKit &baseProductDir &productDir &XcodeOptions &XcodeOptionString &XcodeOptionStringNoConfig &passedConfiguration &setConfiguration &safariPath &checkFrameworks ¤tSVNRevision); 46 @EXPORT = qw( 47 &XcodeOptionString 48 &XcodeOptionStringNoConfig 49 &XcodeOptions 50 &baseProductDir 51 &chdirWebKit 52 &checkFrameworks 53 ¤tSVNRevision 54 &passedConfiguration 55 &productDir 56 &runMacWebKitApp 57 &safariPath 58 &setConfiguration 59 USE_OPEN_COMMAND 60 ); 47 61 %EXPORT_TAGS = ( ); 48 62 @EXPORT_OK = (); 49 63 } 64 65 use constant USE_OPEN_COMMAND => 1; # Used in runMacWebKitApp(). 50 66 51 67 our @EXPORT_OK; … … 2001 2017 } 2002 2018 2019 sub runMacWebKitApp($;$) 2020 { 2021 my ($appPath, $useOpenCommand) = @_; 2022 my $productDir = productDir(); 2023 print "Starting @{[basename($appPath)]} with DYLD_FRAMEWORK_PATH set to point to built WebKit in $productDir.\n"; 2024 $ENV{DYLD_FRAMEWORK_PATH} = $productDir; 2025 $ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = "YES"; 2026 if ($useOpenCommand == USE_OPEN_COMMAND) { 2027 return system("open", "-W", "-a", $appPath, "--args", @ARGV); 2028 } 2029 if (architecture()) { 2030 return system "arch", "-" . architecture(), $appPath, @ARGV; 2031 } 2032 return system { $appPath } $appPath, @ARGV; 2033 } 2034 2003 2035 sub runSafari 2004 2036 { … … 2006 2038 2007 2039 if (isAppleMacWebKit()) { 2008 return system "$FindBin::Bin/gdb-safari", argumentsForConfiguration() if $debugger; 2009 2010 my $productDir = productDir(); 2011 print "Starting Safari with DYLD_FRAMEWORK_PATH set to point to built WebKit in $productDir.\n"; 2012 $ENV{DYLD_FRAMEWORK_PATH} = $productDir; 2013 $ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = "YES"; 2014 if (architecture()) { 2015 return system "arch", "-" . architecture(), safariPath(), @ARGV; 2016 } else { 2017 return system safariPath(), @ARGV; 2018 } 2040 if ($debugger) { 2041 return system "$FindBin::Bin/gdb-safari", argumentsForConfiguration(); 2042 } 2043 return runMacWebKitApp(safariPath()); 2019 2044 } 2020 2045 … … 2041 2066 { 2042 2067 if (isAppleMacWebKit()) { 2043 my $productDir = productDir(); 2044 print "Starting MiniBrowser with DYLD_FRAMEWORK_PATH set to point to $productDir.\n"; 2045 $ENV{DYLD_FRAMEWORK_PATH} = $productDir; 2046 $ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = "YES"; 2047 my $miniBrowserPath = "$productDir/MiniBrowser.app/Contents/MacOS/MiniBrowser"; 2048 if (architecture()) { 2049 return system "arch", "-" . architecture(), $miniBrowserPath, @ARGV; 2050 } else { 2051 return system $miniBrowserPath, @ARGV; 2052 } 2068 return runMacWebKitApp(File::Spec->catfile(productDir(), "MiniBrowser.app", "Contents", "MacOS", "MiniBrowser")); 2053 2069 } 2054 2070 … … 2081 2097 { 2082 2098 if (isAppleMacWebKit()) { 2083 my $productDir = productDir(); 2084 print "Starting WebKitTestRunner with DYLD_FRAMEWORK_PATH set to point to $productDir.\n"; 2085 $ENV{DYLD_FRAMEWORK_PATH} = $productDir; 2086 $ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = "YES"; 2087 my $webKitTestRunnerPath = "$productDir/WebKitTestRunner"; 2088 if (architecture()) { 2089 return system "arch", "-" . architecture(), $webKitTestRunnerPath, @ARGV; 2090 } else { 2091 return system $webKitTestRunnerPath, @ARGV; 2092 } 2099 return runMacWebKitApp(File::Spec->catfile(productDir(), "WebKitTestRunner")); 2093 2100 } elsif (isGtk()) { 2094 2101 my $productDir = productDir(); … … 2127 2134 { 2128 2135 if (isAppleMacWebKit()) { 2129 my $productDir = productDir(); 2130 print "Starting TestWebKitAPI with DYLD_FRAMEWORK_PATH set to point to $productDir.\n"; 2131 $ENV{DYLD_FRAMEWORK_PATH} = $productDir; 2132 $ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = "YES"; 2133 my $testWebKitAPIPath = "$productDir/TestWebKitAPI"; 2134 if (architecture()) { 2135 return system "arch", "-" . architecture(), $testWebKitAPIPath, @ARGV; 2136 } else { 2137 return system $testWebKitAPIPath, @ARGV; 2138 } 2136 return runMacWebKitApp(File::Spec->catfile(productDir(), "TestWebKitAPI")); 2139 2137 } 2140 2138
Note: See TracChangeset
for help on using the changeset viewer.