Skip to content

Commit

Permalink
Merge pull request #89 from finestructure/bump-tools-version
Browse files Browse the repository at this point in the history
Bump package tools-version and fix deprecation warnings
  • Loading branch information
finestructure authored Nov 30, 2022
2 parents 799157c + a23d581 commit b489675
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 22 deletions.
23 changes: 11 additions & 12 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.3
// swift-tools-version:5.6

import PackageDescription

Expand All @@ -12,31 +12,30 @@ let package = Package(
.library(name: "ArenaCore", type: .dynamic, targets: ["ArenaCore"])
],
dependencies: [
.package(name: "swift-argument-parser",
url: "https://github.com/apple/swift-argument-parser", from: "0.2.0"),
.package(url: "https://github.com/apple/swift-argument-parser", from: "0.2.0"),
.package(url: "https://github.com/finestructure/Parser", from: "0.0.0"),
.package(url: "https://github.com/JohnSundell/ShellOut.git", from: "2.0.0"),
.package(name: "Path.swift",
url: "https://github.com/mxcl/Path.swift.git", from: "1.0.0"),
.package(url: "https://github.com/mxcl/Path.swift.git", from: "1.0.0"),
.package(url: "https://github.com/SwiftPackageIndex/SemanticVersion", from: "0.2.0"),
.package(name: "SnapshotTesting",
url: "https://github.com/pointfreeco/swift-snapshot-testing.git", from: "1.7.2"),
.package(url: "https://github.com/pointfreeco/swift-snapshot-testing.git", from: "1.7.2"),
],
targets: [
.target(
name: "ArenaCLI",
dependencies: ["ArenaCore"]),
.executableTarget(name: "ArenaCLI", dependencies: ["ArenaCore"]),
.target(
name: "ArenaCore",
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
"Parser",
.product(name: "Path", package: "Path.swift"),
"SemanticVersion",
"ShellOut"]),
"ShellOut"]
),
.testTarget(
name: "ArenaTests",
dependencies: ["ArenaCore", "SnapshotTesting"],
dependencies: [
"ArenaCore",
.product(name: "SnapshotTesting", package: "swift-snapshot-testing")
],
exclude: ["__Snapshots__"]
),
]
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ In case you want to fetch a particular revision, range of revisions, or branch,

- `https://github.com/finestructure/[email protected]`

`.package(url: "https://github.com/finestructure/Gala", .exact("0.1.0"))`
`.package(url: "https://github.com/finestructure/Gala", exact: "0.1.0")`

- `https://github.com/finestructure/Gala@from:0.1.0`

Expand All @@ -107,11 +107,11 @@ In case you want to fetch a particular revision, range of revisions, or branch,

- `https://github.com/finestructure/Gala@branch:master`

`.package(url: "https://github.com/finestructure/Gala", .branch("master"))`
`.package(url: "https://github.com/finestructure/Gala", branch: "master")`

- `https://github.com/finestructure/Gala@revision:7235531e92e71176dc31e77d6ff2b128a2602110`

`.package(url: "https://github.com/finestructure/Gala", .revision("7235531e92e71176dc31e77d6ff2b128a2602110"))`
`.package(url: "https://github.com/finestructure/Gala", revision: "7235531e92e71176dc31e77d6ff2b128a2602110")`

Make sure to properly quote the URL if you are using the `..<` range operator. Otherwise your shell will interpret the `<` character as input redirection.

Expand Down
6 changes: 3 additions & 3 deletions Sources/ArenaCore/Dependency.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,17 @@ public struct Dependency: Equatable, Hashable, Codable {
#endif
switch requirement {
case .branch(let b):
return #".package(\#(n)url: "\#(url.absoluteString)", .branch("\#(b)"))"#
return #".package(\#(n)url: "\#(url.absoluteString)", branch: "\#(b)")"#
case .exact(let v):
return #".package(\#(n)url: "\#(url.absoluteString)", .exact("\#(v)"))"#
return #".package(\#(n)url: "\#(url.absoluteString)", exact: "\#(v)")"#
case .from(let v):
return #".package(\#(n)url: "\#(url.absoluteString)", from: "\#(v)")"#
case .path:
return #".package(\#(n)path: "\#(url.path)")"#
case .range(let r):
return #".package(\#(n)url: "\#(url.absoluteString)", "\#(r.lowerBound)"..<"\#(r.upperBound)")"#
case .revision(let r):
return #".package(\#(n)url: "\#(url.absoluteString)", .revision("\#(r)"))"#
return #".package(\#(n)url: "\#(url.absoluteString)", revision: "\#(r)")"#
case .noVersion:
return #".package(\#(n)url: "\#(url.absoluteString)", from: "0.0.0")"#
}
Expand Down
8 changes: 4 additions & 4 deletions Tests/ArenaTests/ArenaTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ final class ArenaTests: XCTestCase {
func test_dependency_package_clause() throws {
do {
let dep = Dependency(url: URL(string: "https://github.com/foo/bar")!, requirement: .branch("develop"))
XCTAssertEqual(dep.packageClause(), #".package(url: "https://github.com/foo/bar", .branch("develop"))"#)
XCTAssertEqual(dep.packageClause(), #".package(url: "https://github.com/foo/bar", branch: "develop")"#)
}
do {
let dep = Dependency(url: URL(string: "https://github.com/foo/bar")!, requirement: .exact("1.2.3"))
XCTAssertEqual(dep.packageClause(), #".package(url: "https://github.com/foo/bar", .exact("1.2.3"))"#)
XCTAssertEqual(dep.packageClause(), #".package(url: "https://github.com/foo/bar", exact: "1.2.3")"#)
}
do {
let dep = Dependency(url: URL(string: "https://github.com/foo/bar")!, requirement: .from("1.2.3"))
Expand All @@ -170,15 +170,15 @@ final class ArenaTests: XCTestCase {
}
do {
let dep = Dependency(url: URL(string: "https://github.com/foo/bar")!, requirement: .revision("foo"))
XCTAssertEqual(dep.packageClause(), #".package(url: "https://github.com/foo/bar", .revision("foo"))"#)
XCTAssertEqual(dep.packageClause(), #".package(url: "https://github.com/foo/bar", revision: "foo")"#)
}
do {
let dep = Dependency(url: URL(string: "file:///foo/bar")!, requirement: .path)
XCTAssertEqual(dep.packageClause(), #".package(path: "/foo/bar")"#)
}
do {
let dep = Dependency(url: URL(string: "https://github.com/foo/bar")!, requirement: .revision("foo"))
XCTAssertEqual(dep.packageClause(name: "bar"), #".package(url: "https://github.com/foo/bar", .revision("foo"))"#)
XCTAssertEqual(dep.packageClause(name: "bar"), #".package(url: "https://github.com/foo/bar", revision: "foo")"#)
}
do {
let dep = Dependency(url: URL(string: "file:///foo/bar")!, requirement: .path)
Expand Down

0 comments on commit b489675

Please sign in to comment.