Skip to content

Commit

Permalink
feat: make SDK samples compatible with carthage --use-xcframework com…
Browse files Browse the repository at this point in the history
…mand (#795)
  • Loading branch information
arjankowski authored Oct 28, 2021
1 parent 28abd75 commit 2494837
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 40 deletions.
42 changes: 26 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,28 @@ The Box iOS SDK in **Objective-C** (prior to v3.0.0) has been moved from the mai
Going forward, the main branch will contain the iOS SDK in **Swift**, starting with v3.0.0.

Box iOS SDK
- [Requirements](#requirements)
- [Installing the SDK](#installing-the-sdk)
- [Carthage](#carthage)
- [CocoaPods](#cocoapods)
- [Swift Package Manager](#swift-package-manager)
- [Getting Started](#getting-started)
- [Sample Apps](#sample-apps)
- [OAuth2 Sample App](#oauth2-sample-app)
- [JWT Auth Sample App](#jwt-auth-sample-app)
- [Release Definitions](#release-definitions)
- [Copyright and License](#copyright-and-license)
- [Box iOS SDK](#box-ios-sdk)
- [NOTE:](#note)
- [Requirements](#requirements)
- [Installing the SDK](#installing-the-sdk)
- [Carthage](#carthage)
- [CocoaPods](#cocoapods)
- [Swift Package Manager](#swift-package-manager)
- [Importing BoxSDK into Project](#importing-boxsdk-into-project)
- [Adding BoxSDK as a Dependency](#adding-boxsdk-as-a-dependency)
- [Getting Started](#getting-started)
- [Sample Apps](#sample-apps)
- [OAuth2 Sample App](#oauth2-sample-app)
- [JWT Auth Sample App](#jwt-auth-sample-app)
- [Release Definitions](#release-definitions)
- [Release Candidate (RC)](#release-candidate-rc)
- [Current Release](#current-release)
- [Long Term Support](#long-term-support)
- [Support Phases](#support-phases)
- [Active](#active)
- [Maintenance](#maintenance)
- [End-of-life](#end-of-life)
- [Copyright and License](#copyright-and-license)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

Expand All @@ -49,11 +60,10 @@ git "https://github.com/box/box-ios-sdk.git" ~> 5.0

__Step 2__: Update dependencies
```shell
$ carthage update --platform iOS
$ carthage update --use-xcframeworks --platform iOS
```
**If you are using Xcode 12, you must follow the steps outlined [here](https://github.com/Carthage/Carthage/issues/3019#issuecomment-665136323) to install dependecies due to a bug in carthage.**

__Step 3__: Drag the built framework from Carthage/Build/iOS into your project.
__Step 3__: Drag the built xcframework from Carthage/Build into your project.

For more detailed instructions, please see the [official documentation for Carthage](https://github.com/Carthage/Carthage#if-youre-building-for-ios-tvos-or-watchos).

Expand Down Expand Up @@ -137,7 +147,7 @@ To execute the sample app:
__Step 1__: Run carthage
```shell
$ cd SampleApps/OAuth2SampleApp
$ carthage update --platform iOS
$ carthage update --use-xcframeworks --platform iOS
```

__Step 2__: Open Xcode Project File
Expand Down Expand Up @@ -176,7 +186,7 @@ To execute the sample app:
__Step 1__: Run carthage
```shell
$ cd SampleApps/JWTSampleApp
$ carthage update --platform iOS
$ carthage update --use-xcframeworks --platform iOS
```

__Step 2__: Open Xcode Project File
Expand Down
2 changes: 1 addition & 1 deletion SampleApps/JWTSampleApp/Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
binary "https://raw.githubusercontent.com/box/box-ios-sdk/limited-beta-release/boxSDK.json" "3.0.0-rc.2"
github "box/box-ios-sdk" "v4.4.0"
34 changes: 23 additions & 11 deletions SampleApps/JWTSampleApp/JWTSampleApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,37 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 52;
objects = {

/* Begin PBXBuildFile section */
05B4D8FF272AEEAA00B1601E /* BoxSDK.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 05B4D8FE272AEEAA00B1601E /* BoxSDK.xcframework */; };
05B4D900272AEEAA00B1601E /* BoxSDK.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 05B4D8FE272AEEAA00B1601E /* BoxSDK.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
916688E4232996A600FB752C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 916688DA232996A600FB752C /* Assets.xcassets */; };
916688E5232996A600FB752C /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 916688DB232996A600FB752C /* LaunchScreen.storyboard */; };
916688E6232996A600FB752C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 916688DD232996A600FB752C /* Main.storyboard */; };
916688E8232996A600FB752C /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 916688E1232996A600FB752C /* ViewController.swift */; };
916688E9232996A600FB752C /* BasicErrorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 916688E3232996A600FB752C /* BasicErrorView.swift */; };
91B7911C22E917CF007BFB96 /* BoxSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 91B7911722E917BD007BFB96 /* BoxSDK.framework */; };
91B7911D22E917CF007BFB96 /* BoxSDK.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 91B7911722E917BD007BFB96 /* BoxSDK.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
9DB30FFE22C65AEB00C1A05C /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DB30FFD22C65AEB00C1A05C /* Constants.swift */; };
9DDC2AC922C4E0E500F1DBAC /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DDC2AC822C4E0E500F1DBAC /* AppDelegate.swift */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
91B7911E22E917CF007BFB96 /* Embed Frameworks */ = {
05B4D901272AEEAA00B1601E /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
91B7911D22E917CF007BFB96 /* BoxSDK.framework in Embed Frameworks */,
05B4D900272AEEAA00B1601E /* BoxSDK.xcframework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
05B4D8FE272AEEAA00B1601E /* BoxSDK.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = BoxSDK.xcframework; path = Carthage/Build/BoxSDK.xcframework; sourceTree = "<group>"; };
916688DA232996A600FB752C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
916688DC232996A600FB752C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
916688DE232996A600FB752C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
Expand All @@ -52,7 +53,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
91B7911C22E917CF007BFB96 /* BoxSDK.framework in Frameworks */,
05B4D8FF272AEEAA00B1601E /* BoxSDK.xcframework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -62,6 +63,7 @@
82810C620693AA1B5001CE43 /* Frameworks */ = {
isa = PBXGroup;
children = (
05B4D8FE272AEEAA00B1601E /* BoxSDK.xcframework */,
91B7911722E917BD007BFB96 /* BoxSDK.framework */,
);
name = Frameworks;
Expand Down Expand Up @@ -137,7 +139,7 @@
9DDC2AC222C4E0E500F1DBAC /* Frameworks */,
9DDC2AC322C4E0E500F1DBAC /* Resources */,
5A2FB60A367277CF7F18191A /* [CP] Embed Pods Frameworks */,
91B7911E22E917CF007BFB96 /* Embed Frameworks */,
05B4D901272AEEAA00B1601E /* Embed Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -389,9 +391,14 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = (
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
"FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]" = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/iOS",
"$(PROJECT_DIR)/Carthage/Build/BoxSDK.xcframework/ios-arm64",
);
"FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]" = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/BoxSDK.xcframework/ios-arm64_x86_64-simulator",
);
INFOPLIST_FILE = "$(SRCROOT)/JWTSampleApp/Resources/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
Expand All @@ -412,9 +419,14 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = (
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
"FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]" = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/BoxSDK.xcframework/ios-arm64",
);
"FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]" = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/iOS",
"$(PROJECT_DIR)/Carthage/Build/BoxSDK.xcframework/ios-arm64_x86_64-simulator",
);
INFOPLIST_FILE = "$(SRCROOT)/JWTSampleApp/Resources/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
Expand Down
2 changes: 1 addition & 1 deletion SampleApps/OAuth2SampleApp/Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
binary "https://raw.githubusercontent.com/box/box-ios-sdk/limited-beta-release/boxSDK.json" "3.0.0-rc.2"
github "box/box-ios-sdk" "v4.4.0"
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,37 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 52;
objects = {

/* Begin PBXBuildFile section */
05B4D8FB272AED6F00B1601E /* BoxSDK.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 05B4D8FA272AED6F00B1601E /* BoxSDK.xcframework */; };
05B4D8FC272AED6F00B1601E /* BoxSDK.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 05B4D8FA272AED6F00B1601E /* BoxSDK.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
916689202329998800FB752C /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 916689122329998800FB752C /* Constants.swift */; };
916689212329998800FB752C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 916689142329998800FB752C /* Assets.xcassets */; };
916689222329998800FB752C /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 916689152329998800FB752C /* LaunchScreen.storyboard */; };
916689232329998800FB752C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 916689172329998800FB752C /* Main.storyboard */; };
916689252329998800FB752C /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9166891C2329998800FB752C /* ViewController.swift */; };
916689262329998800FB752C /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9166891D2329998800FB752C /* AppDelegate.swift */; };
916689272329998800FB752C /* BasicErrorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9166891F2329998800FB752C /* BasicErrorView.swift */; };
91B7911222E907DE007BFB96 /* BoxSDK.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 91B7910C22E907A4007BFB96 /* BoxSDK.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
91B7911522E907EE007BFB96 /* BoxSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 91B7910C22E907A4007BFB96 /* BoxSDK.framework */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
91B7911322E907DE007BFB96 /* Embed Frameworks */ = {
05B4D8FD272AED6F00B1601E /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
91B7911222E907DE007BFB96 /* BoxSDK.framework in Embed Frameworks */,
05B4D8FC272AED6F00B1601E /* BoxSDK.xcframework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
05B4D8FA272AED6F00B1601E /* BoxSDK.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = BoxSDK.xcframework; path = Carthage/Build/BoxSDK.xcframework; sourceTree = "<group>"; };
916689122329998800FB752C /* Constants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
916689142329998800FB752C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
916689162329998800FB752C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
Expand All @@ -53,7 +54,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
91B7911522E907EE007BFB96 /* BoxSDK.framework in Frameworks */,
05B4D8FB272AED6F00B1601E /* BoxSDK.xcframework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -63,6 +64,7 @@
82810C620693AA1B5001CE43 /* Frameworks */ = {
isa = PBXGroup;
children = (
05B4D8FA272AED6F00B1601E /* BoxSDK.xcframework */,
91B7910C22E907A4007BFB96 /* BoxSDK.framework */,
);
name = Frameworks;
Expand Down Expand Up @@ -139,7 +141,7 @@
9DDC2AC222C4E0E500F1DBAC /* Frameworks */,
9DDC2AC322C4E0E500F1DBAC /* Resources */,
5A2FB60A367277CF7F18191A /* [CP] Embed Pods Frameworks */,
91B7911322E907DE007BFB96 /* Embed Frameworks */,
05B4D8FD272AED6F00B1601E /* Embed Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -397,9 +399,14 @@
CODE_SIGN_ENTITLEMENTS = OAuth2SampleApp/Resources/OAuth2SampleApp.entitlements;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = (
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
"FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]" = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/iOS",
"$(PROJECT_DIR)/Carthage/Build/BoxSDK.xcframework/ios-arm64",
);
"FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]" = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/BoxSDK.xcframework/ios-arm64_x86_64-simulator",
);
INFOPLIST_FILE = "$(SRCROOT)/OAuth2SampleApp/Resources/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
Expand All @@ -421,9 +428,14 @@
CODE_SIGN_ENTITLEMENTS = OAuth2SampleApp/Resources/OAuth2SampleApp.entitlements;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = (
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
"FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]" = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/BoxSDK.xcframework/ios-arm64",
);
"FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]" = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/iOS",
"$(PROJECT_DIR)/Carthage/Build/BoxSDK.xcframework/ios-arm64_x86_64-simulator",
);
INFOPLIST_FILE = "$(SRCROOT)/OAuth2SampleApp/Resources/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
Expand Down

0 comments on commit 2494837

Please sign in to comment.