diff --git a/.gitignore b/.gitignore index 4b70022..512e053 100644 --- a/.gitignore +++ b/.gitignore @@ -87,8 +87,7 @@ playground.xcworkspace # Carthage # # Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - +Carthage/Checkouts Carthage/Build # fastlane diff --git a/Cartfile b/Cartfile new file mode 100644 index 0000000..ba68cee --- /dev/null +++ b/Cartfile @@ -0,0 +1 @@ +github "Alamofire/Alamofire" ~> 4.7 diff --git a/Cartfile.resolved b/Cartfile.resolved new file mode 100644 index 0000000..d8e0066 --- /dev/null +++ b/Cartfile.resolved @@ -0,0 +1 @@ +github "Alamofire/Alamofire" "4.8.0" diff --git a/README.md b/README.md index 3602160..e44bb2d 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,14 @@ # XcodeGen -### Step 2 -For this step we added a new Notification Service Extension to the project using the add target feature of Xcode. - -No additional code or files added other than what is added by default and already the pull request (PR) is difficult to parse and reason with. +### Step 3 +When adding a [Carthage](https://github.com/Carthage/Carthage#installing-carthage) dependancy often steps are forgotten or not understood. This step adds [Alamofire](https://github.com/Alamofire/Alamofire) via Carthage to the project manually. --- ### Next -Please now checkout `step-3` +Please now checkout `step-4` -`git checkout tags/step-3` +`git checkout tags/step-4` --- diff --git a/XcodeGen.xcodeproj/project.pbxproj b/XcodeGen.xcodeproj/project.pbxproj index 114b0ae..463efbc 100644 --- a/XcodeGen.xcodeproj/project.pbxproj +++ b/XcodeGen.xcodeproj/project.pbxproj @@ -16,6 +16,8 @@ 8B53916821B4057F00E124A0 /* XcodeGenUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B53916721B4057F00E124A0 /* XcodeGenUITests.swift */; }; 8B5391BB21B41ABF00E124A0 /* NotificationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B5391BA21B41ABF00E124A0 /* NotificationService.swift */; }; 8B5391BF21B41ABF00E124A0 /* Notification Service Extension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 8B5391B821B41ABF00E124A0 /* Notification Service Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + 8B59760921B42BA5000554EF /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B53938A21B4226D00E124A0 /* Alamofire.framework */; }; + 8B59760A21B42BA5000554EF /* Alamofire.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8B53938A21B4226D00E124A0 /* Alamofire.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -54,6 +56,17 @@ name = "Embed App Extensions"; runOnlyForDeploymentPostprocessing = 0; }; + 8B59760B21B42BA5000554EF /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 8B59760A21B42BA5000554EF /* Alamofire.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ @@ -73,6 +86,7 @@ 8B5391B821B41ABF00E124A0 /* Notification Service Extension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "Notification Service Extension.appex"; sourceTree = BUILT_PRODUCTS_DIR; }; 8B5391BA21B41ABF00E124A0 /* NotificationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationService.swift; sourceTree = ""; }; 8B5391BC21B41ABF00E124A0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 8B53938A21B4226D00E124A0 /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Alamofire.framework; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -80,6 +94,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 8B59760921B42BA5000554EF /* Alamofire.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -110,6 +125,7 @@ 8B53913B21B4057D00E124A0 = { isa = PBXGroup; children = ( + 8B5391C521B4222B00E124A0 /* Carthage */, 8B53914621B4057D00E124A0 /* XcodeGen */, 8B53915B21B4057F00E124A0 /* XcodeGenTests */, 8B53916621B4057F00E124A0 /* XcodeGenUITests */, @@ -169,6 +185,23 @@ path = "Notification Service Extension"; sourceTree = ""; }; + 8B5391C521B4222B00E124A0 /* Carthage */ = { + isa = PBXGroup; + children = ( + 8B53938721B4226D00E124A0 /* iOS */, + ); + path = Carthage; + sourceTree = ""; + }; + 8B53938721B4226D00E124A0 /* iOS */ = { + isa = PBXGroup; + children = ( + 8B53938A21B4226D00E124A0 /* Alamofire.framework */, + ); + name = iOS; + path = Build/iOS; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -180,6 +213,7 @@ 8B53914121B4057D00E124A0 /* Frameworks */, 8B53914221B4057D00E124A0 /* Resources */, 8B5391C321B41ABF00E124A0 /* Embed App Extensions */, + 8B59760B21B42BA5000554EF /* Embed Frameworks */, ); buildRules = ( ); @@ -234,6 +268,7 @@ 8B5391B421B41ABF00E124A0 /* Sources */, 8B5391B521B41ABF00E124A0 /* Frameworks */, 8B5391B621B41ABF00E124A0 /* Resources */, + 8B53939021B4228A00E124A0 /* Carthage */, ); buildRules = ( ); @@ -325,6 +360,29 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + 8B53939021B4228A00E124A0 /* Carthage */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "$(SRCROOT)/Carthage/Build/iOS/Alamofire.framework", + ); + name = Carthage; + outputFileListPaths = ( + ); + outputPaths = ( + "$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/Alamofire.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "carthage copy-frameworks\n"; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 8B53914021B4057D00E124A0 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -521,6 +579,10 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); INFOPLIST_FILE = XcodeGen/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -539,6 +601,10 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); INFOPLIST_FILE = XcodeGen/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", diff --git a/XcodeGen/AppDelegate.swift b/XcodeGen/AppDelegate.swift index cd9d6c2..2203ee8 100644 --- a/XcodeGen/AppDelegate.swift +++ b/XcodeGen/AppDelegate.swift @@ -7,6 +7,7 @@ // import UIKit +import Alamofire @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate {