Skip to content

Commit 90a1b8a

Browse files
committed
Bump swift version
1 parent 91b296e commit 90a1b8a

File tree

2 files changed

+77
-5
lines changed

2 files changed

+77
-5
lines changed

Package.swift

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:4.2
1+
// swift-tools-version:5.4
22
/*
33
This source file is part of the Swift.org open source project
44

@@ -25,13 +25,22 @@ let package = Package(
2525
targets: [
2626
.target(
2727
name: "Markdown",
28-
dependencies: ["cmark-gfm", "cmark-gfm-extensions", "CAtomic"]),
29-
.target(
28+
dependencies: [
29+
"CAtomic",
30+
.product(name: "cmark-gfm", package: "swift-cmark"),
31+
.product(name: "cmark-gfm-extensions", package: "swift-cmark"),
32+
]),
33+
.executableTarget(
3034
name: "markdown-tool",
31-
dependencies: ["Markdown", .product(name: "ArgumentParser", package: "swift-argument-parser")]),
35+
dependencies: [
36+
"Markdown",
37+
.product(name: "ArgumentParser", package: "swift-argument-parser"),
38+
]),
3239
.testTarget(
3340
name: "MarkdownTests",
34-
dependencies: ["Markdown"]),
41+
dependencies: ["Markdown"],
42+
resources: [.copy("Visitors/Everything.md")]
43+
),
3544
.target(name: "CAtomic"),
3645
]
3746
)

[email protected]

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// swift-tools-version:5.5
2+
/*
3+
This source file is part of the Swift.org open source project
4+
5+
Copyright (c) 2021 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+
import class Foundation.ProcessInfo
14+
15+
let package = Package(
16+
name: "swift-markdown",
17+
products: [
18+
.library(
19+
name: "Markdown",
20+
targets: ["Markdown"]),
21+
.executable(
22+
name: "markdown-tool",
23+
targets: ["markdown-tool"]),
24+
],
25+
targets: [
26+
.target(
27+
name: "Markdown",
28+
dependencies: [
29+
"CAtomic",
30+
.product(name: "cmark-gfm", package: "swift-cmark"),
31+
.product(name: "cmark-gfm-extensions", package: "swift-cmark"),
32+
]),
33+
.executableTarget(
34+
name: "markdown-tool",
35+
dependencies: [
36+
"Markdown",
37+
.product(name: "ArgumentParser", package: "swift-argument-parser"),
38+
]),
39+
.testTarget(
40+
name: "MarkdownTests",
41+
dependencies: ["Markdown"],
42+
resources: [.copy("Visitors/Everything.md")]
43+
),
44+
.target(name: "CAtomic"),
45+
]
46+
)
47+
48+
// If the `SWIFTCI_USE_LOCAL_DEPS` environment variable is set,
49+
// we're building in the Swift.org CI system alongside other projects in the Swift toolchain and
50+
// we can depend on local versions of our dependencies instead of fetching them remotely.
51+
if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil {
52+
// Building standalone, so fetch all dependencies remotely.
53+
package.dependencies += [
54+
.package(url: "https://github.com/apple/swift-cmark.git", .branch("gfm")),
55+
.package(url: "https://github.com/apple/swift-argument-parser", .upToNextMinor(from: "0.4.4")),
56+
]
57+
} else {
58+
// Building in the Swift.org CI system, so rely on local versions of dependencies.
59+
package.dependencies += [
60+
.package(path: "../swift-cmark-gfm"),
61+
.package(path: "../swift-argument-parser"),
62+
]
63+
}

0 commit comments

Comments
 (0)