Skip to content

Commit 5ec1558

Browse files
committed
dynamcly add the swift docc plugin to generate the doc
1 parent c615932 commit 5ec1558

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

Makefile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@ preview-docs:
99

1010
# https://build-on-aws.github.io/swift-bedrock-library/documentation/bedrockservice/
1111
generate-docs:
12+
# Dynamically add the swift-docc-plugin for doc generation
13+
cp Package.swift Package.swift.bak
14+
for manifest in Package.swift Package@*.swift ; do \
15+
if [[ -f "$$manifest" ]] && ! grep -E -i "https://github.com/(apple|swiftlang)/swift-docc-plugin" "$$manifest" ; then \
16+
echo "package.dependencies.append(" >> "$$manifest" ; \
17+
echo " .package(url: \"https://github.com/swiftlang/swift-docc-plugin\", from: \"1.4.5\")" >> "$$manifest" ; \
18+
echo ")" >> "$$manifest" ; \
19+
fi ; \
20+
done
21+
1222
touch .nojekyll
1323
swift package \
1424
--allow-writing-to-directory ./docs \
@@ -17,4 +27,6 @@ generate-docs:
1727
--disable-indexing \
1828
--transform-for-static-hosting \
1929
--hosting-base-path swift-bedrock-library \
20-
--output-path ./docs
30+
--output-path ./docs
31+
32+
mv Package.swift.bak Package.swift

Package.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ let package = Package(
1515
.package(url: "https://github.com/smithy-lang/smithy-swift", from: "0.158.0"),
1616
.package(url: "https://github.com/apple/swift-log.git", from: "1.6.4"),
1717
.package(url: "https://github.com/awslabs/aws-crt-swift", from: "0.53.0"),
18-
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
1918
],
2019
targets: [
2120
.target(

0 commit comments

Comments
 (0)