Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update SwiftCLI #667

Merged
merged 6 commits into from
Oct 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
#### Fixed
- Fixed macOS unit test setting preset [#665](https://github.com/yonaskolb/XcodeGen/pull/665) @yonaskolb

#### Internal

- Updated to SwiftCLI 5.3.2 [#667](https://github.com/yonaskolb/XcodeGen/pull/667) @giginet

## 2.8.0

#### Added
Expand Down
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
"repositoryURL": "https://github.com/jakeheis/SwiftCLI.git",
"state": {
"branch": null,
"revision": "5318c37d3cacc8780f50b87a8840a6774320ebdf",
"version": "5.2.2"
"revision": "ba2268e67c07b9f9cfbc0801385e6238b36255eb",
"version": "5.3.2"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ let package = Package(
.package(url: "https://github.com/kylef/Spectre.git", from: "0.9.0"),
.package(url: "https://github.com/onevcat/Rainbow.git", from: "3.0.0"),
.package(url: "https://github.com/tuist/xcodeproj.git", .exact("7.1.0")),
.package(url: "https://github.com/jakeheis/SwiftCLI.git", .exact("5.2.2")),
.package(url: "https://github.com/jakeheis/SwiftCLI.git", .upToNextMinor(from: "5.3.2")),
],
targets: [
.target(name: "XcodeGen", dependencies: [
Expand Down
20 changes: 0 additions & 20 deletions Sources/XcodeGenCLI/CommandRouter.swift

This file was deleted.

3 changes: 1 addition & 2 deletions Sources/XcodeGenCLI/XcodeGenCLI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import ProjectSpec
import SwiftCLI

public class XcodeGenCLI {

let cli: CLI

public init(version: Version) {
Expand All @@ -15,7 +14,7 @@ public class XcodeGenCLI {
description: "Generates Xcode projects",
commands: [generateCommand]
)
cli.parser = Parser(router: CommandRouter(defaultCommand: generateCommand))
cli.parser.routeBehavior = .searchWithFallback(generateCommand)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this new routeBehaviour replace the need for the Manipulator? The purpose of that was to make generate the default command

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it works fine with just the routeBehaviour

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried getting rid of any custom manipulators. However, behavior is changed. So it is needed.

$ swift run xcodegen # works fine
$ swift run xcodegen generate # behaviors are changed.

Usage: xcodegen [options]

Generate an Xcode project from a spec

Options:
  --cache-path <value>     Where the cache file will be loaded from and save to. Defaults to ~/.xcodegen/cache/{SPEC_PATH_HASH}
  -c, --use-cache          Use a cache for the xcodegen spec. This will prevent unnecessarily generating the project if nothing has changed
  -h, --help               Show help information
  -p, --project <value>    The path to the directory where the project should be generated. Defaults to the directory the spec is in. The filename is defined in the project spec
  -q, --quiet              Suppress all informational and success output
  -s, --spec <value>       The path to the project spec file. Defaults to project.yml

Error: command requires exactly 0 arguments

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried again, it will works as you said. Manipulators are not needed.

}

public func execute(arguments: [String]? = nil) {
Expand Down