From 35cb4ca0d2e6ac5be170e36f7a1523d15f2ca728 Mon Sep 17 00:00:00 2001 From: Yehor Popovych Date: Sun, 12 Feb 2017 02:04:47 +0200 Subject: [PATCH 1/5] Added carthage additional options support --- RomeBuild/Commands/BuildCommand.swift | 8 +++++--- RomeBuild/Commands/UploadCommand.swift | 16 +++++++++------- RomeBuild/Commands/UploadSelfCommand.swift | 9 +++++---- RomeBuild/main.swift | 8 ++++---- 4 files changed, 23 insertions(+), 18 deletions(-) diff --git a/RomeBuild/Commands/BuildCommand.swift b/RomeBuild/Commands/BuildCommand.swift index 528861c..405359d 100644 --- a/RomeBuild/Commands/BuildCommand.swift +++ b/RomeBuild/Commands/BuildCommand.swift @@ -3,10 +3,10 @@ import RomeKit struct BuildCommand { - func build(platforms: String?) { + func build(platforms: String?, additionalArguments: [String]) { if !Cartfile().exists() { - Carthage(["update", "--no-build", "--no-checkout"]) + Carthage(["update", "--no-build", "--no-checkout"] + additionalArguments) } var dependenciesToBuild = [String:String]() @@ -27,6 +27,7 @@ struct BuildCommand { if dependenciesToBuildArray.count > 0 { var checkoutCommand = ["checkout"] + checkoutCommand.appendContentsOf(additionalArguments) checkoutCommand.appendContentsOf(dependenciesToBuildArray) Carthage(checkoutCommand) @@ -36,6 +37,7 @@ struct BuildCommand { buildCommand.append("--platform") buildCommand.append(selectedPlatforms) } + buildCommand.appendContentsOf(additionalArguments) buildCommand.appendContentsOf(dependenciesToBuildArray) @@ -70,4 +72,4 @@ struct BuildCommand { } -} \ No newline at end of file +} diff --git a/RomeBuild/Commands/UploadCommand.swift b/RomeBuild/Commands/UploadCommand.swift index 3cf8748..e2b605c 100644 --- a/RomeBuild/Commands/UploadCommand.swift +++ b/RomeBuild/Commands/UploadCommand.swift @@ -3,12 +3,12 @@ import RomeKit struct UploadCommand { - func upload(platforms: String?) { + func upload(platforms: String?, additionalArguments: [String]) { if !Cartfile().exists() { - Carthage(["update", "--no-build", "--no-checkout"]) + Carthage(["update", "--no-build", "--no-checkout"] + additionalArguments) } else { - Carthage(["bootstrap", "--no-build", "--no-checkout"]) + Carthage(["bootstrap", "--no-build", "--no-checkout"] + additionalArguments) } var dependenciesToBuild = [String:String]() @@ -29,10 +29,10 @@ struct UploadCommand { let dependencyPath = "\(Environment().currentDirectory()!)/Carthage/Checkouts/\(dependency)" print("Checkout project dependency \(dependency)") - Carthage(["checkout", dependency, "--no-use-binaries"]) + Carthage(["checkout", dependency, "--no-use-binaries"] + additionalArguments) print("Checkout inner dependencies for \(dependency)") - Carthage(["bootstrap", "--no-build", "--project-directory", dependencyPath]) + Carthage(["bootstrap", "--no-build", "--project-directory", dependencyPath] + additionalArguments) print("Building \(dependency) for archive") @@ -43,8 +43,10 @@ struct UploadCommand { buildArchive.append(buildPlatforms) } + buildArchive.appendContentsOf(additionalArguments) + Carthage(buildArchive) - let status = Carthage(["archive", "--output", Environment().currentDirectory()!], path: dependencyPath) + let status = Carthage(["archive", "--output", Environment().currentDirectory()!]+additionalArguments, path: dependencyPath) Helpers().uploadAsset(dependency, revision: dependenciesToBuild[dependency]!, filePath: getFrameworkPath(status)) } } @@ -53,4 +55,4 @@ struct UploadCommand { } -} \ No newline at end of file +} diff --git a/RomeBuild/Commands/UploadSelfCommand.swift b/RomeBuild/Commands/UploadSelfCommand.swift index 6285b1a..7d39075 100644 --- a/RomeBuild/Commands/UploadSelfCommand.swift +++ b/RomeBuild/Commands/UploadSelfCommand.swift @@ -3,12 +3,12 @@ import RomeKit struct UploadSelfCommand { - func upload(productName: String, revision: String, platforms: String?) { + func upload(productName: String, revision: String, platforms: String?, additionalArguments: [String]) { if !Cartfile().exists() { - Carthage(["update", "--no-build"]) + Carthage(["update", "--no-build"] + additionalArguments) } else { - Carthage(["bootstrap", "--no-build"]) + Carthage(["bootstrap", "--no-build"] + additionalArguments) } print("Building \(productName) for archive") @@ -19,6 +19,7 @@ struct UploadSelfCommand { buildArchive.append("--platform") buildArchive.append(buildPlatforms) } + buildArchive.appendContentsOf(additionalArguments) Carthage(buildArchive) let status = Carthage(["archive"]) @@ -28,4 +29,4 @@ struct UploadSelfCommand { } -} \ No newline at end of file +} diff --git a/RomeBuild/main.swift b/RomeBuild/main.swift index 6f5334e..857ef83 100644 --- a/RomeBuild/main.swift +++ b/RomeBuild/main.swift @@ -41,16 +41,16 @@ do { try cli.parse() if build.value { - BuildCommand().build(platform.value) + BuildCommand().build(platform.value, additionalArguments: cli.unparsedArguments) } else if upload.value { if let uploadSelfParameters = uploadSelf.value { if uploadSelfParameters.count == 2 { - UploadSelfCommand().upload(uploadSelfParameters[0], revision: uploadSelfParameters[1], platforms: platform.value) + UploadSelfCommand().upload(uploadSelfParameters[0], revision: uploadSelfParameters[1], platforms: platform.value, additionalArguments: cli.unparsedArguments) } else { print("Uploading self requires product name & revision parameters") } } else { - UploadCommand().upload(platform.value) + UploadCommand().upload(platform.value, additionalArguments: cli.unparsedArguments) } } else { HelpCommand().printHelp() @@ -59,4 +59,4 @@ do { } catch { cli.printUsage(error) exit(EX_USAGE) -} \ No newline at end of file +} From f56727be20ca98df30abcefd67155a95bfad6da9 Mon Sep 17 00:00:00 2001 From: Yehor Popovych Date: Tue, 14 Feb 2017 16:57:44 +0200 Subject: [PATCH 2/5] Carthage additional argument filtering --- RomeBuild/Carthage/Carthage.swift | 85 +++++++++++++++++++++- RomeBuild/Commands/BuildCommand.swift | 6 +- RomeBuild/Commands/UploadCommand.swift | 12 +-- RomeBuild/Commands/UploadSelfCommand.swift | 8 +- RomeBuild/main.swift | 8 +- 5 files changed, 101 insertions(+), 18 deletions(-) diff --git a/RomeBuild/Carthage/Carthage.swift b/RomeBuild/Carthage/Carthage.swift index 20ab487..3881f66 100644 --- a/RomeBuild/Carthage/Carthage.swift +++ b/RomeBuild/Carthage/Carthage.swift @@ -1,6 +1,67 @@ import Foundation import Regex + +private let carthageArguments: Dictionary> = [ + "archive": [ + "--output": true, + "--project-directory": true, + "--color": true + ], + "bootstrap": [ + "--no-checkout": false, + "--no-build": false, + "--verbose": false, + "--configuration": true, + "--platform": true, + "--toolchain": true, + "--derived-data": true, + "--use-ssh": false, + "--use-submodules": false, + "--no-use-binaries": false, + "--color": true, + "--project-directory": true + ], + "build": [ + "--configuration": true, + "--platform": true, + "--toolchain": true, + "--derived-data": true, + "--no-skip-current": false, + "--color": true, + "--verbose": false, + "--project-directory": true + ], + "checkout": [ + "--use-ssh": false, + "--use-submodules": false, + "--no-use-binaries": false, + "--color": true, + "--project-directory": true + ], + "fetch": ["--color": true], + "outdated": [ + "--use-ssh": false, + "--verbose": false, + "--color": true, + "--project-directory": true + ], + "update": [ + "--no-checkout": false, + "--no-build": false, + "--verbose": false, + "--configuration": true, + "--platform": true, + "--toolchain": true, + "--derived-data": true, + "--use-ssh": false, + "--use-submodules": false, + "--no-use-binaries": false, + "--color": true, + "--project-directory": true + ] +] + func Carthage(args: [String], path: String? = nil) -> TaskStatus { let task = NSTask() let standardOutputPipe = NSPipe() @@ -23,9 +84,29 @@ func Carthage(args: [String], path: String? = nil) -> TaskStatus { } } -func getFrameworkPath(taskStatus: TaskStatus) -> String? { +func filterAdditionalArgs(task: String, args: [String]) -> [String] { + var additionalArgs = args + let allowedArgs = carthageArguments[task] + if let allowedArgs = allowedArgs { + var index = additionalArgs.startIndex + while index <= additionalArgs.endIndex { + let arg = allowedArgs[additionalArgs[index]] + if let arg = arg { + if arg { + index += 1 + } + index += 1 + } else { + additionalArgs.removeAtIndex(index) + } + } + } + return additionalArgs +} + +func getFrameworkPath(taskStatus: TaskStatus) -> String? { if let lastLineOfOutput = taskStatus.standardOutput?.last { return Regex("Created (.*framework.zip)$").match(lastLineOfOutput)?.captures[0] } return nil -} \ No newline at end of file +} diff --git a/RomeBuild/Commands/BuildCommand.swift b/RomeBuild/Commands/BuildCommand.swift index 405359d..fa24ee0 100644 --- a/RomeBuild/Commands/BuildCommand.swift +++ b/RomeBuild/Commands/BuildCommand.swift @@ -6,7 +6,7 @@ struct BuildCommand { func build(platforms: String?, additionalArguments: [String]) { if !Cartfile().exists() { - Carthage(["update", "--no-build", "--no-checkout"] + additionalArguments) + Carthage(["update", "--no-build", "--no-checkout"]+filterAdditionalArgs("update", args: additionalArguments)) } var dependenciesToBuild = [String:String]() @@ -27,7 +27,7 @@ struct BuildCommand { if dependenciesToBuildArray.count > 0 { var checkoutCommand = ["checkout"] - checkoutCommand.appendContentsOf(additionalArguments) + checkoutCommand.appendContentsOf(filterAdditionalArgs("checkout", args: additionalArguments)) checkoutCommand.appendContentsOf(dependenciesToBuildArray) Carthage(checkoutCommand) @@ -37,7 +37,7 @@ struct BuildCommand { buildCommand.append("--platform") buildCommand.append(selectedPlatforms) } - buildCommand.appendContentsOf(additionalArguments) + buildCommand.appendContentsOf(filterAdditionalArgs("build", args: additionalArguments)) buildCommand.appendContentsOf(dependenciesToBuildArray) diff --git a/RomeBuild/Commands/UploadCommand.swift b/RomeBuild/Commands/UploadCommand.swift index e2b605c..f8cb643 100644 --- a/RomeBuild/Commands/UploadCommand.swift +++ b/RomeBuild/Commands/UploadCommand.swift @@ -6,9 +6,9 @@ struct UploadCommand { func upload(platforms: String?, additionalArguments: [String]) { if !Cartfile().exists() { - Carthage(["update", "--no-build", "--no-checkout"] + additionalArguments) + Carthage(["update", "--no-build", "--no-checkout"]+filterAdditionalArgs("update", args: additionalArguments)) } else { - Carthage(["bootstrap", "--no-build", "--no-checkout"] + additionalArguments) + Carthage(["bootstrap", "--no-build", "--no-checkout"]+filterAdditionalArgs("bootstrap", args: additionalArguments)) } var dependenciesToBuild = [String:String]() @@ -29,10 +29,10 @@ struct UploadCommand { let dependencyPath = "\(Environment().currentDirectory()!)/Carthage/Checkouts/\(dependency)" print("Checkout project dependency \(dependency)") - Carthage(["checkout", dependency, "--no-use-binaries"] + additionalArguments) + Carthage(["checkout", dependency, "--no-use-binaries"]+filterAdditionalArgs("checkout", args: additionalArguments)) print("Checkout inner dependencies for \(dependency)") - Carthage(["bootstrap", "--no-build", "--project-directory", dependencyPath] + additionalArguments) + Carthage(["bootstrap", "--no-build", "--project-directory", dependencyPath]+filterAdditionalArgs("bootstrap", args: additionalArguments)) print("Building \(dependency) for archive") @@ -43,10 +43,10 @@ struct UploadCommand { buildArchive.append(buildPlatforms) } - buildArchive.appendContentsOf(additionalArguments) + buildArchive.appendContentsOf(filterAdditionalArgs("build", args: additionalArguments)) Carthage(buildArchive) - let status = Carthage(["archive", "--output", Environment().currentDirectory()!]+additionalArguments, path: dependencyPath) + let status = Carthage(["archive", "--output", Environment().currentDirectory()!]+filterAdditionalArgs("archive", args: additionalArguments), path: dependencyPath) Helpers().uploadAsset(dependency, revision: dependenciesToBuild[dependency]!, filePath: getFrameworkPath(status)) } } diff --git a/RomeBuild/Commands/UploadSelfCommand.swift b/RomeBuild/Commands/UploadSelfCommand.swift index 7d39075..4a50c40 100644 --- a/RomeBuild/Commands/UploadSelfCommand.swift +++ b/RomeBuild/Commands/UploadSelfCommand.swift @@ -6,9 +6,9 @@ struct UploadSelfCommand { func upload(productName: String, revision: String, platforms: String?, additionalArguments: [String]) { if !Cartfile().exists() { - Carthage(["update", "--no-build"] + additionalArguments) + Carthage(["update", "--no-build"]+filterAdditionalArgs("update", args: additionalArguments)) } else { - Carthage(["bootstrap", "--no-build"] + additionalArguments) + Carthage(["bootstrap", "--no-build"]+filterAdditionalArgs("bootstrap", args: additionalArguments)) } print("Building \(productName) for archive") @@ -19,10 +19,10 @@ struct UploadSelfCommand { buildArchive.append("--platform") buildArchive.append(buildPlatforms) } - buildArchive.appendContentsOf(additionalArguments) + buildArchive.appendContentsOf(filterAdditionalArgs("build", args: additionalArguments)) Carthage(buildArchive) - let status = Carthage(["archive"]) + let status = Carthage(["archive"]+filterAdditionalArgs("archive", args: additionalArguments)) Helpers().uploadAsset(productName, revision: revision, filePath: getFrameworkPath(status)) print("Upload complete") diff --git a/RomeBuild/main.swift b/RomeBuild/main.swift index 857ef83..97d19bc 100644 --- a/RomeBuild/main.swift +++ b/RomeBuild/main.swift @@ -40,17 +40,19 @@ cli.addOptions(build, platform, upload, uploadSelf, help) do { try cli.parse() + let additionalArguments = cli.unparsedArguments.filter {$0 != "--"} + if build.value { - BuildCommand().build(platform.value, additionalArguments: cli.unparsedArguments) + BuildCommand().build(platform.value, additionalArguments: additionalArguments) } else if upload.value { if let uploadSelfParameters = uploadSelf.value { if uploadSelfParameters.count == 2 { - UploadSelfCommand().upload(uploadSelfParameters[0], revision: uploadSelfParameters[1], platforms: platform.value, additionalArguments: cli.unparsedArguments) + UploadSelfCommand().upload(uploadSelfParameters[0], revision: uploadSelfParameters[1], platforms: platform.value, additionalArguments: additionalArguments) } else { print("Uploading self requires product name & revision parameters") } } else { - UploadCommand().upload(platform.value, additionalArguments: cli.unparsedArguments) + UploadCommand().upload(platform.value, additionalArguments: additionalArguments) } } else { HelpCommand().printHelp() From ccf2704e55cf576814ff1323685f42021d6a463d Mon Sep 17 00:00:00 2001 From: Yehor Popovych Date: Tue, 14 Feb 2017 17:21:37 +0200 Subject: [PATCH 3/5] Fixed crash in additional arguments --- RomeBuild/Carthage/Carthage.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RomeBuild/Carthage/Carthage.swift b/RomeBuild/Carthage/Carthage.swift index 3881f66..3f91ea1 100644 --- a/RomeBuild/Carthage/Carthage.swift +++ b/RomeBuild/Carthage/Carthage.swift @@ -89,7 +89,7 @@ func filterAdditionalArgs(task: String, args: [String]) -> [String] { let allowedArgs = carthageArguments[task] if let allowedArgs = allowedArgs { var index = additionalArgs.startIndex - while index <= additionalArgs.endIndex { + while index < additionalArgs.endIndex { let arg = allowedArgs[additionalArgs[index]] if let arg = arg { if arg { From 1c5dd61f324bccb04c52d72f38af0cfe199e6c68 Mon Sep 17 00:00:00 2001 From: Yehor Popovych Date: Fri, 22 Sep 2017 03:39:47 +0300 Subject: [PATCH 4/5] Swift 4 + SPM --- .gitignore | 3 +- Cartfile | 4 - Cartfile.resolved | 6 - Makefile | 21 +- Package.swift | 26 ++ RomeBuild.xcodeproj/project.pbxproj | 388 ------------------ .../contents.xcworkspacedata | 7 - RomeBuild/Info.plist | 39 -- .../RomeBuild}/Carthage/Cartfile.swift | 17 +- .../RomeBuild}/Carthage/Carthage.swift | 13 +- .../RomeBuild}/Commands/BuildCommand.swift | 25 +- .../RomeBuild}/Commands/HelpCommand.swift | 0 .../RomeBuild}/Commands/UploadCommand.swift | 16 +- .../Commands/UploadSelfCommand.swift | 10 +- .../RomeBuild}/Utilities/Environment.swift | 4 +- .../RomeBuild}/Utilities/Helpers.swift | 6 +- .../RomeBuild}/Utilities/Rome.swift | 32 +- .../RomeBuild}/Utilities/TaskStatus.swift | 0 .../RomeBuild}/Utilities/Unzip.swift | 5 +- {RomeBuild => Sources/RomeBuild}/main.swift | 12 +- 20 files changed, 102 insertions(+), 532 deletions(-) delete mode 100644 Cartfile delete mode 100644 Cartfile.resolved create mode 100644 Package.swift delete mode 100644 RomeBuild.xcodeproj/project.pbxproj delete mode 100644 RomeBuild.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 RomeBuild/Info.plist rename {RomeBuild => Sources/RomeBuild}/Carthage/Cartfile.swift (61%) rename {RomeBuild => Sources/RomeBuild}/Carthage/Carthage.swift (89%) rename {RomeBuild => Sources/RomeBuild}/Commands/BuildCommand.swift (64%) rename {RomeBuild => Sources/RomeBuild}/Commands/HelpCommand.swift (100%) rename {RomeBuild => Sources/RomeBuild}/Commands/UploadCommand.swift (70%) rename {RomeBuild => Sources/RomeBuild}/Commands/UploadSelfCommand.swift (63%) rename {RomeBuild => Sources/RomeBuild}/Utilities/Environment.swift (80%) rename {RomeBuild => Sources/RomeBuild}/Utilities/Helpers.swift (74%) rename {RomeBuild => Sources/RomeBuild}/Utilities/Rome.swift (52%) rename {RomeBuild => Sources/RomeBuild}/Utilities/TaskStatus.swift (100%) rename {RomeBuild => Sources/RomeBuild}/Utilities/Unzip.swift (87%) rename {RomeBuild => Sources/RomeBuild}/main.swift (78%) diff --git a/.gitignore b/.gitignore index 919d7e8..584e71f 100644 --- a/.gitignore +++ b/.gitignore @@ -34,8 +34,9 @@ playground.xcworkspace # Swift Package Manager # # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ +Packages/ .build/ +Package.resolved # CocoaPods # diff --git a/Cartfile b/Cartfile deleted file mode 100644 index 40adaa7..0000000 --- a/Cartfile +++ /dev/null @@ -1,4 +0,0 @@ -github "146BC/RomeKit" ~> 0.3 -github "BernardGatt/CommandLine" ~> 2.2 -github "sharplet/Regex" ~> 0.4 -github "146BC/Progress.swift" "feature/multiple_increments" diff --git a/Cartfile.resolved b/Cartfile.resolved deleted file mode 100644 index f506185..0000000 --- a/Cartfile.resolved +++ /dev/null @@ -1,6 +0,0 @@ -github "Alamofire/Alamofire" "3.5.1" -github "BernardGatt/CommandLine" "2.2.2" -github "Hearst-DD/ObjectMapper" "1.5.0" -github "146BC/Progress.swift" "68662d3b3589d2a7b0221966ae3019f97201b44d" -github "sharplet/Regex" "0.4.2" -github "146BC/RomeKit" "0.3.0" diff --git a/Makefile b/Makefile index 9a161bb..9c1087e 100644 --- a/Makefile +++ b/Makefile @@ -1,28 +1,19 @@ PREFIX?=/usr/local TEMPORARY_FOLDER=/tmp/RomeBuild.dst -BUILD_TOOL=xcodebuild - -XCODEFLAGS=DSTROOT=$(TEMPORARY_FOLDER) - -ROME_EXECUTABLE=$(TEMPORARY_FOLDER)/Applications/RomeBuild.app/Contents/MacOS/RomeBuild -FRAMEWORKS_BUNDLE=$(TEMPORARY_FOLDER)/Applications/RomeBuild.app/Contents/Frameworks/ - +BUILD_TOOL=swift build +BUILD_TOOL_FLAGS=-c release --build-path "$(TEMPORARY_FOLDER)" BINARIES_FOLDER=$(PREFIX)/bin -FRAMEWORKS_FOLDER=$(PREFIX)/Frameworks/RomeBuild + +ROME_EXECUTABLE=$(shell $(BUILD_TOOL) $(BUILD_TOOL_FLAGS) --show-bin-path)/romebuild clean: rm -rf "$(TEMPORARY_FOLDER)" - $(BUILD_TOOL) $(XCODEFLAGS) clean install: - carthage bootstrap --platform OSX - $(BUILD_TOOL) $(XCODEFLAGS) install + mkdir -p "$(TEMPORARY_FOLDER)" + $(BUILD_TOOL) $(BUILD_TOOL_FLAGS) mkdir -p "$(BINARIES_FOLDER)" - mkdir -p "$(FRAMEWORKS_FOLDER)" - cp -R "$(FRAMEWORKS_BUNDLE)" "$(FRAMEWORKS_FOLDER)" cp "$(ROME_EXECUTABLE)" "$(BINARIES_FOLDER)/romebuild" - install_name_tool -add_rpath "$(FRAMEWORKS_FOLDER)" "$(BINARIES_FOLDER)/romebuild" uninstall: - rm -rf "$(FRAMEWORKS_FOLDER)" rm "$(BINARIES_FOLDER)/romebuild" diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..5ef2929 --- /dev/null +++ b/Package.swift @@ -0,0 +1,26 @@ +// swift-tools-version:4.0 +// +// Package.swift +// RomeBuild +// +// Created by Yehor Popovych on 22/09/2017. +// Copyright © 2017 Yehor Popovych. All rights reserved. +// + +import PackageDescription + +let package = Package( + name: "RomeBuild", + products: [ + .executable(name: "romebuild", targets: ["RomeBuild"]), + ], + dependencies: [ + .package(url: "https://github.com/ypopovych/RomeKit.git", .branch("master")), + .package(url: "https://github.com/jatoben/CommandLine.git", .branch("master")), + .package(url: "https://github.com/sharplet/Regex.git", from: "1.1.0"), + .package(url: "https://github.com/jkandzi/Progress.swift.git", from: "0.2.0") + ], + targets: [ + .target(name: "RomeBuild", dependencies: ["RomeKit", "CommandLine", "Regex", "Progress"]) + ] +) diff --git a/RomeBuild.xcodeproj/project.pbxproj b/RomeBuild.xcodeproj/project.pbxproj deleted file mode 100644 index 800368f..0000000 --- a/RomeBuild.xcodeproj/project.pbxproj +++ /dev/null @@ -1,388 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 054C97811D549B3B00C481BD /* TaskStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = 054C97801D549B3B00C481BD /* TaskStatus.swift */; }; - 056D13DE1CEF5C55002FF045 /* Progress.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 056D13DB1CEF58B2002FF045 /* Progress.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - A14315981CDBFC3F00C279FD /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = A14315971CDBFC3F00C279FD /* main.swift */; }; - A14315A31CDBFEA300C279FD /* RomeKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = A143159A1CDBFE8600C279FD /* RomeKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - A14315A51CDBFEA300C279FD /* ObjectMapper.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = A143159B1CDBFE8600C279FD /* ObjectMapper.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - A14315A71CDBFEA300C279FD /* CommandLine.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = A143159C1CDBFE8600C279FD /* CommandLine.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - A14315A91CDBFEA300C279FD /* Alamofire.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = A143159D1CDBFE8600C279FD /* Alamofire.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - A14315AD1CDBFEED00C279FD /* HelpCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = A14315AC1CDBFEED00C279FD /* HelpCommand.swift */; }; - A14315AF1CDC014B00C279FD /* BuildCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = A14315AE1CDC014B00C279FD /* BuildCommand.swift */; }; - A14315B81CDE19A600C279FD /* Regex.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = A14315B51CDE19A100C279FD /* Regex.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - A14315BD1CDE2C8A00C279FD /* Cartfile.swift in Sources */ = {isa = PBXBuildFile; fileRef = A14315BB1CDE2C8A00C279FD /* Cartfile.swift */; }; - A14315BE1CDE2C8A00C279FD /* Carthage.swift in Sources */ = {isa = PBXBuildFile; fileRef = A14315BC1CDE2C8A00C279FD /* Carthage.swift */; }; - A14315C01CDE33F800C279FD /* Environment.swift in Sources */ = {isa = PBXBuildFile; fileRef = A14315BF1CDE33F800C279FD /* Environment.swift */; }; - A14315C31CDE449E00C279FD /* Unzip.swift in Sources */ = {isa = PBXBuildFile; fileRef = A14315C21CDE449E00C279FD /* Unzip.swift */; }; - A14315C51CDE7E5700C279FD /* UploadCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = A14315C41CDE7E5700C279FD /* UploadCommand.swift */; }; - A14315C91CDE7F7800C279FD /* Rome.swift in Sources */ = {isa = PBXBuildFile; fileRef = A14315C81CDE7F7800C279FD /* Rome.swift */; }; - A14E81E61CF272020064DF2B /* UploadSelfCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = A14E81E51CF272020064DF2B /* UploadSelfCommand.swift */; }; - A14E81E81CF284550064DF2B /* Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = A14E81E71CF284550064DF2B /* Helpers.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - A14315AA1CDBFEA300C279FD /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - A14315B81CDE19A600C279FD /* Regex.framework in Embed Frameworks */, - 056D13DE1CEF5C55002FF045 /* Progress.framework in Embed Frameworks */, - A14315A51CDBFEA300C279FD /* ObjectMapper.framework in Embed Frameworks */, - A14315A31CDBFEA300C279FD /* RomeKit.framework in Embed Frameworks */, - A14315A71CDBFEA300C279FD /* CommandLine.framework in Embed Frameworks */, - A14315A91CDBFEA300C279FD /* Alamofire.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 054C97801D549B3B00C481BD /* TaskStatus.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TaskStatus.swift; path = Utilities/TaskStatus.swift; sourceTree = ""; }; - 056D13DB1CEF58B2002FF045 /* Progress.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Progress.framework; path = Carthage/Build/Mac/Progress.framework; sourceTree = ""; }; - A14315871CDBFB9200C279FD /* RomeBuild.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RomeBuild.app; sourceTree = BUILT_PRODUCTS_DIR; }; - A14315911CDBFB9200C279FD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - A14315971CDBFC3F00C279FD /* main.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; - A143159A1CDBFE8600C279FD /* RomeKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RomeKit.framework; path = Carthage/Build/Mac/RomeKit.framework; sourceTree = ""; }; - A143159B1CDBFE8600C279FD /* ObjectMapper.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ObjectMapper.framework; path = Carthage/Build/Mac/ObjectMapper.framework; sourceTree = ""; }; - A143159C1CDBFE8600C279FD /* CommandLine.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CommandLine.framework; path = Carthage/Build/Mac/CommandLine.framework; sourceTree = ""; }; - A143159D1CDBFE8600C279FD /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Alamofire.framework; path = Carthage/Build/Mac/Alamofire.framework; sourceTree = ""; }; - A14315AC1CDBFEED00C279FD /* HelpCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HelpCommand.swift; sourceTree = ""; }; - A14315AE1CDC014B00C279FD /* BuildCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BuildCommand.swift; sourceTree = ""; }; - A14315B51CDE19A100C279FD /* Regex.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Regex.framework; path = Carthage/Build/Mac/Regex.framework; sourceTree = ""; }; - A14315BB1CDE2C8A00C279FD /* Cartfile.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Cartfile.swift; path = RomeBuild/Carthage/Cartfile.swift; sourceTree = SOURCE_ROOT; }; - A14315BC1CDE2C8A00C279FD /* Carthage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Carthage.swift; path = RomeBuild/Carthage/Carthage.swift; sourceTree = SOURCE_ROOT; }; - A14315BF1CDE33F800C279FD /* Environment.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Environment.swift; path = Utilities/Environment.swift; sourceTree = ""; }; - A14315C21CDE449E00C279FD /* Unzip.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Unzip.swift; path = Utilities/Unzip.swift; sourceTree = ""; }; - A14315C41CDE7E5700C279FD /* UploadCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UploadCommand.swift; sourceTree = ""; }; - A14315C81CDE7F7800C279FD /* Rome.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Rome.swift; path = Utilities/Rome.swift; sourceTree = ""; }; - A14E81E51CF272020064DF2B /* UploadSelfCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UploadSelfCommand.swift; sourceTree = ""; }; - A14E81E71CF284550064DF2B /* Helpers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Helpers.swift; path = Utilities/Helpers.swift; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - A14315841CDBFB9200C279FD /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - A143157E1CDBFB9200C279FD = { - isa = PBXGroup; - children = ( - A14315991CDBFC8400C279FD /* Frameworks */, - A14315891CDBFB9200C279FD /* RomeBuild */, - A14315881CDBFB9200C279FD /* Products */, - ); - sourceTree = ""; - }; - A14315881CDBFB9200C279FD /* Products */ = { - isa = PBXGroup; - children = ( - A14315871CDBFB9200C279FD /* RomeBuild.app */, - ); - name = Products; - sourceTree = ""; - }; - A14315891CDBFB9200C279FD /* RomeBuild */ = { - isa = PBXGroup; - children = ( - A14315C11CDE33FD00C279FD /* Utilities */, - A14315B01CDC044A00C279FD /* Carthage */, - A14315AB1CDBFED300C279FD /* Commands */, - A14315911CDBFB9200C279FD /* Info.plist */, - A14315971CDBFC3F00C279FD /* main.swift */, - ); - path = RomeBuild; - sourceTree = ""; - }; - A14315991CDBFC8400C279FD /* Frameworks */ = { - isa = PBXGroup; - children = ( - 056D13DB1CEF58B2002FF045 /* Progress.framework */, - A14315B51CDE19A100C279FD /* Regex.framework */, - A143159A1CDBFE8600C279FD /* RomeKit.framework */, - A143159B1CDBFE8600C279FD /* ObjectMapper.framework */, - A143159C1CDBFE8600C279FD /* CommandLine.framework */, - A143159D1CDBFE8600C279FD /* Alamofire.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - A14315AB1CDBFED300C279FD /* Commands */ = { - isa = PBXGroup; - children = ( - A14315AC1CDBFEED00C279FD /* HelpCommand.swift */, - A14315AE1CDC014B00C279FD /* BuildCommand.swift */, - A14315C41CDE7E5700C279FD /* UploadCommand.swift */, - A14E81E51CF272020064DF2B /* UploadSelfCommand.swift */, - ); - path = Commands; - sourceTree = ""; - }; - A14315B01CDC044A00C279FD /* Carthage */ = { - isa = PBXGroup; - children = ( - A14315BB1CDE2C8A00C279FD /* Cartfile.swift */, - A14315BC1CDE2C8A00C279FD /* Carthage.swift */, - ); - name = Carthage; - path = Utilities; - sourceTree = ""; - }; - A14315C11CDE33FD00C279FD /* Utilities */ = { - isa = PBXGroup; - children = ( - A14315BF1CDE33F800C279FD /* Environment.swift */, - A14315C21CDE449E00C279FD /* Unzip.swift */, - A14315C81CDE7F7800C279FD /* Rome.swift */, - A14E81E71CF284550064DF2B /* Helpers.swift */, - 054C97801D549B3B00C481BD /* TaskStatus.swift */, - ); - name = Utilities; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - A14315861CDBFB9200C279FD /* RomeBuild */ = { - isa = PBXNativeTarget; - buildConfigurationList = A14315941CDBFB9200C279FD /* Build configuration list for PBXNativeTarget "RomeBuild" */; - buildPhases = ( - A14315831CDBFB9200C279FD /* Sources */, - A14315841CDBFB9200C279FD /* Frameworks */, - A14315851CDBFB9200C279FD /* Resources */, - A14315AA1CDBFEA300C279FD /* Embed Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = RomeBuild; - productName = RomeBuild; - productReference = A14315871CDBFB9200C279FD /* RomeBuild.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - A143157F1CDBFB9200C279FD /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0730; - ORGANIZATIONNAME = 146BC; - TargetAttributes = { - A14315861CDBFB9200C279FD = { - CreatedOnToolsVersion = 7.3; - }; - }; - }; - buildConfigurationList = A14315821CDBFB9200C279FD /* Build configuration list for PBXProject "RomeBuild" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = A143157E1CDBFB9200C279FD; - productRefGroup = A14315881CDBFB9200C279FD /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - A14315861CDBFB9200C279FD /* RomeBuild */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - A14315851CDBFB9200C279FD /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - A14315831CDBFB9200C279FD /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - A14315AF1CDC014B00C279FD /* BuildCommand.swift in Sources */, - A14315C01CDE33F800C279FD /* Environment.swift in Sources */, - A14315C51CDE7E5700C279FD /* UploadCommand.swift in Sources */, - A14315AD1CDBFEED00C279FD /* HelpCommand.swift in Sources */, - A14E81E81CF284550064DF2B /* Helpers.swift in Sources */, - A14E81E61CF272020064DF2B /* UploadSelfCommand.swift in Sources */, - 054C97811D549B3B00C481BD /* TaskStatus.swift in Sources */, - A14315C31CDE449E00C279FD /* Unzip.swift in Sources */, - A14315C91CDE7F7800C279FD /* Rome.swift in Sources */, - A14315BE1CDE2C8A00C279FD /* Carthage.swift in Sources */, - A14315981CDBFC3F00C279FD /* main.swift in Sources */, - A14315BD1CDE2C8A00C279FD /* Cartfile.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - A14315921CDBFB9200C279FD /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "-"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 2.3; - }; - name = Debug; - }; - A14315931CDBFB9200C279FD /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "-"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = macosx; - SWIFT_VERSION = 2.3; - }; - name = Release; - }; - A14315951CDBFB9200C279FD /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ENABLE_MODULES = YES; - COMBINE_HIDPI_IMAGES = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/Mac", - ); - INFOPLIST_FILE = RomeBuild/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = OneFourSixBC.RomeBuild; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 2.3; - }; - name = Debug; - }; - A14315961CDBFB9200C279FD /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ENABLE_MODULES = YES; - COMBINE_HIDPI_IMAGES = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/Mac", - ); - INFOPLIST_FILE = RomeBuild/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = OneFourSixBC.RomeBuild; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 2.3; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - A14315821CDBFB9200C279FD /* Build configuration list for PBXProject "RomeBuild" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - A14315921CDBFB9200C279FD /* Debug */, - A14315931CDBFB9200C279FD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - A14315941CDBFB9200C279FD /* Build configuration list for PBXNativeTarget "RomeBuild" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - A14315951CDBFB9200C279FD /* Debug */, - A14315961CDBFB9200C279FD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = A143157F1CDBFB9200C279FD /* Project object */; -} diff --git a/RomeBuild.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/RomeBuild.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 5351d46..0000000 --- a/RomeBuild.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/RomeBuild/Info.plist b/RomeBuild/Info.plist deleted file mode 100644 index 86fbe36..0000000 --- a/RomeBuild/Info.plist +++ /dev/null @@ -1,39 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIconFile - - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSMinimumSystemVersion - $(MACOSX_DEPLOYMENT_TARGET) - NSHumanReadableCopyright - Copyright © 2016 146BC. All rights reserved. - NSMainNibFile - MainMenu - NSPrincipalClass - NSApplication - NSAppTransportSecurity - - NSAllowsArbitraryLoads - - - - diff --git a/RomeBuild/Carthage/Cartfile.swift b/Sources/RomeBuild/Carthage/Cartfile.swift similarity index 61% rename from RomeBuild/Carthage/Cartfile.swift rename to Sources/RomeBuild/Carthage/Cartfile.swift index 4ca0c52..46a55d0 100644 --- a/RomeBuild/Carthage/Cartfile.swift +++ b/Sources/RomeBuild/Carthage/Cartfile.swift @@ -8,14 +8,14 @@ struct Cartfile { return false } - return NSFileManager.defaultManager().fileExistsAtPath(filePath) + return FileManager.default.fileExists(atPath: filePath) } func load() -> [String:String] { var dependencies = [String:String]() - if let filePath = cartfilePath(), cartfileContents = try? String.init(contentsOfFile: filePath) { - dependencies = parseFile(cartfileContents) + if let filePath = cartfilePath(), let cartfileContents = try? String.init(contentsOfFile: filePath) { + dependencies = parseFile(contents: cartfileContents) } return dependencies @@ -36,17 +36,16 @@ struct Cartfile { let fvRegex = Regex("\"\\s*(.*?)\\s*\"") - let matches = fvRegex.allMatches(line) - if let framework = matches[0].captures.first!, version = matches[1].captures.first! { - if let frameworkName = framework.componentsSeparatedByString("/").last { - let cleanedFramework = frameworkName.stringByReplacingOccurrencesOfString(".git", withString: "") + let matches = fvRegex.allMatches(in: line) + if let framework = matches[0].captures.first!, let version = matches[1].captures.first! { + if let frameworkName = framework.components(separatedBy: "/").last { + let cleanedFramework = frameworkName.replacingOccurrences(of: ".git", with: "") dependencies[cleanedFramework] = version } } - } return dependencies } -} \ No newline at end of file +} diff --git a/RomeBuild/Carthage/Carthage.swift b/Sources/RomeBuild/Carthage/Carthage.swift similarity index 89% rename from RomeBuild/Carthage/Carthage.swift rename to Sources/RomeBuild/Carthage/Carthage.swift index 3f91ea1..c8a0ef8 100644 --- a/RomeBuild/Carthage/Carthage.swift +++ b/Sources/RomeBuild/Carthage/Carthage.swift @@ -62,9 +62,10 @@ private let carthageArguments: Dictionary> = [ ] ] -func Carthage(args: [String], path: String? = nil) -> TaskStatus { - let task = NSTask() - let standardOutputPipe = NSPipe() +@discardableResult +func Carthage(_ args: [String], path: String? = nil) -> TaskStatus { + let task = Process() + let standardOutputPipe = Pipe() task.launchPath = "/usr/local/bin/carthage" if let path = path { task.currentDirectoryPath = path @@ -76,7 +77,7 @@ func Carthage(args: [String], path: String? = nil) -> TaskStatus { let readHandle = standardOutputPipe.fileHandleForReading let data = readHandle.readDataToEndOfFile() - if let standardOutput = String.init(data: data, encoding: NSUTF8StringEncoding) { + if let standardOutput = String.init(data: data, encoding: .utf8) { let lines = standardOutput.characters.split { $0 == "\n" || $0 == "\r\n" }.map(String.init) return TaskStatus(status: task.terminationStatus, standardOutput: lines) } else { @@ -97,7 +98,7 @@ func filterAdditionalArgs(task: String, args: [String]) -> [String] { } index += 1 } else { - additionalArgs.removeAtIndex(index) + additionalArgs.remove(at: index) } } } @@ -106,7 +107,7 @@ func filterAdditionalArgs(task: String, args: [String]) -> [String] { func getFrameworkPath(taskStatus: TaskStatus) -> String? { if let lastLineOfOutput = taskStatus.standardOutput?.last { - return Regex("Created (.*framework.zip)$").match(lastLineOfOutput)?.captures[0] + return Regex("Created (.*framework.zip)$").firstMatch(in: lastLineOfOutput)?.captures[0] } return nil } diff --git a/RomeBuild/Commands/BuildCommand.swift b/Sources/RomeBuild/Commands/BuildCommand.swift similarity index 64% rename from RomeBuild/Commands/BuildCommand.swift rename to Sources/RomeBuild/Commands/BuildCommand.swift index fa24ee0..a052873 100644 --- a/RomeBuild/Commands/BuildCommand.swift +++ b/Sources/RomeBuild/Commands/BuildCommand.swift @@ -6,7 +6,7 @@ struct BuildCommand { func build(platforms: String?, additionalArguments: [String]) { if !Cartfile().exists() { - Carthage(["update", "--no-build", "--no-checkout"]+filterAdditionalArgs("update", args: additionalArguments)) + Carthage(["update", "--no-build", "--no-checkout"]+filterAdditionalArgs(task: "update", args: additionalArguments)) } var dependenciesToBuild = [String:String]() @@ -14,8 +14,8 @@ struct BuildCommand { for (name, revision) in dependencies { print(name, revision) - if let asset = Rome().getLatestByRevison(name, revision: revision) { - self.downloadAndExtractAsset(asset) + if let asset = Rome().getLatestByRevison(name: name, revision: revision) { + self.downloadAndExtractAsset(asset: asset) print("Asset extracted to Carthage directory") print("") } else { @@ -27,8 +27,8 @@ struct BuildCommand { if dependenciesToBuildArray.count > 0 { var checkoutCommand = ["checkout"] - checkoutCommand.appendContentsOf(filterAdditionalArgs("checkout", args: additionalArguments)) - checkoutCommand.appendContentsOf(dependenciesToBuildArray) + checkoutCommand.append(contentsOf: filterAdditionalArgs(task: "checkout", args: additionalArguments)) + checkoutCommand.append(contentsOf: dependenciesToBuildArray) Carthage(checkoutCommand) var buildCommand = ["build"] @@ -37,15 +37,14 @@ struct BuildCommand { buildCommand.append("--platform") buildCommand.append(selectedPlatforms) } - buildCommand.appendContentsOf(filterAdditionalArgs("build", args: additionalArguments)) + buildCommand.append(contentsOf: filterAdditionalArgs(task: "build", args: additionalArguments)) - buildCommand.appendContentsOf(dependenciesToBuildArray) + buildCommand.append(contentsOf: dependenciesToBuildArray) Carthage(buildCommand) } print("Build complete") - } private func downloadAndExtractAsset(asset: Asset) { @@ -55,14 +54,14 @@ struct BuildCommand { print("Downloading asset from:", downloadUrl) do { - let data = try NSData(contentsOfURL: NSURL(string: downloadUrl)!, options: NSDataReadingOptions()) + let data = try Data(contentsOf: URL(string: downloadUrl)!) let filePath = "\(Environment().currentDirectory()!)/Carthage/tmp/" - try NSFileManager.defaultManager().createDirectoryAtPath(filePath, withIntermediateDirectories: true, attributes: nil) + try FileManager.default.createDirectory(atPath: filePath, withIntermediateDirectories: true, attributes: nil) let zipFile = "\(filePath)\(asset.id!).zip" - try data.writeToFile(zipFile, options: NSDataWritingOptions.DataWritingAtomic) - Unzip(zipFile, destination: Environment().currentDirectory()!) - try NSFileManager.defaultManager().removeItemAtPath(zipFile) + try data.write(to: URL(fileURLWithPath: zipFile), options: .atomicWrite) + Unzip(zip: zipFile, destination: Environment().currentDirectory()!) + try FileManager.default.removeItem(atPath: zipFile) } catch { print(error) } diff --git a/RomeBuild/Commands/HelpCommand.swift b/Sources/RomeBuild/Commands/HelpCommand.swift similarity index 100% rename from RomeBuild/Commands/HelpCommand.swift rename to Sources/RomeBuild/Commands/HelpCommand.swift diff --git a/RomeBuild/Commands/UploadCommand.swift b/Sources/RomeBuild/Commands/UploadCommand.swift similarity index 70% rename from RomeBuild/Commands/UploadCommand.swift rename to Sources/RomeBuild/Commands/UploadCommand.swift index f8cb643..2c3725f 100644 --- a/RomeBuild/Commands/UploadCommand.swift +++ b/Sources/RomeBuild/Commands/UploadCommand.swift @@ -6,9 +6,9 @@ struct UploadCommand { func upload(platforms: String?, additionalArguments: [String]) { if !Cartfile().exists() { - Carthage(["update", "--no-build", "--no-checkout"]+filterAdditionalArgs("update", args: additionalArguments)) + Carthage(["update", "--no-build", "--no-checkout"]+filterAdditionalArgs(task: "update", args: additionalArguments)) } else { - Carthage(["bootstrap", "--no-build", "--no-checkout"]+filterAdditionalArgs("bootstrap", args: additionalArguments)) + Carthage(["bootstrap", "--no-build", "--no-checkout"]+filterAdditionalArgs(task: "bootstrap", args: additionalArguments)) } var dependenciesToBuild = [String:String]() @@ -17,7 +17,7 @@ struct UploadCommand { for (name, revision) in dependencies { print("") print(name, revision) - if Rome().getLatestByRevison(name, revision: revision) == nil { + if Rome().getLatestByRevison(name: name, revision: revision) == nil { dependenciesToBuild[name] = revision } } @@ -29,10 +29,10 @@ struct UploadCommand { let dependencyPath = "\(Environment().currentDirectory()!)/Carthage/Checkouts/\(dependency)" print("Checkout project dependency \(dependency)") - Carthage(["checkout", dependency, "--no-use-binaries"]+filterAdditionalArgs("checkout", args: additionalArguments)) + Carthage(["checkout", dependency, "--no-use-binaries"]+filterAdditionalArgs(task: "checkout", args: additionalArguments)) print("Checkout inner dependencies for \(dependency)") - Carthage(["bootstrap", "--no-build", "--project-directory", dependencyPath]+filterAdditionalArgs("bootstrap", args: additionalArguments)) + Carthage(["bootstrap", "--no-build", "--project-directory", dependencyPath]+filterAdditionalArgs(task: "bootstrap", args: additionalArguments)) print("Building \(dependency) for archive") @@ -43,11 +43,11 @@ struct UploadCommand { buildArchive.append(buildPlatforms) } - buildArchive.appendContentsOf(filterAdditionalArgs("build", args: additionalArguments)) + buildArchive.append(contentsOf: filterAdditionalArgs(task: "build", args: additionalArguments)) Carthage(buildArchive) - let status = Carthage(["archive", "--output", Environment().currentDirectory()!]+filterAdditionalArgs("archive", args: additionalArguments), path: dependencyPath) - Helpers().uploadAsset(dependency, revision: dependenciesToBuild[dependency]!, filePath: getFrameworkPath(status)) + let status = Carthage(["archive", "--output", Environment().currentDirectory()!]+filterAdditionalArgs(task: "archive", args: additionalArguments), path: dependencyPath) + Helpers().uploadAsset(name: dependency, revision: dependenciesToBuild[dependency]!, filePath: getFrameworkPath(taskStatus: status)) } } diff --git a/RomeBuild/Commands/UploadSelfCommand.swift b/Sources/RomeBuild/Commands/UploadSelfCommand.swift similarity index 63% rename from RomeBuild/Commands/UploadSelfCommand.swift rename to Sources/RomeBuild/Commands/UploadSelfCommand.swift index 4a50c40..8c8417d 100644 --- a/RomeBuild/Commands/UploadSelfCommand.swift +++ b/Sources/RomeBuild/Commands/UploadSelfCommand.swift @@ -6,9 +6,9 @@ struct UploadSelfCommand { func upload(productName: String, revision: String, platforms: String?, additionalArguments: [String]) { if !Cartfile().exists() { - Carthage(["update", "--no-build"]+filterAdditionalArgs("update", args: additionalArguments)) + Carthage(["update", "--no-build"]+filterAdditionalArgs(task: "update", args: additionalArguments)) } else { - Carthage(["bootstrap", "--no-build"]+filterAdditionalArgs("bootstrap", args: additionalArguments)) + Carthage(["bootstrap", "--no-build"]+filterAdditionalArgs(task: "bootstrap", args: additionalArguments)) } print("Building \(productName) for archive") @@ -19,12 +19,12 @@ struct UploadSelfCommand { buildArchive.append("--platform") buildArchive.append(buildPlatforms) } - buildArchive.appendContentsOf(filterAdditionalArgs("build", args: additionalArguments)) + buildArchive.append(contentsOf: filterAdditionalArgs(task: "build", args: additionalArguments)) Carthage(buildArchive) - let status = Carthage(["archive"]+filterAdditionalArgs("archive", args: additionalArguments)) + let status = Carthage(["archive"]+filterAdditionalArgs(task: "archive", args: additionalArguments)) - Helpers().uploadAsset(productName, revision: revision, filePath: getFrameworkPath(status)) + Helpers().uploadAsset(name: productName, revision: revision, filePath: getFrameworkPath(taskStatus: status)) print("Upload complete") } diff --git a/RomeBuild/Utilities/Environment.swift b/Sources/RomeBuild/Utilities/Environment.swift similarity index 80% rename from RomeBuild/Utilities/Environment.swift rename to Sources/RomeBuild/Utilities/Environment.swift index 3c10510..dee6b05 100644 --- a/RomeBuild/Utilities/Environment.swift +++ b/Sources/RomeBuild/Utilities/Environment.swift @@ -2,7 +2,7 @@ import Foundation struct Environment { - let env = NSProcessInfo.processInfo().environment + let env = ProcessInfo.processInfo.environment func currentDirectory() -> String? { return env["PWD"] @@ -11,4 +11,4 @@ struct Environment { func downloadServer() -> String? { return env["ROME_DOWNLOAD"] ?? env["ROME_ENDPOINT"] } -} \ No newline at end of file +} diff --git a/RomeBuild/Utilities/Helpers.swift b/Sources/RomeBuild/Utilities/Helpers.swift similarity index 74% rename from RomeBuild/Utilities/Helpers.swift rename to Sources/RomeBuild/Utilities/Helpers.swift index 4bb7652..fc21c8e 100644 --- a/RomeBuild/Utilities/Helpers.swift +++ b/Sources/RomeBuild/Utilities/Helpers.swift @@ -12,11 +12,11 @@ struct Helpers { do { - Rome().addAsset(name, revision: revision, path: path) - try NSFileManager.defaultManager().removeItemAtPath(path) + Rome().addAsset(name: name, revision: revision, path: path) + try FileManager.default.removeItem(atPath: path) } catch { print(error) } } -} \ No newline at end of file +} diff --git a/RomeBuild/Utilities/Rome.swift b/Sources/RomeBuild/Utilities/Rome.swift similarity index 52% rename from RomeBuild/Utilities/Rome.swift rename to Sources/RomeBuild/Utilities/Rome.swift index 80c1534..f173ada 100644 --- a/RomeBuild/Utilities/Rome.swift +++ b/Sources/RomeBuild/Utilities/Rome.swift @@ -7,42 +7,41 @@ struct Rome { func getLatestByRevison(name: String, revision: String) -> Asset? { var romeAsset: Asset? - let dispatchGroup = dispatch_group_create() - let queue = dispatch_queue_create("", DISPATCH_QUEUE_CONCURRENT) + let dispatchGroup = DispatchGroup() + let queue = DispatchQueue(label: "", attributes: .concurrent) - dispatch_group_enter(dispatchGroup) + dispatchGroup.enter() - RomeKit.Assets.getLatestAssetByRevision(name.stringByAddingPercentEncodingWithAllowedCharacters(NSCharacterSet.alphanumericCharacterSet())!, revision: revision, queue: queue, completionHandler: { (asset, errors) in + RomeKit.Assets.getLatestAssetByRevision(name: name.addingPercentEncoding(withAllowedCharacters: .alphanumerics)!, revision: revision, queue: queue, completionHandler: { (asset, errors) in romeAsset = asset if romeAsset != nil { print("Found asset on Rome:", romeAsset!.id!) } else { print("Asset not found in Rome server, added to build list") } - - dispatch_group_leave(dispatchGroup) + dispatchGroup.leave() }) - dispatch_group_wait(dispatchGroup, DISPATCH_TIME_FOREVER) + dispatchGroup.wait() return romeAsset } func addAsset(name: String, revision: String, path: String) { - let dispatchGroup = dispatch_group_create() - let queue = dispatch_queue_create("", DISPATCH_QUEUE_CONCURRENT) + let dispatchGroup = DispatchGroup() + let queue = DispatchQueue(label: "", attributes: .concurrent) - dispatch_group_enter(dispatchGroup) + dispatchGroup.enter() - guard let data = NSData(contentsOfFile: path) else { + guard let data = try? Data(contentsOf: URL(fileURLWithPath: path)) else { print("File not found") return } var progressBar = ProgressBar(count:100) - RomeKit.Assets.create(name, revision: revision, data: data, queue: queue, progress: { (bytesWritten, totalBytesWritten, totalBytesExpectedToWrite) in + RomeKit.Assets.create(name: name, revision: revision, data: data, queue: queue, progress: { (totalBytesWritten, totalBytesExpectedToWrite) in let currentPercent = Int(Float(totalBytesWritten) / Float(totalBytesExpectedToWrite) * 100) @@ -56,12 +55,9 @@ struct Rome { print("Asset created on Rome server:", asset.id!) } - dispatch_group_leave(dispatchGroup) - + dispatchGroup.leave() }) - dispatch_group_wait(dispatchGroup, DISPATCH_TIME_FOREVER) - + dispatchGroup.wait() } - -} \ No newline at end of file +} diff --git a/RomeBuild/Utilities/TaskStatus.swift b/Sources/RomeBuild/Utilities/TaskStatus.swift similarity index 100% rename from RomeBuild/Utilities/TaskStatus.swift rename to Sources/RomeBuild/Utilities/TaskStatus.swift diff --git a/RomeBuild/Utilities/Unzip.swift b/Sources/RomeBuild/Utilities/Unzip.swift similarity index 87% rename from RomeBuild/Utilities/Unzip.swift rename to Sources/RomeBuild/Utilities/Unzip.swift index 71b19ba..172d5f5 100644 --- a/RomeBuild/Utilities/Unzip.swift +++ b/Sources/RomeBuild/Utilities/Unzip.swift @@ -1,11 +1,12 @@ import Foundation +@discardableResult func Unzip(zip: String, destination: String) -> Int32 { - let task = NSTask() + let task = Process() task.launchPath = "/usr/bin/unzip" task.currentDirectoryPath = Environment().currentDirectory()! task.arguments = ["-q", "-o", "-u", "-d", destination, zip] task.launch() task.waitUntilExit() return task.terminationStatus -} \ No newline at end of file +} diff --git a/RomeBuild/main.swift b/Sources/RomeBuild/main.swift similarity index 78% rename from RomeBuild/main.swift rename to Sources/RomeBuild/main.swift index 97d19bc..43854f6 100644 --- a/RomeBuild/main.swift +++ b/Sources/RomeBuild/main.swift @@ -1,11 +1,11 @@ -import CommandLine +import CommandLineKit import Foundation import RomeKit import Alamofire -let env = NSProcessInfo.processInfo().environment +let env = ProcessInfo.processInfo.environment -if let baseUrl = env["ROME_ENDPOINT"], apiKey = env["ROME_KEY"] { +if let baseUrl = env["ROME_ENDPOINT"], let apiKey = env["ROME_KEY"] { let bootstrap = RomeKit.Bootstrap.init(baseUrl: baseUrl, apiKey: apiKey) bootstrap?.start() } else { @@ -43,16 +43,16 @@ do { let additionalArguments = cli.unparsedArguments.filter {$0 != "--"} if build.value { - BuildCommand().build(platform.value, additionalArguments: additionalArguments) + BuildCommand().build(platforms: platform.value, additionalArguments: additionalArguments) } else if upload.value { if let uploadSelfParameters = uploadSelf.value { if uploadSelfParameters.count == 2 { - UploadSelfCommand().upload(uploadSelfParameters[0], revision: uploadSelfParameters[1], platforms: platform.value, additionalArguments: additionalArguments) + UploadSelfCommand().upload(productName: uploadSelfParameters[0], revision: uploadSelfParameters[1], platforms: platform.value, additionalArguments: additionalArguments) } else { print("Uploading self requires product name & revision parameters") } } else { - UploadCommand().upload(platform.value, additionalArguments: additionalArguments) + UploadCommand().upload(platforms: platform.value, additionalArguments: additionalArguments) } } else { HelpCommand().printHelp() From 2560237c654415f6a14f7d1219ab0324593c1baf Mon Sep 17 00:00:00 2001 From: Yehor Popovych Date: Fri, 22 Sep 2017 03:54:27 +0300 Subject: [PATCH 5/5] Updated dependencies --- Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index 5ef2929..f835d55 100644 --- a/Package.swift +++ b/Package.swift @@ -15,7 +15,7 @@ let package = Package( .executable(name: "romebuild", targets: ["RomeBuild"]), ], dependencies: [ - .package(url: "https://github.com/ypopovych/RomeKit.git", .branch("master")), + .package(url: "https://github.com/ypopovych/RomeKit.git", from: "0.4.0"), .package(url: "https://github.com/jatoben/CommandLine.git", .branch("master")), .package(url: "https://github.com/sharplet/Regex.git", from: "1.1.0"), .package(url: "https://github.com/jkandzi/Progress.swift.git", from: "0.2.0")