Permalink
Browse files

Make it possible to build using versions of iOS earlier than 4.0.

  • Loading branch information...
1 parent 1f0dfde commit 5ed9d527da8647b252520695dc235b86e708839b Luke Redpath committed Sep 5, 2010
Showing with 14 additions and 2 deletions.
  1. +5 −0 Classes/LROAuth2Client.m
  2. +2 −0 LROAuth2Client.xcodeproj/project.pbxproj
  3. +1 −0 LROAuth2Client_Prefix.pch
  4. +6 −2 Rakefile
View
5 Classes/LROAuth2Client.m
@@ -225,7 +225,12 @@ - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)
*/
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
{
+
+#if __IPHONE_OS_VERSION_MAX_ALLOWED <= __IPHONE_3_2
+ NSString *failingURLString = [error.userInfo objectForKey:NSErrorFailingURLStringKey];
+#else
NSString *failingURLString = [error.userInfo objectForKey:NSURLErrorFailingURLStringErrorKey];
+#endif
if ([failingURLString hasPrefix:[self.redirectURL absoluteString]]) {
[webView stopLoading];
View
2 LROAuth2Client.xcodeproj/project.pbxproj
@@ -405,6 +405,7 @@
);
PREBINDING = NO;
PRODUCT_NAME = "LROAuth2Client-Device";
+ SDKROOT = iphoneos4.0;
};
name = Debug;
};
@@ -428,6 +429,7 @@
);
PREBINDING = NO;
PRODUCT_NAME = "LROAuth2Client-Device";
+ SDKROOT = iphoneos4.0;
ZERO_LINK = NO;
};
name = Release;
View
1 LROAuth2Client_Prefix.pch
@@ -9,5 +9,6 @@
#ifdef __OBJC__
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
+ #import "Availability.h"
#import "ASIHTTPRequestConfig.h"
#endif
View
8 Rakefile
@@ -4,7 +4,7 @@ TARGET_NAME = "LROAuth2Client"
module XcodeBuild
class BuildTask < Rake::TaskLib
- attr_accessor :target, :configuration
+ attr_accessor :target, :configuration, :sdk
def initialize(name)
@name = name
@@ -18,7 +18,7 @@ module XcodeBuild
desc "Build the #{target} target in #{configuration}"
task @name do
- system("xcodebuild -target #{target} -configuration #{configuration} build")
+ system("xcodebuild -target #{target} -configuration #{configuration} build -sdk #{sdk}")
end
end
end
@@ -32,15 +32,19 @@ def xcodebuild(name, &block)
XcodeBuild::BuildTask.new(name, &block)
end
+SDK_VERSION = ENV['SDK'] || '4.0'
+
namespace :build do
xcodebuild :device do |t|
t.target = "#{TARGET_NAME}-Device"
t.configuration = "Release"
+ t.sdk = "iphoneos#{SDK_VERSION}"
end
xcodebuild :simulator do |t|
t.target = "#{TARGET_NAME}-Simulator"
t.configuration = "Release"
+ t.sdk = "iphonesimulator#{SDK_VERSION}"
end
desc "Build the combined static library"

0 comments on commit 5ed9d52

Please sign in to comment.