Code change by Toby Peterson <toby@opendarwin.org>
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Jun 2005 09:00:52 +0000 (09:00 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Jun 2005 09:00:52 +0000 (09:00 +0000)
        Reviewed by me.

        * Scripts/run-safari: Fix to work with Xcode 2.0 again. The script would
get confused because build-webkit now makes even 2.0 build directories look
like 2.1.

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

WebKitTools/ChangeLog
WebKitTools/Scripts/run-safari

index 0e02734b88f9116784cfb5c41165593764208c4f..78635a068e646432ff86d1abc0e5d6c2e8b920f5 100644 (file)
@@ -1,3 +1,12 @@
+2005-06-08  Maciej Stachowiak  <mjs@apple.com>
+
+       Code change by Toby Peterson <toby@opendarwin.org>
+        Reviewed by me.
+
+        * Scripts/run-safari: Fix to work with Xcode 2.0 again. The script would
+       get confused because build-webkit now makes even 2.0 build directories look
+       like 2.1.
+
 2005-06-07  Darin Adler  <darin@apple.com>
 
         Reviewed by Adele Peterson.
index f3b4294d6d1ce2539eea95e8a122eae94bba3be7..1a83066024a2d274822f6f22e949155631db4ad0 100755 (executable)
@@ -43,28 +43,40 @@ if (!$productDir) {
     die "No product directory set. Please set the 'Place Build Products' preference to 'Customized location' in XCode Building Preferences.\n";
 }
 
-# Try to find Xcode 2.1 build products; prefer Deployment if both are present.
-if (-d "$productDir/Deployment") {
-    $productDir = "$productDir/Deployment";
-} elsif (-d "$productDir/Development") {
-    $productDir = "$productDir/Development";
-}
-
 # Check to see that Safari is there.
 my $safariPath = "/Applications/Safari.app/Contents/MacOS/Safari";
 if (! -x $safariPath) {
     die "Can't find executable at $safariPath.\n";
 }
 
-# Check to see that frameworks are there.
-if (! -x "$productDir/JavaScriptCore.framework/Versions/A/JavaScriptCore") {
-    die "Can't find executable at $productDir/JavaScriptCore.framework/Versions/A/JavaScriptCore; have you built successfully?\n";
-}
-if (! -x "$productDir/WebCore.framework/Versions/A/WebCore") {
-    die "Can't find executable at $productDir/WebCore.framework/Versions/A/WebCore; have you built successfully?\n";
+# Search for build products; first test Xcode 2.0 location, then Xcode 2.1 locations.
+# For Xcode 2.1, prefer Deployment if both directories are present.
+my @testDirs = ( "$productDir", "$productDir/Deployment", "$productDir/Development" );
+my $found = 0;
+for my $testDir (@testDirs) {
+       # Check to see that frameworks are there.
+       print "Looking for frameworks in $testDir ...\n";
+
+       if (! -x "$testDir/JavaScriptCore.framework/Versions/A/JavaScriptCore") {
+               print "Can't find executable at $testDir/JavaScriptCore.framework/Versions/A/JavaScriptCore\n";
+               next;
+       }
+       if (! -x "$testDir/WebCore.framework/Versions/A/WebCore") {
+               print "Can't find executable at $testDir/WebCore.framework/Versions/A/WebCore\n";
+               next;
+       }
+       if (! -x "$testDir/WebKit.framework/Versions/A/WebKit") {
+               print "Can't find executable at $testDir/WebKit.framework/Versions/A/WebKit\n";
+               next;
+       }
+
+       print "Built frameworks found in $testDir\n";
+       $productDir = $testDir;
+       $found = 1;
+       last;
 }
-if (! -x "$productDir/WebKit.framework/Versions/A/WebKit") {
-    die "Can't find executable at $productDir/WebKit.framework/Versions/A/WebKit; have you built successfully?\n";
+if (!$found) {
+       die "Could not locate frameworks.\n";
 }
 
 # Set up DYLD_FRAMEWORK_PATH to point to the product directory.