Skip to content

Commit

Permalink
Ignore warnings from GTMFetcherAuthorizationProtocol deprecation (#175)
Browse files Browse the repository at this point in the history
* Update example apps to allow GTMSessionFetcher 2.x.

* Handle import differences between GTMSesssionFetcher 1 and 2.

* Ignore warnings from use of deprecated protocol methods with GTMSessionFetcher 2.1.

* Ignore warning from implementation of deprecated protocol method.
  • Loading branch information
petea authored Aug 30, 2022
1 parent bfe3e19 commit f2de574
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 10 deletions.
3 changes: 2 additions & 1 deletion Examples/Example-iOS/Example-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/google/gtm-session-fetcher.git";
requirement = {
kind = upToNextMajorVersion;
kind = versionRange;
maximumVersion = 3.0.0;
minimumVersion = 1.0.0;
};
};
Expand Down
2 changes: 1 addition & 1 deletion Examples/Example-iOS/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ target 'Example-iOSForPod' do
# pod 'GTMAppAuth'

pod 'AppAuth', '~> 1.0'
pod 'GTMSessionFetcher/Core', '~> 1.0'
pod 'GTMSessionFetcher/Core', '>= 1.0', '< 3.0'
end
9 changes: 6 additions & 3 deletions Examples/Example-iOS/Source/GTMAppAuthExampleViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@

@import AppAuth;
@import GTMAppAuth;
#if __has_include("GTMSessionFetcher/GTMSessionFetcher.h") // Cocoapods
@import GTMSessionFetcher;
#else // SPM
// CocoaPods || SPM && GTMSessionFetcher >= 2.0
#if __has_include("GTMSessionFetcher/GTMSessionFetcher.h")
#import <GTMSessionFetcher/GTMSessionFetcher.h>
#import <GTMSessionFetcher/GTMSessionFetcherService.h>
// SPM && GTMSessionFetcher < 2.0
#else
@import GTMSessionFetcherCore;
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/google/gtm-session-fetcher.git";
requirement = {
kind = upToNextMajorVersion;
kind = versionRange;
maximumVersion = 3.0.0;
minimumVersion = 1.0.0;
};
};
Expand Down
2 changes: 1 addition & 1 deletion Examples/Example-macOS/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ target 'Example-macOSForPod' do
# pod 'GTMAppAuth'

pod 'AppAuth', '~> 1.5'
pod 'GTMSessionFetcher/Core', '~> 1.0'
pod 'GTMSessionFetcher/Core', '>= 1.0', '< 3.0'
end
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@

@import AppAuth;
@import GTMAppAuth;
#if __has_include("GTMSessionFetcher/GTMSessionFetcher.h") // Cocoapods
@import GTMSessionFetcher;
#else // SPM
// CocoaPods || SPM && GTMSessionFetcher >= 2.0
#if __has_include("GTMSessionFetcher/GTMSessionFetcher.h")
#import <GTMSessionFetcher/GTMSessionFetcher.h>
#import <GTMSessionFetcher/GTMSessionFetcherService.h>
// SPM && GTMSessionFetcher < 2.0
#else
@import GTMSessionFetcherCore;
#endif

Expand Down
3 changes: 3 additions & 0 deletions GTMAppAuth/Sources/GTMAppAuthFetcherAuthorization.m
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,12 @@ - (void)authentication:(GTMAppAuthFetcherAuthorization *)auth
request:(NSMutableURLRequest *)request
finishedWithError:(NSError *)error;
*/
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-implementations"
- (void)authorizeRequest:(NSMutableURLRequest *)request
delegate:(id)delegate
didFinishSelector:(SEL)sel {
#pragma clang diagnostic pop
GTMOAuth2AssertValidSelector(delegate, sel,
@encode(GTMAppAuthFetcherAuthorization *),
@encode(NSMutableURLRequest *),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,11 @@ typedef void (^GTMAppAuthFetcherAuthorizationCompletion)(NSError *_Nullable erro
library.
@discussion Enables you to use AppAuth with the GTM Session Fetcher library.
*/
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
@interface GTMAppAuthFetcherAuthorization : NSObject <GTMFetcherAuthorizationProtocol,
NSSecureCoding>
#pragma clang diagnostic pop

/*! @brief The AppAuth authentication state.
*/
Expand Down

0 comments on commit f2de574

Please sign in to comment.