Skip to content
This repository was archived by the owner on Apr 18, 2023. It is now read-only.

Commit 70fba93

Browse files
authored
Merge pull request #12 from microsoftgraph/vidadhee/MacSupport
Vidadhee/mac support
2 parents 4e964e4 + 189b169 commit 70fba93

File tree

7 files changed

+131
-75
lines changed

7 files changed

+131
-75
lines changed

MSGraphCoreSDK.podspec

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
Pod::Spec.new do |s|
3+
4+
s.name = "MSGraphCoreSDK"
5+
s.version = "0.1.2"
6+
s.summary = "Microsoft Graph ObjC SDK."
7+
8+
s.description = <<-DESC
9+
Integrate the Microsoft Graph API into your iOS App!
10+
DESC
11+
12+
s.homepage = "http://graph.microsoft.io"
13+
s.license = { :type => "MIT", :file => "LICENSE" }
14+
s.author = 'Microsoft Graph'
15+
16+
17+
s.ios.deployment_target = "9.0"
18+
s.osx.deployment_target = "10.10"
19+
20+
s.source = { :git => "https://github.com/microsoftgraph/msgraph-sdk-objc.git", :tag=> s.version }
21+
22+
s.source_files = "MSGraphCoreSDK/MSGraphCoreSDK/MSGraphCoreSDK.h"
23+
s.exclude_files = "MSGraphCoreSDK/MSGraphCoreSDKTests/*"
24+
s.public_header_files = "MSGraphCoreSDK/MSGraphCoreSDK/MSGraphCoreSDK.h"
25+
26+
s.subspec "Authentication" do |authentication|
27+
authentication.source_files = "MSGraphCoreSDK/MSGraphCoreSDK/Authentication/*.{h,m}"
28+
authentication.public_header_files = "MSGraphCoreSDK/MSGraphCoreSDK/Authentication/*.h"
29+
end
30+
31+
s.subspec "Common" do |common|
32+
common.dependency 'MSGraphCoreSDK/Authentication'
33+
common.source_files = "MSGraphCoreSDK/MSGraphCoreSDK/{Common,Middleware,GraphContent,HTTPClient}/**/*.{h,m}"
34+
common.public_header_files = "MSGraphCoreSDK/MSGraphCoreSDK/{Common,Middleware,GraphContent,HTTPClient}/**/*.h"
35+
end
36+
37+
end

MSGraphCoreSDK/MSGraphCoreSDK.xcodeproj/project.pbxproj

Lines changed: 85 additions & 65 deletions
Large diffs are not rendered by default.

MSGraphCoreSDK/MSGraphCoreSDK/Authentication/MSAuthenticationProvider.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
//
44

55
#import <Foundation/Foundation.h>
6-
#import <UIKit/UIKit.h>
76

87
typedef void(^MSAuthenticationCompletion)(NSMutableURLRequest *request, NSError *error);
98

MSGraphCoreSDK/MSGraphCoreSDK/MSGraphCoreSDK.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ FOUNDATION_EXPORT const unsigned char MSGraphSDKVersionString[];
4040
#import "MSGraphCoreSDK/MSBatchRequestContent.h"
4141
#import "MSGraphCoreSDK/MSBatchResponseContent.h"
4242

43+
4344
#endif
4445

4546

MSGraphCoreSDK/MSGraphCoreSDK/Middleware/Protocols/MSGraphMiddleware.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
//
44

55
#import <Foundation/Foundation.h>
6-
#import <UIKit/UIKit.h>
76

87
@class MSURLSessionTask;
98

