From d18b72fc9d082a6338ac2ced56427f45236a8495 Mon Sep 17 00:00:00 2001 From: Abizer Nasir Date: Sat, 4 Jun 2022 16:07:45 +0100 Subject: [PATCH] Add support for Swift Package Index document generation See - https://blog.swiftpackageindex.com/posts/auto-generating-auto-hosting-and-auto-updating-docc-documentation/ --- .spi.yml | 4 ++++ Package.resolved | 14 ++++++++++++++ Package.swift | 9 ++++++++- 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 .spi.yml create mode 100644 Package.resolved diff --git a/.spi.yml b/.spi.yml new file mode 100644 index 0000000..f546175 --- /dev/null +++ b/.spi.yml @@ -0,0 +1,4 @@ +version: 1 +builder: + configs: + - documentation_targets: ["CachedAsyncImage"] \ No newline at end of file diff --git a/Package.resolved b/Package.resolved new file mode 100644 index 0000000..528fbc1 --- /dev/null +++ b/Package.resolved @@ -0,0 +1,14 @@ +{ + "pins" : [ + { + "identity" : "swift-docc-plugin", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-docc-plugin", + "state" : { + "revision" : "3303b164430d9a7055ba484c8ead67a52f7b74f6", + "version" : "1.0.0" + } + } + ], + "version" : 2 +} diff --git a/Package.swift b/Package.swift index 057af94..1e65dcb 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.5 +// swift-tools-version:5.6 import PackageDescription @@ -19,3 +19,10 @@ let package = Package( .target(name: "CachedAsyncImage") ] ) + +#if swift(>=5.6) +// Add the documentation compiler plugin if possible +package.dependencies.append( + .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0") +) +#endif