Skip to content

Commit

Permalink
Merge pull request #1 from g-Off/squash-framework
Browse files Browse the repository at this point in the history
squash framework since it served no purpose
  • Loading branch information
g-Off authored Jul 2, 2019
2 parents fbcf04b + a69968e commit d3e00fa
Show file tree
Hide file tree
Showing 14 changed files with 56 additions and 36 deletions.
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"repositoryURL": "https://github.com/g-Off/XcodeProject.git",
"state": {
"branch": null,
"revision": "de0150084afc079464675f01f936924cceba4604",
"version": "0.5.0-alpha.3"
"revision": "aa649c9d1056b46e56b933aac43324a9e7dd6872",
"version": "0.5.0-alpha.4"
}
}
]
Expand Down
26 changes: 9 additions & 17 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,27 @@
import PackageDescription

let package = Package(
name: "Xcoder",
name: "Xcoder",
platforms: [
.macOS(.v10_14)
],
products: [
.executable(
name: "xcoder",
targets: ["xcoder"]),
.library(
name: "XcoderKit",
targets: ["XcoderKit"]),
],
dependencies: [
.package(url: "https://github.com/g-Off/XcodeProject.git", from: "0.5.0-alpha.4"),
.package(url: "https://github.com/g-Off/CommandRegistry.git", from: "0.1.0")
],
targets: ["xcoder"]
),
],
dependencies: [
.package(url: "https://github.com/g-Off/XcodeProject.git", from: "0.5.0-alpha.4"),
.package(url: "https://github.com/g-Off/CommandRegistry.git", from: "0.1.2")
],
targets: [
.target(
name: "xcoder",
dependencies: [
"XcoderKit"
]
),
.target(
name: "XcoderKit",
dependencies: [
"XcodeProject",
"CommandRegistry"
]
)
),
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
//

import Foundation
import Utility
import XcodeProject
import Basic
import CommandRegistry

public struct BuildPhaseSortCommand: Command {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
//

import Foundation
import Utility
import Basic
import CommandRegistry

public struct CompletionToolCommand: Command {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
//

import Foundation
import Utility
import XcodeProject
import Basic
import CommandRegistry

public struct GroupSortCommand: Command {
Expand Down
40 changes: 40 additions & 0 deletions Sources/xcoder/Commands/SaveCommand.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
//
// SaveCommand.swift
// XcoderKit
//
// Created by Geoffrey Foster on 2019-05-02.
//

import Foundation
import XcodeProject
import CommandRegistry

public struct SaveCommand: Command {
private struct SaveArguments {
var xcodeproj: AbsolutePath = localFileSystem.currentWorkingDirectory!
}

public let command: String = "save"
public let overview: String = "Saves the Xcode project."
private let binder = ArgumentBinder<SaveArguments>()

public init(parser: ArgumentParser) {
let subparser = parser.add(subparser: command, overview: overview)
binder.bind(positional: subparser.add(positional: "xcodeproj", kind: PathArgument.self, optional: false, usage: "Xcode Project file.", completion: .filename)) { (syncArguments, xcodeproj) in
syncArguments.xcodeproj = xcodeproj.path
}
}

public func run(with parsedArguments: ArgumentParser.Result) throws {
var arguments = SaveArguments()
try binder.fill(parseResult: parsedArguments, into: &arguments)

let projectFile: ProjectFile
do {
projectFile = try ProjectFile(url: Foundation.URL(fileURLWithPath: arguments.xcodeproj.asString))
} catch {
throw Error.invalidProject(path: arguments.xcodeproj.asString)
}
try projectFile.save()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
//

import Foundation
import Utility
import Basic
import XcodeProject
import CommandRegistry

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

import Foundation
import Utility
import CommandRegistry

extension Foundation.URL: ArgumentKind {
public static let completion: ShellCompletion = .filename
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
//

import Foundation
import Basic
import Utility
import XcodeProject
import CommandRegistry

protocol XcodeProjectLoading {
var xcodeproj: AbsolutePath { get set }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
//

import Foundation
import Basic
import Utility
import XcodeProject
import CommandRegistry

extension PBXReference.SortOption: StringEnumArgument {
static var options: [(name: String, description: String)] = [
Expand Down
4 changes: 2 additions & 2 deletions Sources/xcoder/Version.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Utility
import CommandRegistry

extension Version {
static var current: Version = "0.3.3"
static var current: Version = "0.3.5"
}
2 changes: 0 additions & 2 deletions Sources/xcoder/main.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import XcoderKit
import Foundation
import CommandRegistry
import Utility

var registry = Registry(usage: "<command> <options>", overview: "", version: Version.current)
registry.register(command: CompletionToolCommand.self)
Expand Down

0 comments on commit d3e00fa

Please sign in to comment.