Skip to content

Commit

Permalink
Support extensions with a new AppAuthCore target
Browse files Browse the repository at this point in the history
For Carthage:
New AppAuthCore Framework target.

For CocoaPods:
New AppAuth/Core subspec option.

Implementation details:
Goal was to support extensions through a target that doesn't contain
external user-agent code that can't be compiled, *without* changing how
everyone using AppAuth today integrates.

This was achieved through adding a new header file AppAuthCore.h with
the core files only, and a new Framework target and subspec with just
those files.
  • Loading branch information
WilliamDenniss committed Oct 20, 2018
1 parent 601d07d commit 6cc8dc3
Show file tree
Hide file tree
Showing 9 changed files with 595 additions and 25 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Docs/
xcuserdata/
Carthage/
30 changes: 20 additions & 10 deletions AppAuth.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,26 @@ It follows the OAuth 2.0 for Native Apps best current practice
s.platforms = { :ios => "7.0", :osx => "10.9", :watchos => "2.0", :tvos => "9.0" }

s.source = { :git => "https://github.com/openid/AppAuth-iOS.git", :tag => s.version }

s.source_files = "Source/*.{h,m}"
s.requires_arc = true

# iOS
s.ios.source_files = "Source/iOS/**/*.{h,m}"
s.ios.deployment_target = "7.0"
s.ios.frameworks = "SafariServices", "AuthenticationServices"

# macOS
s.osx.source_files = "Source/macOS/**/*.{h,m}"
s.osx.deployment_target = '10.9'
# Subspec for the core AppAuth library classes only, suitable for extensions.
s.subspec 'Core' do |core|
core.source_files = "Source/*.{h,m}"
core.exclude_files = "Source/AppAuth.h"
end

# Subspec for the full AppAuth library, including platform-dependant external user agents.
s.subspec 'ExternalUserAgent' do |externalUserAgent|

externalUserAgent.source_files = "Source/*.{h,m}"

# iOS
externalUserAgent.ios.source_files = "Source/iOS/**/*.{h,m}"
externalUserAgent.ios.deployment_target = "7.0"
externalUserAgent.ios.frameworks = "SafariServices", "AuthenticationServices"

# macOS
externalUserAgent.osx.source_files = "Source/macOS/**/*.{h,m}"
externalUserAgent.osx.deployment_target = '10.9'
end
end
342 changes: 341 additions & 1 deletion AppAuth.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

99 changes: 99 additions & 0 deletions AppAuth.xcodeproj/xcshareddata/xcschemes/AppAuthCore.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1000"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "342F42842177B1FC00574F24"
BuildableName = "AppAuthCore.framework"
BlueprintName = "AppAuthCore"
ReferencedContainer = "container:AppAuth.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3489707D2177B3B000ABEED4"
BuildableName = "AppAuthCoreTests.xctest"
BlueprintName = "AppAuthCoreTests"
ReferencedContainer = "container:AppAuth.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "342F42842177B1FC00574F24"
BuildableName = "AppAuthCore.framework"
BlueprintName = "AppAuthCore"
ReferencedContainer = "container:AppAuth.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "342F42842177B1FC00574F24"
BuildableName = "AppAuthCore.framework"
BlueprintName = "AppAuthCore"
ReferencedContainer = "container:AppAuth.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "342F42842177B1FC00574F24"
BuildableName = "AppAuthCore.framework"
BlueprintName = "AppAuthCore"
ReferencedContainer = "container:AppAuth.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
1 change: 0 additions & 1 deletion Source/AppAuth.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
#error "Platform Undefined"
#endif


/*! @mainpage AppAuth for iOS and macOS
@section introduction Introduction
Expand Down
43 changes: 43 additions & 0 deletions Source/AppAuthCore.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*! @file AppAuthCore.h
@brief AppAuth iOS SDK
@copyright
Copyright 2015 Google Inc. All Rights Reserved.
@copydetails
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#import "OIDAuthState.h"
#import "OIDAuthStateChangeDelegate.h"
#import "OIDAuthStateErrorDelegate.h"
#import "OIDAuthorizationRequest.h"
#import "OIDAuthorizationResponse.h"
#import "OIDAuthorizationService.h"
#import "OIDError.h"
#import "OIDErrorUtilities.h"
#import "OIDExternalUserAgent.h"
#import "OIDExternalUserAgentRequest.h"
#import "OIDExternalUserAgentSession.h"
#import "OIDGrantTypes.h"
#import "OIDIDToken.h"
#import "OIDRegistrationRequest.h"
#import "OIDRegistrationResponse.h"
#import "OIDResponseTypes.h"
#import "OIDScopes.h"
#import "OIDScopeUtilities.h"
#import "OIDServiceConfiguration.h"
#import "OIDServiceDiscovery.h"
#import "OIDTokenRequest.h"
#import "OIDTokenResponse.h"
#import "OIDTokenUtilities.h"
#import "OIDURLSessionProvider.h"

52 changes: 52 additions & 0 deletions Source/CoreFramework/AppAuthCore.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*! @file AppAuthCore.h
@brief AppAuth iOS SDK
@copyright
Copyright 2018 The AppAuth Authors. All Rights Reserved.
@copydetails
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#import <Foundation/Foundation.h>

//! Project version number for AppAuthFramework-iOS.
FOUNDATION_EXPORT double AppAuthCoreVersionNumber;

//! Project version string for AppAuthCoreFramework.
FOUNDATION_EXPORT const unsigned char AppAuthCoreVersionString[];

#import <AppAuthCore/OIDAuthState.h>
#import <AppAuthCore/OIDAuthStateChangeDelegate.h>
#import <AppAuthCore/OIDAuthStateErrorDelegate.h>
#import <AppAuthCore/OIDAuthorizationRequest.h>
#import <AppAuthCore/OIDAuthorizationResponse.h>
#import <AppAuthCore/OIDAuthorizationService.h>
#import <AppAuthCore/OIDError.h>
#import <AppAuthCore/OIDErrorUtilities.h>
#import <AppAuthCore/OIDExternalUserAgent.h>
#import <AppAuthCore/OIDExternalUserAgentRequest.h>
#import <AppAuthCore/OIDExternalUserAgentSession.h>
#import <AppAuthCore/OIDGrantTypes.h>
#import <AppAuthCore/OIDIDToken.h>
#import <AppAuthCore/OIDRegistrationRequest.h>
#import <AppAuthCore/OIDRegistrationResponse.h>
#import <AppAuthCore/OIDResponseTypes.h>
#import <AppAuthCore/OIDScopes.h>
#import <AppAuthCore/OIDScopeUtilities.h>
#import <AppAuthCore/OIDServiceConfiguration.h>
#import <AppAuthCore/OIDServiceDiscovery.h>
#import <AppAuthCore/OIDTokenRequest.h>
#import <AppAuthCore/OIDTokenResponse.h>
#import <AppAuthCore/OIDTokenUtilities.h>
#import <AppAuthCore/OIDURLSessionProvider.h>


26 changes: 26 additions & 0 deletions Source/CoreFramework/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2017 The AppAuth Authors</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
26 changes: 13 additions & 13 deletions Source/Framework/AppAuth.h
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/*! @file AppAuth.h
@brief AppAuth iOS SDK
@copyright
Copyright 2015 Google Inc. All Rights Reserved.
@copydetails
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
@brief AppAuth iOS SDK
@copyright
Copyright 2015 Google Inc. All Rights Reserved.
@copydetails
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#import <Foundation/Foundation.h>
Expand Down

0 comments on commit 6cc8dc3

Please sign in to comment.