diff --git a/Package.swift b/Package.swift index fa4030e4..96e31a21 100644 --- a/Package.swift +++ b/Package.swift @@ -29,12 +29,6 @@ let package = Package( .product(name: "cmark-gfm", package: cmarkPackageName), .product(name: "cmark-gfm-extensions", package: cmarkPackageName), ]), - .executableTarget( - name: "markdown-tool", - dependencies: [ - "Markdown", - .product(name: "ArgumentParser", package: "swift-argument-parser") - ]), .testTarget( name: "MarkdownTests", dependencies: ["Markdown"], @@ -50,7 +44,6 @@ if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil { // Building standalone, so fetch all dependencies remotely. package.dependencies += [ .package(url: "https://github.com/apple/swift-cmark.git", branch: "gfm"), - .package(url: "https://github.com/apple/swift-argument-parser", from: "1.2.2"), ] // 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 { // Building in the Swift.org CI system, so rely on local versions of dependencies. package.dependencies += [ .package(path: "../cmark"), - .package(path: "../swift-argument-parser"), ] } diff --git a/Tools/Package.swift b/Tools/Package.swift new file mode 100644 index 00000000..e5b8b2e2 --- /dev/null +++ b/Tools/Package.swift @@ -0,0 +1,33 @@ +// swift-tools-version:5.5 +/* + This source file is part of the Swift.org open source project + + Copyright (c) 2023 Apple Inc. and the Swift project authors + Licensed under Apache License v2.0 with Runtime Library Exception + + See https://swift.org/LICENSE.txt for license information + See https://swift.org/CONTRIBUTORS.txt for Swift project authors +*/ + +import PackageDescription + +let package = Package( + name: "Tools", + products: [ + .executable(name: "markdown-tool", targets: ["markdown-tool"]), + ], + dependencies: [ + .package(name: "swift-markdown", path: "../."), + .package(url: "https://github.com/apple/swift-argument-parser", from: "1.2.2"), + ], + targets: [ + .executableTarget( + name: "markdown-tool", + dependencies: [ + .product(name: "Markdown", package: "swift-markdown"), + .product(name: "ArgumentParser", package: "swift-argument-parser") + ], + path: "markdown-tool" + ), + ] +) diff --git a/Sources/markdown-tool/Commands/DumpTreeCommand.swift b/Tools/markdown-tool/Commands/DumpTreeCommand.swift similarity index 100% rename from Sources/markdown-tool/Commands/DumpTreeCommand.swift rename to Tools/markdown-tool/Commands/DumpTreeCommand.swift diff --git a/Sources/markdown-tool/Commands/FormatCommand.swift b/Tools/markdown-tool/Commands/FormatCommand.swift similarity index 100% rename from Sources/markdown-tool/Commands/FormatCommand.swift rename to Tools/markdown-tool/Commands/FormatCommand.swift diff --git a/Sources/markdown-tool/MarkdownCommand.swift b/Tools/markdown-tool/MarkdownCommand.swift similarity index 100% rename from Sources/markdown-tool/MarkdownCommand.swift rename to Tools/markdown-tool/MarkdownCommand.swift