Skip to content

Commit

Permalink
Issue number of the reported bug or feature request: #94
Browse files Browse the repository at this point in the history
Describe your changes
- Update to use ArgumentParser

Testing performed
- All unit tests are passed.

Signed-off-by: Duyet Nguyen <[email protected]>
  • Loading branch information
ntduyet authored and marciniwanicki committed May 10, 2022
1 parent 4755a03 commit bcb6c64
Show file tree
Hide file tree
Showing 5 changed files with 160 additions and 196 deletions.
4 changes: 3 additions & 1 deletion CommandTests/Generated/unknown.1.b23a6a84.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 22 additions & 4 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,40 @@
"version": "0.10.1"
}
},
{
"package": "swift-argument-parser",
"repositoryURL": "https://github.com/apple/swift-argument-parser",
"state": {
"branch": null,
"revision": "f3c9084a71ef4376f2fabbdf1d3d90a49f1fabdb",
"version": "1.1.2"
}
},
{
"package": "swift-system",
"repositoryURL": "https://github.com/apple/swift-system.git",
"state": {
"branch": null,
"revision": "836bc4557b74fe6d2660218d56e3ce96aff76574",
"version": "1.1.1"
}
},
{
"package": "swift-tools-support-core",
"repositoryURL": "https://github.com/apple/swift-tools-support-core.git",
"state": {
"branch": null,
"revision": "f9bbd6b80d67408021576adf6247e17c2e957d92",
"version": "0.2.4"
"revision": "b7667f3e266af621e5cc9c77e74cacd8e8c00cb4",
"version": "0.2.5"
}
},
{
"package": "XcodeProj",
"repositoryURL": "https://github.com/tuist/xcodeproj.git",
"state": {
"branch": null,
"revision": "64c4b956c1095dbba7a07107005342a25f1c5d6b",
"version": "8.5.0"
"revision": "c75c3acc25460195cfd203a04dde165395bf00e0",
"version": "8.7.1"
}
}
]
Expand Down
23 changes: 17 additions & 6 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.0
// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand Down Expand Up @@ -26,27 +26,38 @@ let package = Package(
.package(url: "https://github.com/apple/swift-tools-support-core.git", .upToNextMajor(from: "0.2.4")),
.package(url: "https://github.com/kylef/PathKit", .upToNextMinor(from: "1.0.1")),
.package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "8.5.0")),
.package(url: "https://github.com/apple/swift-argument-parser", .upToNextMajor(from: "1.1.2")),
],
targets: [
.target(
.executableTarget(
name: "XCDiff",
dependencies: ["XCDiffCommand"]
),
.target(
name: "XCDiffCommand",
dependencies: ["PathKit", "SwiftToolsSupport-auto", "XCDiffCore"]
dependencies: [
"PathKit",
.product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
"XCDiffCore",
.product(name: "ArgumentParser", package: "swift-argument-parser"),
]
),
.target(
name: "XCDiffCore",
dependencies: ["XcodeProj"]
dependencies: [.product(name: "XcodeProj", package: "xcodeproj")]
),
.testTarget(
name: "XCDiffCommandTests",
dependencies: ["XCDiffCore", "XCDiffCommand", "PathKit"]
dependencies: [
"XCDiffCore",
"XCDiffCommand",
"PathKit",
.product(name: "ArgumentParser", package: "swift-argument-parser"),
]
),
.testTarget(
name: "XCDiffCoreTests",
dependencies: ["XCDiffCore", "PathKit", "XcodeProj"]
dependencies: ["XCDiffCore", "PathKit", .product(name: "XcodeProj", package: "xcodeproj")]
),
]
)
2 changes: 1 addition & 1 deletion Sources/XCDiff/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import Foundation
import XCDiffCommand

func main() -> Int32 {
let arguments = Array(ProcessInfo.processInfo.arguments.dropFirst())
let arguments = Array(CommandLine.arguments.dropFirst())
let commandRunner = CommandRunner()
let code = commandRunner.run(with: arguments)
return code
Expand Down
Loading

0 comments on commit bcb6c64

Please sign in to comment.