MSGraphCoreSDK/MSGraphCoreSDKTests/MSGraphWorkloadsTests.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ - (void)testDriveItemSearchRequest{
9494
id mockNSTask = OCMClassMock([NSURLSessionDataTask class]);
9595
OCMStub([_mockHttpMiddleware dataTaskWithRequest:[OCMArg any] completionHandler:[OCMArg any]]).andReturn(mockNSTask);
9696

97-
OCMStub([mockNSTask resume])
97+
OCMStub([(NSURLSessionTask *)mockNSTask resume])
9898
.andDo(^(NSInvocation *invocation){
9999
XCTAssertEqualObjects(@"Bearer abcdefg", [dataTask.request.allHTTPHeaderFields objectForKey:@"Authorization"]);
100100
[dataTask taskCompletedWithData:self.responseData response:self->_OKresponse andError:nil];
@@ -124,7 +124,7 @@ - (void)testUserPhotoDownload{
124124
id mockNSTask = OCMClassMock([NSURLSessionDownloadTask class]);
125125
OCMStub([_mockHttpMiddleware downloadTaskWithRequest:[OCMArg any] progress:[OCMArg anyObjectRef] completionHandler:[OCMArg any]]).andReturn(mockNSTask);
126126

127-
OCMStub([mockNSTask resume]).andDo(^(NSInvocation *invocation){
127+
OCMStub([(NSURLSessionTask *)mockNSTask resume]).andDo(^(NSInvocation *invocation){
128128
XCTAssertEqualObjects(@"Bearer abcdefg", [downloadTask.request.allHTTPHeaderFields objectForKey:@"Authorization"]);
129129
[downloadTask taskCompletedWithData:[NSURL URLWithString:downloadPath] response:self->_OKresponse andError:nil];
130130
});
@@ -151,7 +151,7 @@ - (void)testUserPhotoUploadFromFile{
151151
id mockNSTask = OCMClassMock([NSURLSessionUploadTask class]);
152152
OCMStub([_mockHttpMiddleware uploadTaskWithRequest:[OCMArg any] fromFile:[OCMArg any] progress:[OCMArg anyObjectRef] completionHandler:[OCMArg any]]).andReturn(mockNSTask);
153153

154-
OCMStub([mockNSTask resume]).andDo(^(NSInvocation *invocation){
154+
OCMStub([(NSURLSessionTask *)mockNSTask resume]).andDo(^(NSInvocation *invocation){
155155
XCTAssertEqualObjects(@"Bearer abcdefg", [uploadTask.request.allHTTPHeaderFields objectForKey:@"Authorization"]);
156156
[uploadTask taskCompletedWithData:nil response:self->_OKresponse andError:nil];
157157
});
@@ -178,7 +178,7 @@ - (void)testUserPhotoUploadFromData{
178178
id mockNSTask = OCMClassMock([NSURLSessionUploadTask class]);
179179
OCMStub([_mockHttpMiddleware uploadTaskWithRequest:[OCMArg any] fromData:[OCMArg any] progress:[OCMArg anyObjectRef] completionHandler:[OCMArg any]]).andReturn(mockNSTask);
180180

181-
OCMStub([mockNSTask resume]).andDo(^(NSInvocation *invocation){
181+
OCMStub([(NSURLSessionTask *)mockNSTask resume]).andDo(^(NSInvocation *invocation){
182182
XCTAssertEqualObjects(@"Bearer abcdefg", [uploadTask.request.allHTTPHeaderFields objectForKey:@"Authorization"]);
183183
[uploadTask taskCompletedWithData:nil response:self->_OKresponse andError:nil];
184184
});

MSGraphCoreSDK/MSGraphCoreSDKTests/Middleware/Implementations/MSURLSessionManagerTests.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ - (void)testMSHTTPProviderForMiddlewareExecutionWithDataTask{
264264
[invocation getArgument:&completionHandler atIndex:3];
265265
completionHandler([NSData new],response,nil);
266266
});
267-
OCMStub([mockNSTask resume])
267+
OCMStub([(NSURLSessionTask *)mockNSTask resume])
268268
.andDo(^(NSInvocation *invocation){
269269
});
270270

@@ -298,7 +298,7 @@ - (void)testMSHTTPProviderForMiddlewareExecutionWithDownloadTask{
298298
[invocation getArgument:&completionHandler atIndex:4];
299299
completionHandler([NSURL URLWithString:@"https://foo"],response,nil);
300300
});
301-
OCMStub([mockNSTask resume])
301+
OCMStub([(NSURLSessionTask *)mockNSTask resume])
302302
.andDo(^(NSInvocation *invocation){
303303

304304
});
@@ -334,7 +334,7 @@ - (void)testMSHTTPProviderForMiddlewareExecutionWithUploadTaskFromData{
334334
[invocation getArgument:&completionHandler atIndex:5];
335335
completionHandler([NSData new],response,nil);
336336
});
337-
OCMStub([mockNSTask resume])
337+
OCMStub([(NSURLSessionTask *)mockNSTask resume])
338338
.andDo(^(NSInvocation *invocation){
339339
});
340340

@@ -370,7 +370,7 @@ - (void)testMSHTTPProviderForMiddlewareExecutionWithUploadTaskFromFile{
370370
[invocation getArgument:&completionHandler atIndex:5];
371371
completionHandler([NSData new],response,nil);
372372
});
373-
OCMStub([mockNSTask resume])
373+
OCMStub([(NSURLSessionTask *)mockNSTask resume])
374374
.andDo(^(NSInvocation *invocation){
375375
});
376376

0 commit comments

Comments
 (0)