Permalink
Browse files

doing header diffs on method signatures only; a lot more headers are …

…equivalent now
  • Loading branch information...
1 parent e81f66f commit 498ce7cf79f1637deec194692dec9afaaa1047c3 @drnic committed Jun 29, 2008
Showing with 106 additions and 95 deletions.
  1. +11 −2 lib/iphoneruby/sdk.rb
  2. +3 −1 test/test_sdk.rb
  3. +92 −92 wiki/platform-differences.txt
View
@@ -30,9 +30,14 @@ def self.similarities(platform_a = :macosx, platform_b = :iphone)
platform_a, platform_b)
mem[framework] = headers.inject({}) do |mem2, header|
header_path_a = @platform_a.header_path(framework, header)
+ methods_a = "#{ENV['TMPDIR']}/#{platform_a}.h"
+ `grep "^[-+]" '#{header_path_a}' > #{methods_a}`
header_path_b = @platform_b.header_path(framework, header)
- diff = `diff -u '#{header_path_a}' '#{header_path_b}'`
- mem2[header] = OpenStruct.new(:diff? => (diff != ""))
+ methods_b = "#{ENV['TMPDIR']}/#{platform_b}.h"
+ `grep "^[-+]" '#{header_path_b}' > #{methods_b}`
+ # methods - cat path | grep "^[-+]"
+ diff = `diff '#{methods_a}' '#{methods_b}'`
+ mem2[header] = OpenStruct.new(:diff? => (diff != ""), :methods_diff => diff)
mem2
end
mem
@@ -62,4 +67,8 @@ def framework_header_names(framework)
def header_path(framework, header)
File.join frameworks_path, "#{framework}.framework", "Headers", "#{header}.h"
end
+
+ # TODO - perhaps generate bridgesupport xml for each header
+ # gen_bridge_metadata -F final -f /Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/System/Library/Frameworks/UIKit.framework UIView.h -o /tmp/UIView.bridgesupport
+ # except this doesn't work... :|
end
View
@@ -56,6 +56,8 @@ def test_similar_framework_header_names
# assert_equal("", @similarities['Foundation']['NSNull'].diff)
assert(@similarities['AddressBook']['ABAddressBook'].diff?)
+
+ puts @similarities['AddressBook']['ABAddressBook'].methods_diff
end
should "have some headers the exact same" do
@@ -69,7 +71,7 @@ def test_similar_framework_header_names
end
assert_equal(162, flattened_similarities.size)
no_diffs = flattened_similarities.reject { |name, sim| sim.diff? }
- assert_equal(61, no_diffs.size)
+ assert_equal(153, no_diffs.size)
end
end
@@ -4,181 +4,181 @@
** ABMultiValue.h *some differences*
** ABPerson.h *some differences*
** ABRecord.h *some differences*
-** AddressBook.h *some differences*
+** AddressBook.h
* AudioToolbox
-** AUGraph.h *some differences*
-** AudioFile.h *some differences*
-** AudioFileStream.h *some differences*
-** AudioFormat.h *some differences*
-** AudioQueue.h *some differences*
-** AudioServices.h *some differences*
-** AudioToolbox.h *some differences*
+** AUGraph.h
+** AudioFile.h
+** AudioFileStream.h
+** AudioFormat.h
+** AudioQueue.h
+** AudioServices.h
+** AudioToolbox.h
* AudioUnit
-** AUComponent.h *some differences*
-** AudioOutputUnit.h *some differences*
-** AudioUnit.h *some differences*
-** AudioUnitParameters.h *some differences*
-** AudioUnitProperties.h *some differences*
+** AUComponent.h
+** AudioOutputUnit.h
+** AudioUnit.h
+** AudioUnitParameters.h
+** AudioUnitProperties.h
* CoreAudio
-** CoreAudioTypes.h *some differences*
+** CoreAudioTypes.h
* CoreFoundation
** CFArray.h
** CFAttributedString.h
** CFBag.h
-** CFBase.h *some differences*
+** CFBase.h
** CFBinaryHeap.h
** CFBitVector.h
-** CFBundle.h *some differences*
-** CFByteOrder.h *some differences*
+** CFBundle.h
+** CFByteOrder.h
** CFCalendar.h
** CFCharacterSet.h
** CFData.h
** CFDate.h
** CFDateFormatter.h
** CFDictionary.h
** CFError.h
-** CFFileDescriptor.h *some differences*
+** CFFileDescriptor.h
** CFLocale.h
** CFMachPort.h
** CFMessagePort.h
-** CFNotificationCenter.h *some differences*
-** CFNumber.h *some differences*
+** CFNotificationCenter.h
+** CFNumber.h
** CFNumberFormatter.h
-** CFPlugIn.h *some differences*
-** CFPlugInCOM.h *some differences*
+** CFPlugIn.h
+** CFPlugInCOM.h
** CFPreferences.h
** CFPropertyList.h
-** CFRunLoop.h *some differences*
+** CFRunLoop.h
** CFSet.h
-** CFSocket.h *some differences*
+** CFSocket.h
** CFStream.h
-** CFString.h *some differences*
+** CFString.h
** CFStringEncodingExt.h
** CFTimeZone.h
** CFTree.h
-** CFURL.h *some differences*
+** CFURL.h
** CFURLAccess.h
** CFUUID.h
-** CoreFoundation.h *some differences*
+** CoreFoundation.h
* Foundation
-** Foundation.h *some differences*
+** Foundation.h
** FoundationErrors.h
-** NSArray.h *some differences*
-** NSAutoreleasePool.h *some differences*
+** NSArray.h
+** NSAutoreleasePool.h
** NSBundle.h
** NSByteOrder.h
** NSCalendar.h
** NSCharacterSet.h
** NSCoder.h *some differences*
** NSData.h
** NSDate.h
-** NSDateFormatter.h *some differences*
+** NSDateFormatter.h
** NSDecimal.h
** NSDecimalNumber.h
** NSDictionary.h
** NSEnumerator.h
** NSError.h
-** NSException.h *some differences*
+** NSException.h
** NSFileHandle.h
-** NSFileManager.h *some differences*
+** NSFileManager.h
** NSFormatter.h
-** NSHTTPCookie.h *some differences*
-** NSHTTPCookieStorage.h *some differences*
-** NSIndexPath.h *some differences*
+** NSHTTPCookie.h
+** NSHTTPCookieStorage.h
+** NSIndexPath.h
** NSIndexSet.h
-** NSInvocation.h *some differences*
-** NSKeyValueCoding.h *some differences*
-** NSKeyValueObserving.h *some differences*
+** NSInvocation.h
+** NSKeyValueCoding.h
+** NSKeyValueObserving.h
** NSKeyedArchiver.h *some differences*
** NSLocale.h
** NSLock.h
** NSMethodSignature.h
-** NSNetServices.h *some differences*
+** NSNetServices.h
** NSNotification.h
** NSNotificationQueue.h
** NSNull.h
-** NSNumberFormatter.h *some differences*
-** NSObjCRuntime.h *some differences*
-** NSObject.h *some differences*
+** NSNumberFormatter.h
+** NSObjCRuntime.h
+** NSObject.h
** NSOperation.h
** NSPathUtilities.h
-** NSPort.h *some differences*
+** NSPort.h
** NSProcessInfo.h
** NSPropertyList.h
** NSProxy.h
** NSRange.h
-** NSRunLoop.h *some differences*
+** NSRunLoop.h
** NSScanner.h
** NSSet.h
** NSSortDescriptor.h
-** NSStream.h *some differences*
-** NSString.h *some differences*
+** NSStream.h
+** NSString.h
** NSThread.h
** NSTimeZone.h
** NSTimer.h
-** NSURL.h *some differences*
-** NSURLAuthenticationChallenge.h *some differences*
-** NSURLCache.h *some differences*
-** NSURLConnection.h *some differences*
-** NSURLCredential.h *some differences*
-** NSURLCredentialStorage.h *some differences*
-** NSURLError.h *some differences*
-** NSURLProtectionSpace.h *some differences*
-** NSURLProtocol.h *some differences*
-** NSURLRequest.h *some differences*
-** NSURLResponse.h *some differences*
-** NSUserDefaults.h *some differences*
+** NSURL.h
+** NSURLAuthenticationChallenge.h
+** NSURLCache.h
+** NSURLConnection.h
+** NSURLCredential.h
+** NSURLCredentialStorage.h
+** NSURLError.h
+** NSURLProtectionSpace.h
+** NSURLProtocol.h
+** NSURLRequest.h
+** NSURLResponse.h
+** NSUserDefaults.h
** NSValue.h
** NSXMLParser.h
-** NSZone.h *some differences*
+** NSZone.h
* IOKit
* OpenAL
-** al.h *some differences*
-** alc.h *some differences*
+** al.h
+** alc.h
* QuartzCore
** CAAnimation.h *some differences*
-** CABase.h *some differences*
+** CABase.h
** CALayer.h *some differences*
-** CAMediaTiming.h *some differences*
-** CAMediaTimingFunction.h *some differences*
-** CAScrollLayer.h *some differences*
+** CAMediaTiming.h
+** CAMediaTimingFunction.h
+** CAScrollLayer.h
** CATiledLayer.h
-** CATransaction.h *some differences*
-** CATransform3D.h *some differences*
-** CoreAnimation.h *some differences*
-** QuartzCore.h *some differences*
+** CATransaction.h
+** CATransform3D.h
+** CoreAnimation.h
+** QuartzCore.h
* Security
-** SecBase.h *some differences*
-** SecCertificate.h *some differences*
-** SecIdentity.h *some differences*
-** SecImportExport.h *some differences*
-** SecKey.h *some differences*
-** SecPolicy.h *some differences*
-** SecTrust.h *some differences*
-** Security.h *some differences*
+** SecBase.h
+** SecCertificate.h
+** SecIdentity.h
+** SecImportExport.h
+** SecKey.h
+** SecPolicy.h
+** SecTrust.h
+** Security.h
* SystemConfiguration
-** DHCPClientPreferences.h *some differences*
-** SCDynamicStore.h *some differences*
-** SCDynamicStoreCopyDHCPInfo.h *some differences*
-** SCDynamicStoreCopySpecific.h *some differences*
-** SCDynamicStoreKey.h *some differences*
-** SCNetwork.h *some differences*
-** SCNetworkConfiguration.h *some differences*
-** SCNetworkConnection.h *some differences*
-** SCNetworkReachability.h *some differences*
-** SCPreferences.h *some differences*
-** SCPreferencesPath.h *some differences*
-** SCPreferencesSetSpecific.h *some differences*
-** SCSchemaDefinitions.h *some differences*
-** SystemConfiguration.h *some differences*
+** DHCPClientPreferences.h
+** SCDynamicStore.h
+** SCDynamicStoreCopyDHCPInfo.h
+** SCDynamicStoreCopySpecific.h
+** SCDynamicStoreKey.h
+** SCNetwork.h
+** SCNetworkConfiguration.h
+** SCNetworkConnection.h
+** SCNetworkReachability.h
+** SCPreferences.h
+** SCPreferencesPath.h
+** SCPreferencesSetSpecific.h
+** SCSchemaDefinitions.h
+** SystemConfiguration.h

0 comments on commit 498ce7c

Please sign in to comment.