From a8e1148aa548cf66a619b172082c033f069b8c46 Mon Sep 17 00:00:00 2001 From: Konrad `ktoso` Malawski Date: Tue, 23 Aug 2022 18:29:56 +0900 Subject: [PATCH] =docc Move to multiple Package.swift files (#231) * +docc prepare for docc docs * fix syntax in one of the package files * ignore package.resolved --- .gitignore | 1 + Package.swift | 5 ++- Package@swift-5.0.swift | 33 +++++++++++++++++++ Package@swift-5.1.swift | 33 +++++++++++++++++++ Package@swift-5.2.swift | 33 +++++++++++++++++++ Package@swift-5.3.swift | 33 +++++++++++++++++++ Package@swift-5.4.swift | 33 +++++++++++++++++++ Package@swift-5.5.swift | 33 +++++++++++++++++++ .../LoggerLevel.md | 0 .../index.md | 0 docker/docker-compose.2004.55.yaml | 3 +- scripts/preview_docc.sh | 16 +++++++++ 12 files changed, 221 insertions(+), 2 deletions(-) create mode 100644 Package@swift-5.0.swift create mode 100644 Package@swift-5.1.swift create mode 100644 Package@swift-5.2.swift create mode 100644 Package@swift-5.3.swift create mode 100644 Package@swift-5.4.swift create mode 100644 Package@swift-5.5.swift rename Sources/Logging/{Documentation.docc => Docs.docc}/LoggerLevel.md (100%) rename Sources/Logging/{Documentation.docc => Docs.docc}/index.md (100%) create mode 100755 scripts/preview_docc.sh diff --git a/.gitignore b/.gitignore index e5640f6..dc5cdca 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .DS_Store +Package.resolved /.build /Packages /*.xcodeproj diff --git a/Package.swift b/Package.swift index efc6ef4..c5cf4c3 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.0 +// swift-tools-version:5.7 //===----------------------------------------------------------------------===// // // This source file is part of the Swift Logging API open source project @@ -20,6 +20,9 @@ let package = Package( products: [ .library(name: "Logging", targets: ["Logging"]), ], + dependencies: [ + .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"), + ], targets: [ .target( name: "Logging", diff --git a/Package@swift-5.0.swift b/Package@swift-5.0.swift new file mode 100644 index 0000000..efc6ef4 --- /dev/null +++ b/Package@swift-5.0.swift @@ -0,0 +1,33 @@ +// swift-tools-version:5.0 +//===----------------------------------------------------------------------===// +// +// This source file is part of the Swift Logging API open source project +// +// Copyright (c) 2018-2019 Apple Inc. and the Swift Logging API project authors +// Licensed under Apache License v2.0 +// +// See LICENSE.txt for license information +// See CONTRIBUTORS.txt for the list of Swift Logging API project authors +// +// SPDX-License-Identifier: Apache-2.0 +// +//===----------------------------------------------------------------------===// + +import PackageDescription + +let package = Package( + name: "swift-log", + products: [ + .library(name: "Logging", targets: ["Logging"]), + ], + targets: [ + .target( + name: "Logging", + dependencies: [] + ), + .testTarget( + name: "LoggingTests", + dependencies: ["Logging"] + ), + ] +) diff --git a/Package@swift-5.1.swift b/Package@swift-5.1.swift new file mode 100644 index 0000000..139f060 --- /dev/null +++ b/Package@swift-5.1.swift @@ -0,0 +1,33 @@ +// swift-tools-version:5.1 +//===----------------------------------------------------------------------===// +// +// This source file is part of the Swift Logging API open source project +// +// Copyright (c) 2018-2019 Apple Inc. and the Swift Logging API project authors +// Licensed under Apache License v2.0 +// +// See LICENSE.txt for license information +// See CONTRIBUTORS.txt for the list of Swift Logging API project authors +// +// SPDX-License-Identifier: Apache-2.0 +// +//===----------------------------------------------------------------------===// + +import PackageDescription + +let package = Package( + name: "swift-log", + products: [ + .library(name: "Logging", targets: ["Logging"]), + ], + targets: [ + .target( + name: "Logging", + dependencies: [] + ), + .testTarget( + name: "LoggingTests", + dependencies: ["Logging"] + ), + ] +) diff --git a/Package@swift-5.2.swift b/Package@swift-5.2.swift new file mode 100644 index 0000000..dda50c8 --- /dev/null +++ b/Package@swift-5.2.swift @@ -0,0 +1,33 @@ +// swift-tools-version:5.2 +//===----------------------------------------------------------------------===// +// +// This source file is part of the Swift Logging API open source project +// +// Copyright (c) 2018-2019 Apple Inc. and the Swift Logging API project authors +// Licensed under Apache License v2.0 +// +// See LICENSE.txt for license information +// See CONTRIBUTORS.txt for the list of Swift Logging API project authors +// +// SPDX-License-Identifier: Apache-2.0 +// +//===----------------------------------------------------------------------===// + +import PackageDescription + +let package = Package( + name: "swift-log", + products: [ + .library(name: "Logging", targets: ["Logging"]), + ], + targets: [ + .target( + name: "Logging", + dependencies: [] + ), + .testTarget( + name: "LoggingTests", + dependencies: ["Logging"] + ), + ] +) diff --git a/Package@swift-5.3.swift b/Package@swift-5.3.swift new file mode 100644 index 0000000..fef373c --- /dev/null +++ b/Package@swift-5.3.swift @@ -0,0 +1,33 @@ +// swift-tools-version:5.3 +//===----------------------------------------------------------------------===// +// +// This source file is part of the Swift Logging API open source project +// +// Copyright (c) 2018-2019 Apple Inc. and the Swift Logging API project authors +// Licensed under Apache License v2.0 +// +// See LICENSE.txt for license information +// See CONTRIBUTORS.txt for the list of Swift Logging API project authors +// +// SPDX-License-Identifier: Apache-2.0 +// +//===----------------------------------------------------------------------===// + +import PackageDescription + +let package = Package( + name: "swift-log", + products: [ + .library(name: "Logging", targets: ["Logging"]), + ], + targets: [ + .target( + name: "Logging", + dependencies: [] + ), + .testTarget( + name: "LoggingTests", + dependencies: ["Logging"] + ), + ] +) diff --git a/Package@swift-5.4.swift b/Package@swift-5.4.swift new file mode 100644 index 0000000..62d6619 --- /dev/null +++ b/Package@swift-5.4.swift @@ -0,0 +1,33 @@ +// swift-tools-version:5.4 +//===----------------------------------------------------------------------===// +// +// This source file is part of the Swift Logging API open source project +// +// Copyright (c) 2018-2019 Apple Inc. and the Swift Logging API project authors +// Licensed under Apache License v2.0 +// +// See LICENSE.txt for license information +// See CONTRIBUTORS.txt for the list of Swift Logging API project authors +// +// SPDX-License-Identifier: Apache-2.0 +// +//===----------------------------------------------------------------------===// + +import PackageDescription + +let package = Package( + name: "swift-log", + products: [ + .library(name: "Logging", targets: ["Logging"]), + ], + targets: [ + .target( + name: "Logging", + dependencies: [] + ), + .testTarget( + name: "LoggingTests", + dependencies: ["Logging"] + ), + ] +) diff --git a/Package@swift-5.5.swift b/Package@swift-5.5.swift new file mode 100644 index 0000000..0e5813a --- /dev/null +++ b/Package@swift-5.5.swift @@ -0,0 +1,33 @@ +// swift-tools-version:5.5 +//===----------------------------------------------------------------------===// +// +// This source file is part of the Swift Logging API open source project +// +// Copyright (c) 2018-2019 Apple Inc. and the Swift Logging API project authors +// Licensed under Apache License v2.0 +// +// See LICENSE.txt for license information +// See CONTRIBUTORS.txt for the list of Swift Logging API project authors +// +// SPDX-License-Identifier: Apache-2.0 +// +//===----------------------------------------------------------------------===// + +import PackageDescription + +let package = Package( + name: "swift-log", + products: [ + .library(name: "Logging", targets: ["Logging"]), + ], + targets: [ + .target( + name: "Logging", + dependencies: [] + ), + .testTarget( + name: "LoggingTests", + dependencies: ["Logging"] + ), + ] +) diff --git a/Sources/Logging/Documentation.docc/LoggerLevel.md b/Sources/Logging/Docs.docc/LoggerLevel.md similarity index 100% rename from Sources/Logging/Documentation.docc/LoggerLevel.md rename to Sources/Logging/Docs.docc/LoggerLevel.md diff --git a/Sources/Logging/Documentation.docc/index.md b/Sources/Logging/Docs.docc/index.md similarity index 100% rename from Sources/Logging/Documentation.docc/index.md rename to Sources/Logging/Docs.docc/index.md diff --git a/docker/docker-compose.2004.55.yaml b/docker/docker-compose.2004.55.yaml index 15771f9..bd2716c 100644 --- a/docker/docker-compose.2004.55.yaml +++ b/docker/docker-compose.2004.55.yaml @@ -11,7 +11,8 @@ services: test: image: swift-log:20.04-5.5 - environment: [] + environment: + - FORCE_TEST_DISCOVERY=--enable-test-discovery #- SANITIZER_ARG=--sanitize=thread shell: diff --git a/scripts/preview_docc.sh b/scripts/preview_docc.sh new file mode 100755 index 0000000..b546467 --- /dev/null +++ b/scripts/preview_docc.sh @@ -0,0 +1,16 @@ +#!/bin/bash +##===----------------------------------------------------------------------===## +## +## This source file is part of the Swift Logging API open source project +## +## Copyright (c) 2018-2019 Apple Inc. and the Swift Logging API project authors +## Licensed under Apache License v2.0 +## +## See LICENSE.txt for license information +## See CONTRIBUTORS.md for the list of Swift Logging API project authors +## +## SPDX-License-Identifier: Apache-2.0 +## +##===----------------------------------------------------------------------===## + +xcrun swift package --disable-sandbox preview-documentation --target Logging