Skip to content

Commit 261ad6f

Browse files
Remove dependency on argument-parser (swiftlang#149)
Removes swift-markdown's dependency on swift-argument-parser by refactoring the markdown-tool target into its own package. Markdown-tool is largely intended as a tool for developers working on swift-markdown so there isn't a need to vend it to clients. Removing argument-parser as a dependency allows for more clients to depend on swift-markdown since it removes any potential conflicts with different argument-parser versions.
1 parent e5ab909 commit 261ad6f

File tree

5 files changed

+33
-8
lines changed

5 files changed

+33
-8
lines changed

Package.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@ let package = Package(
2929
.product(name: "cmark-gfm", package: cmarkPackageName),
3030
.product(name: "cmark-gfm-extensions", package: cmarkPackageName),
3131
]),
32-
.executableTarget(
33-
name: "markdown-tool",
34-
dependencies: [
35-
"Markdown",
36-
.product(name: "ArgumentParser", package: "swift-argument-parser")
37-
]),
3832
.testTarget(
3933
name: "MarkdownTests",
4034
dependencies: ["Markdown"],
@@ -50,7 +44,6 @@ if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil {
5044
// Building standalone, so fetch all dependencies remotely.
5145
package.dependencies += [
5246
.package(url: "https://github.com/apple/swift-cmark.git", branch: "gfm"),
53-
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.2.2"),
5447
]
5548

5649
// SwiftPM command plugins are only supported by Swift version 5.6 and later.
@@ -63,6 +56,5 @@ if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil {
6356
// Building in the Swift.org CI system, so rely on local versions of dependencies.
6457
package.dependencies += [
6558
.package(path: "../cmark"),
66-
.package(path: "../swift-argument-parser"),
6759
]
6860
}

Tools/Package.swift

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// swift-tools-version:5.5
2+
/*
3+
This source file is part of the Swift.org open source project
4+
5+
Copyright (c) 2023 Apple Inc. and the Swift project authors
6+
Licensed under Apache License v2.0 with Runtime Library Exception
7+
8+
See https://swift.org/LICENSE.txt for license information
9+
See https://swift.org/CONTRIBUTORS.txt for Swift project authors
10+
*/
11+
12+
import PackageDescription
13+
14+
let package = Package(
15+
name: "Tools",
16+
products: [
17+
.executable(name: "markdown-tool", targets: ["markdown-tool"]),
18+
],
19+
dependencies: [
20+
.package(name: "swift-markdown", path: "../."),
21+
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.2.2"),
22+
],
23+
targets: [
24+
.executableTarget(
25+
name: "markdown-tool",
26+
dependencies: [
27+
.product(name: "Markdown", package: "swift-markdown"),
28+
.product(name: "ArgumentParser", package: "swift-argument-parser")
29+
],
30+
path: "markdown-tool"
31+
),
32+
]
33+
)

0 commit comments

Comments
 (0)