#!/bin/bash ##===----------------------------------------------------------------------===## ## ## This source file is part of the SwiftNIO open source project ## ## Copyright (c) 2023 Apple Inc. and the SwiftNIO project authors ## Licensed under Apache License v2.0 ## ## See LICENSE.txt for license information ## See CONTRIBUTORS.txt for the list of SwiftNIO project authors ## ## SPDX-License-Identifier: Apache-2.0 ## ##===----------------------------------------------------------------------===## set -euo pipefail log() { printf -- "** %s\n" "$*" >&2; } error() { printf -- "** ERROR: %s\n" "$*" >&2; } fatal() { error "$@"; exit 1; } log "Editing Package.swift..." cat <> "Package.swift" package.dependencies.append( .package(url: "https://github.com/apple/swift-docc-plugin", "1.0.0"..<"1.4.0") ) EOF log "Checking documentation targets..." for target in $(yq -r '.builder.configs[].documentation_targets[]' .spi.yml); do log "Checking target $target..." swift package plugin generate-documentation --target "$target" --warnings-as-errors --analyze --level detailed done log "✅ Found no documentation issues."