Changeset 190333 in webkit
- Timestamp:
- Sep 29, 2015 5:21:39 PM (9 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r190328 r190333 1 2015-09-29 Daniel Bates <dabates@apple.com> 2 3 configure-xcode-for-ios-development does not work with Xcode 7 4 https://bugs.webkit.org/show_bug.cgi?id=149640 5 6 Reviewed by Alexey Proskuryakov. 7 8 When Xcode 7 is installed, running configure-xcode-for-ios-development dies with an error 9 because it cannot find the Xcode specification files for iOS simulator and device. These 10 files have moved to a new location in Xcode 7 distribution. Moreover we must add the 11 relevant definitions to the Xcode 7 specification files directly as opposed to creating 12 new specification files with the added definitions (as we did in older versions of Xcode) 13 in order for Xcode 7 to honor these definitions. 14 15 * Scripts/configure-xcode-for-ios-development: Sorted forward declarations. 16 (updateXcodeSpecificationFilesForSDKIfNeeded): Added. 17 (updateXcode7SpecificationFile): Added. 18 (createLegacyXcodeSpecificationFilesForSDKIfNeeded): Formerly named createXcodeSpecificationFilesForSDKIfNeeded. 19 (writeXcodeSpecification): Moved congratulations line to caller so as to write out the 20 appropriate success message. 21 (mergeXcodeSpecificationWithSpecificationAndId): Formerly named createXcodeSpecificationFromSpecificationAndId. 22 (createXcodeSpecificationFilesForSDKIfNeeded): Deleted. 23 (createXcodeSpecificationFromSpecificationAndId): Deleted. 24 1 25 2015-09-29 Brent Fulgham <bfulgham@apple.com> 2 26 -
trunk/Tools/Scripts/configure-xcode-for-ios-development
r178979 r190333 24 24 25 25 # Checks if Xcode supports building a command line tool for the iOS Simulator. 26 # If not, then creates xcspec files in the iOS SimulatorSDK for a command line26 # If not, then updates/creates xcspec files in the iOS SDK for a command line 27 27 # tool product- and package- type using the definitions in the OS X SDK for the 28 28 # same types. … … 31 31 use warnings; 32 32 33 use Cwd qw(realpath); 33 34 use English; 34 35 use File::Basename; … … 41 42 42 43 sub copyMissingHeadersToIPhoneOSSDKIfNeeded(); 43 sub createXcodeSpecificationFilesForSDKIfNeeded($); 44 sub createXcodeSpecificationFromSpecificationAndId($$$); 44 sub createLegacyXcodeSpecificationFilesForSDKIfNeeded($); 45 sub mergeXcodeSpecificationWithSpecificationAndId($$$); 46 sub readXcodeSpecificationById($$); 45 47 sub sdkDirectory($); 46 48 sub sdkPlatformDirectory($); 47 sub readXcodeSpecificationById($$); 49 sub updateXcode7SpecificationFile($); 50 sub updateXcodeSpecificationFilesForSDKIfNeeded($); 48 51 sub xcodeSDKSpecificationsPath($); 49 52 … … 51 54 use constant COMMAND_LINE_PRODUCT_TYPE => "com.apple.product-type.tool"; 52 55 use constant SDK_TO_XCSPEC_NAME_MAP => +{ "iphoneos" => "iPhoneOS", "iphonesimulator" => "iPhone Simulator " }; 56 use constant SDK_TO_PLUGIN_XCSPEC_NAME_MAP => +{ "iphoneos" => "Embedded-Device.xcspec", "iphonesimulator" => "Embedded-Simulator.xcspec" }; 53 57 54 58 # FIXME: We should only require running as root if needed. It's not necessary to run as root if … … 60 64 61 65 for my $sdk (qw(iphoneos iphonesimulator)) { 62 createXcodeSpecificationFilesForSDKIfNeeded($sdk);66 updateXcodeSpecificationFilesForSDKIfNeeded($sdk); 63 67 } 64 68 … … 97 101 } 98 102 99 sub createXcodeSpecificationFilesForSDKIfNeeded($) 103 sub updateXcodeSpecificationFilesForSDKIfNeeded($) 104 { 105 my ($sdkName) = @_; 106 my $xcode7SpecificationFile = realpath(File::Spec->catfile(sdkPlatformDirectory($sdkName), "..", "..", "..", "PlugIns", "IDEiOSSupportCore.ideplugin", "Contents", "Resources", SDK_TO_PLUGIN_XCSPEC_NAME_MAP->{$sdkName})); 107 if (-f $xcode7SpecificationFile) { 108 updateXcode7SpecificationFile($xcode7SpecificationFile); 109 } else { 110 createLegacyXcodeSpecificationFilesForSDKIfNeeded($sdkName); 111 } 112 } 113 114 sub updateXcode7SpecificationFile($) 115 { 116 my ($specificationFile) = @_; 117 118 my $hasPackageTypeForCommandLineTool = !!readXcodeSpecificationById($specificationFile, COMMAND_LINE_PACKAGE_TYPE); 119 my $hasProductTypeForCommandLineTool = !!readXcodeSpecificationById($specificationFile, COMMAND_LINE_PRODUCT_TYPE); 120 if ($hasPackageTypeForCommandLineTool && $hasProductTypeForCommandLineTool) { 121 return; # Xcode knows how to build a command line tool for $sdkName. 122 } 123 124 my $macosxSDKSpecificationsPath = xcodeSDKSpecificationsPath("macosx"); 125 if (!$hasPackageTypeForCommandLineTool) { 126 my $packageTypesForMacOSXPath = File::Spec->catfile($macosxSDKSpecificationsPath, "MacOSX Package Types.xcspec"); 127 mergeXcodeSpecificationWithSpecificationAndId($specificationFile, $packageTypesForMacOSXPath, COMMAND_LINE_PACKAGE_TYPE); 128 } 129 130 if (!$hasProductTypeForCommandLineTool) { 131 my $productTypesForMacOSXPath = File::Spec->catfile($macosxSDKSpecificationsPath, "MacOSX Product Types.xcspec"); 132 mergeXcodeSpecificationWithSpecificationAndId($specificationFile, $productTypesForMacOSXPath, COMMAND_LINE_PRODUCT_TYPE); 133 } 134 print "Successfully updated '$specificationFile'.\n"; 135 } 136 137 sub createLegacyXcodeSpecificationFilesForSDKIfNeeded($) 100 138 { 101 139 my ($sdk) = @_; … … 146 184 my $packageTypesForMacOSXPath = File::Spec->catfile($macosxSDKSpecificationsPath, "MacOSX Package Types.xcspec"); 147 185 my $packageTypesForWebKitDevelopmentPath = File::Spec->catfile($sdkSpecificationsPath, "${fileNamePrefix}PackageTypes For WebKit Development.xcspec"); 148 createXcodeSpecificationFromSpecificationAndId($packageTypesForWebKitDevelopmentPath, $packageTypesForMacOSXPath, COMMAND_LINE_PACKAGE_TYPE); 186 mergeXcodeSpecificationWithSpecificationAndId($packageTypesForWebKitDevelopmentPath, $packageTypesForMacOSXPath, COMMAND_LINE_PACKAGE_TYPE); 187 print "Successfully created '$packageTypesForWebKitDevelopmentPath'.\n"; 149 188 } 150 189 … … 152 191 my $productTypesForMacOSXPath = File::Spec->catfile($macosxSDKSpecificationsPath, "MacOSX Product Types.xcspec"); 153 192 my $productTypesForWebKitDevelopmentPath = File::Spec->catfile($sdkSpecificationsPath, "${fileNamePrefix}ProductTypes For WebKit Development.xcspec"); 154 createXcodeSpecificationFromSpecificationAndId($productTypesForWebKitDevelopmentPath, $productTypesForMacOSXPath, COMMAND_LINE_PRODUCT_TYPE); 193 mergeXcodeSpecificationWithSpecificationAndId($productTypesForWebKitDevelopmentPath, $productTypesForMacOSXPath, COMMAND_LINE_PRODUCT_TYPE); 194 print "Successfully created '$productTypesForWebKitDevelopmentPath'.\n"; 155 195 } 156 196 } … … 178 218 print $tempFileHandle $specification; 179 219 close($tempFileHandle); 180 system("/usr/libexec/PlistBuddy -x -c 'clear array' '$xcodeSpecificationFile' > /dev/null") == 0 or die "PlistBuddy exited with $?: $!"; 220 if (!-f $xcodeSpecificationFile) { 221 system("/usr/libexec/PlistBuddy -x -c 'clear array' '$xcodeSpecificationFile' > /dev/null") == 0 or die "PlistBuddy exited with $?: $!"; 222 } 181 223 system("/usr/libexec/PlistBuddy -x -c 'add 0 dict' '$xcodeSpecificationFile' > /dev/null") == 0 or die "PlistBuddy exited with $?: $!"; 182 224 system("/usr/libexec/PlistBuddy -x -c 'merge $tempFilename 0' '$xcodeSpecificationFile' > /dev/null") == 0 or die "PlistBuddy exited with $?: $!"; … … 234 276 } 235 277 236 sub createXcodeSpecificationFromSpecificationAndId($$$)278 sub mergeXcodeSpecificationWithSpecificationAndId($$$) 237 279 { 238 280 my ($targetXcodeSpecificationFile, $sourceXcodeSpecificationFile, $id) = @_; … … 242 284 } 243 285 writeXcodeSpecification($targetXcodeSpecificationFile, $specification); 244 print "Successfully created '$targetXcodeSpecificationFile'.\n"; 245 } 286 }
Note: See TracChangeset
for help on using the changeset viewer.