Skip to content

Commit 8fc79ca

Browse files
heckjktoso
andauthored
minimal DocC markdown to order Logger.Levels (apple#225)
* minimal DocC markdown to order Logger.Levels Motivation: When viewed in documentation generated by DocC, the enumeration levels are ordered alphabetically, removintg the implied ordering in the source. The written overview of the enum relies on that ordering to make sense. Modifications: Adding a single file that provides structure to Logging/Logger/Levels within DocC generated documentation. Result: When imported into a project that leverages Swift 5.6 (such as Vapor), the generated documentation for the levels provided by Logging/Logger/Levels are displayed in the order intended/expected by the documentation. * Adding a Swift 5.6 version of Package.swift Motivation: Per DocC team, an updated version is required for the DocC changes to be picked up and reflected in generated dcumentation, even for upstream projects already using swift 5.6 or later. Modifications: Adding [email protected] with the swift version updated. Result: Hopefully, documentation updates in DocC generated content will be reflected. * Updating linuxmain test generation for <swift5.6 Motivation: To appease CI, added #if statements into generated LinuxMain content to handle conditional compilation with Swift 5.6 and later. Modifications: Added #if statements to test generating script and re-ran the script Result: CI will hopefully pass. * also guard the LinuxMain file * Force using test discovery on 5.6+ even though tools version is latest but LinuxMain exists * cleanup * simplify docc links * formatting revert * ignore Package-swift5.6.swift from soundness license check Co-authored-by: Konrad `ktoso` Malawski <[email protected]>
1 parent f2e8667 commit 8fc79ca

File tree

7 files changed

+54
-5
lines changed

7 files changed

+54
-5
lines changed

[email protected]

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// swift-tools-version:5.6
2+
//===----------------------------------------------------------------------===//
3+
//
4+
// This source file is part of the Swift Logging API open source project
5+
//
6+
// Copyright (c) 2018-2019 Apple Inc. and the Swift Logging API project authors
7+
// Licensed under Apache License v2.0
8+
//
9+
// See LICENSE.txt for license information
10+
// See CONTRIBUTORS.txt for the list of Swift Logging API project authors
11+
//
12+
// SPDX-License-Identifier: Apache-2.0
13+
//
14+
//===----------------------------------------------------------------------===//
15+
16+
import PackageDescription
17+
18+
let package = Package(
19+
name: "swift-log",
20+
products: [
21+
.library(name: "Logging", targets: ["Logging"]),
22+
],
23+
targets: [
24+
.target(
25+
name: "Logging",
26+
dependencies: []
27+
),
28+
.testTarget(
29+
name: "LoggingTests",
30+
dependencies: ["Logging"]
31+
),
32+
]
33+
)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# ``Logging/Logger/Level``
2+
3+
## Topics
4+
5+
### Log levels
6+
7+
- ``trace``
8+
- ``debug``
9+
- ``info``
10+
- ``notice``
11+
- ``warning``
12+
- ``error``
13+
- ``critical``

docker/docker-compose.2004.56.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ services:
1111

1212
test:
1313
image: swift-log:20.04-5.6
14-
environment: []
14+
environment:
15+
- FORCE_TEST_DISCOVERY=--enable-test-discovery
1516
#- SANITIZER_ARG=--sanitize=thread
1617

1718
shell:

docker/docker-compose.2004.57.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ services:
1010

1111
test:
1212
image: swift-log:20.04-5.7
13-
environment: []
13+
environment:
14+
- FORCE_TEST_DISCOVERY=--enable-test-discovery
1415
#- SANITIZER_ARG=--sanitize=thread
1516

1617
shell:

docker/docker-compose.2004.main.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ services:
1010

1111
test:
1212
image: swift-log:20.04-main
13-
environment: []
13+
environment:
14+
- FORCE_TEST_DISCOVERY=--enable-test-discovery
1415
#- SANITIZER_ARG=--sanitize=thread
1516

1617
shell:

docker/docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ services:
2828

2929
test:
3030
<<: *common
31-
command: /bin/bash -xcl "swift test -Xswiftc -warnings-as-errors $${SANITIZER_ARG-}"
31+
command: /bin/bash -xcl "swift test -Xswiftc -warnings-as-errors $${FORCE_TEST_DISCOVERY-} $${SANITIZER_ARG-}"
3232

3333
# util
3434

scripts/soundness.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ for language in swift-or-c bash dtrace; do
8686
matching_files=( -name '*' )
8787
case "$language" in
8888
swift-or-c)
89-
exceptions=( -name c_nio_http_parser.c -o -name c_nio_http_parser.h -o -name cpp_magic.h -o -name Package.swift -o -name CNIOSHA1.h -o -name c_nio_sha1.c -o -name ifaddrs-android.c -o -name ifaddrs-android.h)
89+
exceptions=( -name c_nio_http_parser.c -o -name c_nio_http_parser.h -o -name cpp_magic.h -o -name Package.swift -o name Package-swift5.6.swift -o -name CNIOSHA1.h -o -name c_nio_sha1.c -o -name ifaddrs-android.c -o -name ifaddrs-android.h)
9090
matching_files=( -name '*.swift' -o -name '*.c' -o -name '*.h' )
9191
cat > "$tmp" <<"EOF"
9292
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)