-
Notifications
You must be signed in to change notification settings - Fork 698
initial adoption of DocC based documentaiton #2235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
// swift-tools-version:5.4 | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// This source file is part of the SwiftNIO open source project | ||
// | ||
// Copyright (c) 2017-2021 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 | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
import PackageDescription | ||
|
||
let swiftAtomics: PackageDescription.Target.Dependency = .product(name: "Atomics", package: "swift-atomics") | ||
let swiftCollections: PackageDescription.Target.Dependency = .product(name: "DequeModule", package: "swift-collections") | ||
|
||
var targets: [PackageDescription.Target] = [ | ||
.target(name: "NIOCore", | ||
dependencies: ["NIOConcurrencyHelpers", "CNIOLinux", "CNIOWindows", swiftCollections]), | ||
.target(name: "_NIODataStructures"), | ||
.target(name: "NIOEmbedded", | ||
dependencies: ["NIOCore", | ||
"NIOConcurrencyHelpers", | ||
"_NIODataStructures", | ||
swiftAtomics]), | ||
.target(name: "NIOPosix", | ||
dependencies: ["CNIOLinux", | ||
"CNIODarwin", | ||
"CNIOWindows", | ||
"NIOConcurrencyHelpers", | ||
"NIOCore", | ||
"_NIODataStructures", | ||
swiftAtomics]), | ||
.target(name: "NIO", | ||
dependencies: ["NIOCore", | ||
"NIOEmbedded", | ||
"NIOPosix"]), | ||
.target(name: "_NIOConcurrency", | ||
dependencies: ["NIO", "NIOCore"]), | ||
.target(name: "_NIOBeta", | ||
dependencies: ["NIOCore"]), | ||
.target(name: "NIOFoundationCompat", dependencies: ["NIO", "NIOCore"]), | ||
.target(name: "CNIOAtomics", dependencies: []), | ||
.target(name: "CNIOSHA1", dependencies: []), | ||
.target(name: "CNIOLinux", dependencies: []), | ||
.target(name: "CNIODarwin", dependencies: [], cSettings: [.define("__APPLE_USE_RFC_3542")]), | ||
.target(name: "CNIOWindows", dependencies: []), | ||
.target(name: "NIOConcurrencyHelpers", | ||
dependencies: ["CNIOAtomics"]), | ||
.target(name: "NIOHTTP1", | ||
dependencies: ["NIO", "NIOCore", "NIOConcurrencyHelpers", "CNIOHTTPParser"]), | ||
.executableTarget(name: "NIOEchoServer", | ||
dependencies: ["NIOPosix", "NIOCore", "NIOConcurrencyHelpers"], | ||
exclude: ["README.md"]), | ||
.executableTarget(name: "NIOEchoClient", | ||
dependencies: ["NIOPosix", "NIOCore", "NIOConcurrencyHelpers"], | ||
exclude: ["README.md"]), | ||
.executableTarget(name: "NIOHTTP1Server", | ||
dependencies: ["NIOPosix", "NIOCore", "NIOHTTP1", "NIOConcurrencyHelpers"], | ||
exclude: ["README.md"]), | ||
.executableTarget(name: "NIOHTTP1Client", | ||
dependencies: ["NIOPosix", "NIOCore", "NIOHTTP1", "NIOConcurrencyHelpers"], | ||
exclude: ["README.md"]), | ||
.target(name: "CNIOHTTPParser"), | ||
.target(name: "NIOTLS", dependencies: ["NIO", "NIOCore"]), | ||
.executableTarget(name: "NIOChatServer", | ||
dependencies: ["NIOPosix", "NIOCore", "NIOConcurrencyHelpers"], | ||
exclude: ["README.md"]), | ||
.executableTarget(name: "NIOChatClient", | ||
dependencies: ["NIOPosix", "NIOCore", "NIOConcurrencyHelpers"], | ||
exclude: ["README.md"]), | ||
.target(name: "NIOWebSocket", | ||
dependencies: ["NIO", "NIOCore", "NIOHTTP1", "CNIOSHA1"]), | ||
.executableTarget(name: "NIOWebSocketServer", | ||
dependencies: ["NIOPosix", "NIOCore", "NIOHTTP1", "NIOWebSocket"], | ||
exclude: ["README.md"]), | ||
.executableTarget(name: "NIOWebSocketClient", | ||
dependencies: ["NIOPosix", "NIOCore", "NIOHTTP1", "NIOWebSocket"], | ||
exclude: ["README.md"]), | ||
.executableTarget(name: "NIOPerformanceTester", | ||
dependencies: ["NIOPosix", "NIOCore", "NIOEmbedded", "NIOHTTP1", "NIOFoundationCompat", "NIOWebSocket"]), | ||
.executableTarget(name: "NIOMulticastChat", | ||
dependencies: ["NIOPosix", "NIOCore"]), | ||
.executableTarget(name: "NIOUDPEchoServer", | ||
dependencies: ["NIOPosix", "NIOCore"], | ||
exclude: ["README.md"]), | ||
.executableTarget(name: "NIOUDPEchoClient", | ||
dependencies: ["NIOPosix", "NIOCore"], | ||
exclude: ["README.md"]), | ||
.target(name: "NIOTestUtils", | ||
dependencies: ["NIOPosix", "NIOCore", "NIOEmbedded", "NIOHTTP1", swiftAtomics]), | ||
.executableTarget(name: "NIOCrashTester", | ||
dependencies: ["NIOPosix", "NIOCore", "NIOEmbedded", "NIOHTTP1", "NIOWebSocket", "NIOFoundationCompat"]), | ||
.executableTarget(name: "NIOAsyncAwaitDemo", | ||
dependencies: ["NIOPosix", "NIOCore", "NIOHTTP1"]), | ||
.testTarget(name: "NIOCoreTests", | ||
dependencies: ["NIOCore", "NIOEmbedded", "NIOFoundationCompat"]), | ||
.testTarget(name: "NIOBetaTests", | ||
dependencies: ["_NIOBeta"]), | ||
.testTarget(name: "NIOEmbeddedTests", | ||
dependencies: ["NIOConcurrencyHelpers", "NIOCore", "NIOEmbedded"]), | ||
.testTarget(name: "NIOPosixTests", | ||
dependencies: ["NIOPosix", "NIOCore", "NIOFoundationCompat", "NIOTestUtils", "NIOConcurrencyHelpers", "NIOEmbedded"]), | ||
.testTarget(name: "NIOConcurrencyHelpersTests", | ||
dependencies: ["NIOConcurrencyHelpers", "NIOCore"]), | ||
.testTarget(name: "NIODataStructuresTests", | ||
dependencies: ["_NIODataStructures"]), | ||
.testTarget(name: "NIOHTTP1Tests", | ||
dependencies: ["NIOCore", "NIOEmbedded", "NIOPosix", "NIOHTTP1", "NIOFoundationCompat", "NIOTestUtils"]), | ||
.testTarget(name: "NIOTLSTests", | ||
dependencies: ["NIOCore", "NIOEmbedded", "NIOTLS", "NIOFoundationCompat"]), | ||
.testTarget(name: "NIOWebSocketTests", | ||
dependencies: ["NIOCore", "NIOEmbedded", "NIOWebSocket"]), | ||
.testTarget(name: "NIOTestUtilsTests", | ||
dependencies: ["NIOTestUtils", "NIOCore", "NIOEmbedded", "NIOPosix"]), | ||
.testTarget(name: "NIOFoundationCompatTests", | ||
dependencies: ["NIOCore", "NIOFoundationCompat"]), | ||
.testTarget(name: "NIOTests", | ||
dependencies: ["NIO"]), | ||
] | ||
|
||
let package = Package( | ||
name: "swift-nio", | ||
products: [ | ||
.library(name: "NIOCore", targets: ["NIOCore"]), | ||
.library(name: "NIO", targets: ["NIO"]), | ||
.library(name: "NIOEmbedded", targets: ["NIOEmbedded"]), | ||
.library(name: "NIOPosix", targets: ["NIOPosix"]), | ||
.library(name: "_NIOConcurrency", targets: ["_NIOConcurrency"]), | ||
.library(name: "_NIOBeta", targets: ["_NIOBeta"]), | ||
.library(name: "NIOTLS", targets: ["NIOTLS"]), | ||
.library(name: "NIOHTTP1", targets: ["NIOHTTP1"]), | ||
.library(name: "NIOConcurrencyHelpers", targets: ["NIOConcurrencyHelpers"]), | ||
.library(name: "NIOFoundationCompat", targets: ["NIOFoundationCompat"]), | ||
.library(name: "NIOWebSocket", targets: ["NIOWebSocket"]), | ||
.library(name: "NIOTestUtils", targets: ["NIOTestUtils"]), | ||
], | ||
dependencies: [ | ||
.package(url: "https://github.com/apple/swift-atomics.git", from: "1.0.2"), | ||
.package(url: "https://github.com/apple/swift-collections.git", from: "1.0.2"), | ||
], | ||
targets: targets | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
// swift-tools-version:5.5 | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// This source file is part of the SwiftNIO open source project | ||
// | ||
// Copyright (c) 2017-2021 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 | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
import PackageDescription | ||
|
||
let swiftAtomics: PackageDescription.Target.Dependency = .product(name: "Atomics", package: "swift-atomics") | ||
let swiftCollections: PackageDescription.Target.Dependency = .product(name: "DequeModule", package: "swift-collections") | ||
|
||
var targets: [PackageDescription.Target] = [ | ||
.target(name: "NIOCore", | ||
dependencies: ["NIOConcurrencyHelpers", "CNIOLinux", "CNIOWindows", swiftCollections]), | ||
.target(name: "_NIODataStructures"), | ||
.target(name: "NIOEmbedded", | ||
dependencies: ["NIOCore", | ||
"NIOConcurrencyHelpers", | ||
"_NIODataStructures", | ||
swiftAtomics]), | ||
.target(name: "NIOPosix", | ||
dependencies: ["CNIOLinux", | ||
"CNIODarwin", | ||
"CNIOWindows", | ||
"NIOConcurrencyHelpers", | ||
"NIOCore", | ||
"_NIODataStructures", | ||
swiftAtomics]), | ||
.target(name: "NIO", | ||
dependencies: ["NIOCore", | ||
"NIOEmbedded", | ||
"NIOPosix"]), | ||
.target(name: "_NIOConcurrency", | ||
dependencies: ["NIO", "NIOCore"]), | ||
.target(name: "_NIOBeta", | ||
dependencies: ["NIOCore"]), | ||
.target(name: "NIOFoundationCompat", dependencies: ["NIO", "NIOCore"]), | ||
.target(name: "CNIOAtomics", dependencies: []), | ||
.target(name: "CNIOSHA1", dependencies: []), | ||
.target(name: "CNIOLinux", dependencies: []), | ||
.target(name: "CNIODarwin", dependencies: [], cSettings: [.define("__APPLE_USE_RFC_3542")]), | ||
.target(name: "CNIOWindows", dependencies: []), | ||
.target(name: "NIOConcurrencyHelpers", | ||
dependencies: ["CNIOAtomics"]), | ||
.target(name: "NIOHTTP1", | ||
dependencies: ["NIO", "NIOCore", "NIOConcurrencyHelpers", "CNIOHTTPParser"]), | ||
.executableTarget(name: "NIOEchoServer", | ||
dependencies: ["NIOPosix", "NIOCore", "NIOConcurrencyHelpers"], | ||
exclude: ["README.md"]), | ||
.executableTarget(name: "NIOEchoClient", | ||
dependencies: ["NIOPosix", "NIOCore", "NIOConcurrencyHelpers"], | ||
exclude: ["README.md"]), | ||
.executableTarget(name: "NIOHTTP1Server", | ||
dependencies: ["NIOPosix", "NIOCore", "NIOHTTP1", "NIOConcurrencyHelpers"], | ||
exclude: ["README.md"]), | ||
.executableTarget(name: "NIOHTTP1Client", | ||
dependencies: ["NIOPosix", "NIOCore", "NIOHTTP1", "NIOConcurrencyHelpers"], | ||
exclude: ["README.md"]), | ||
.target(name: "CNIOHTTPParser"), | ||
.target(name: "NIOTLS", dependencies: ["NIO", "NIOCore"]), | ||
.executableTarget(name: "NIOChatServer", | ||
dependencies: ["NIOPosix", "NIOCore", "NIOConcurrencyHelpers"], | ||
exclude: ["README.md"]), | ||
.executableTarget(name: "NIOChatClient", | ||
dependencies: ["NIOPosix", "NIOCore", "NIOConcurrencyHelpers"], | ||
exclude: ["README.md"]), | ||
.target(name: "NIOWebSocket", | ||
dependencies: ["NIO", "NIOCore", "NIOHTTP1", "CNIOSHA1"]), | ||
.executableTarget(name: "NIOWebSocketServer", | ||
dependencies: ["NIOPosix", "NIOCore", "NIOHTTP1", "NIOWebSocket"], | ||
exclude: ["README.md"]), | ||
.executableTarget(name: "NIOWebSocketClient", | ||
dependencies: ["NIOPosix", "NIOCore", "NIOHTTP1", "NIOWebSocket"], | ||
exclude: ["README.md"]), | ||
.executableTarget(name: "NIOPerformanceTester", | ||
dependencies: ["NIOPosix", "NIOCore", "NIOEmbedded", "NIOHTTP1", "NIOFoundationCompat", "NIOWebSocket"]), | ||
.executableTarget(name: "NIOMulticastChat", | ||
dependencies: ["NIOPosix", "NIOCore"]), | ||
.executableTarget(name: "NIOUDPEchoServer", | ||
dependencies: ["NIOPosix", "NIOCore"], | ||
exclude: ["README.md"]), | ||
.executableTarget(name: "NIOUDPEchoClient", | ||
dependencies: ["NIOPosix", "NIOCore"], | ||
exclude: ["README.md"]), | ||
.target(name: "NIOTestUtils", | ||
dependencies: ["NIOPosix", "NIOCore", "NIOEmbedded", "NIOHTTP1", swiftAtomics]), | ||
.executableTarget(name: "NIOCrashTester", | ||
dependencies: ["NIOPosix", "NIOCore", "NIOEmbedded", "NIOHTTP1", "NIOWebSocket", "NIOFoundationCompat"]), | ||
.executableTarget(name: "NIOAsyncAwaitDemo", | ||
dependencies: ["NIOPosix", "NIOCore", "NIOHTTP1"]), | ||
.testTarget(name: "NIOCoreTests", | ||
dependencies: ["NIOCore", "NIOEmbedded", "NIOFoundationCompat"]), | ||
.testTarget(name: "NIOBetaTests", | ||
dependencies: ["_NIOBeta"]), | ||
.testTarget(name: "NIOEmbeddedTests", | ||
dependencies: ["NIOConcurrencyHelpers", "NIOCore", "NIOEmbedded"]), | ||
.testTarget(name: "NIOPosixTests", | ||
dependencies: ["NIOPosix", "NIOCore", "NIOFoundationCompat", "NIOTestUtils", "NIOConcurrencyHelpers", "NIOEmbedded"]), | ||
.testTarget(name: "NIOConcurrencyHelpersTests", | ||
dependencies: ["NIOConcurrencyHelpers", "NIOCore"]), | ||
.testTarget(name: "NIODataStructuresTests", | ||
dependencies: ["_NIODataStructures"]), | ||
.testTarget(name: "NIOHTTP1Tests", | ||
dependencies: ["NIOCore", "NIOEmbedded", "NIOPosix", "NIOHTTP1", "NIOFoundationCompat", "NIOTestUtils"]), | ||
.testTarget(name: "NIOTLSTests", | ||
dependencies: ["NIOCore", "NIOEmbedded", "NIOTLS", "NIOFoundationCompat"]), | ||
.testTarget(name: "NIOWebSocketTests", | ||
dependencies: ["NIOCore", "NIOEmbedded", "NIOWebSocket"]), | ||
.testTarget(name: "NIOTestUtilsTests", | ||
dependencies: ["NIOTestUtils", "NIOCore", "NIOEmbedded", "NIOPosix"]), | ||
.testTarget(name: "NIOFoundationCompatTests", | ||
dependencies: ["NIOCore", "NIOFoundationCompat"]), | ||
.testTarget(name: "NIOTests", | ||
dependencies: ["NIO"]), | ||
] | ||
|
||
let package = Package( | ||
name: "swift-nio", | ||
products: [ | ||
.library(name: "NIOCore", targets: ["NIOCore"]), | ||
.library(name: "NIO", targets: ["NIO"]), | ||
.library(name: "NIOEmbedded", targets: ["NIOEmbedded"]), | ||
.library(name: "NIOPosix", targets: ["NIOPosix"]), | ||
.library(name: "_NIOConcurrency", targets: ["_NIOConcurrency"]), | ||
.library(name: "_NIOBeta", targets: ["_NIOBeta"]), | ||
.library(name: "NIOTLS", targets: ["NIOTLS"]), | ||
.library(name: "NIOHTTP1", targets: ["NIOHTTP1"]), | ||
.library(name: "NIOConcurrencyHelpers", targets: ["NIOConcurrencyHelpers"]), | ||
.library(name: "NIOFoundationCompat", targets: ["NIOFoundationCompat"]), | ||
.library(name: "NIOWebSocket", targets: ["NIOWebSocket"]), | ||
.library(name: "NIOTestUtils", targets: ["NIOTestUtils"]), | ||
], | ||
dependencies: [ | ||
.package(url: "https://github.com/apple/swift-atomics.git", from: "1.0.2"), | ||
.package(url: "https://github.com/apple/swift-collections.git", from: "1.0.2"), | ||
], | ||
targets: targets | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strangely, this change now requires that
--enable-test-discovery
be passed when compiling the tests on linux/Android, or it errors like this with 5.6, 5.7, and trunk:Anyone know what's going on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is a bug in SwiftPM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, I'll file a bug for SPM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Lukasa Now that NIO supports 5.4 as a minimum can LinuxMain.swift not just be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sadly no. NIO tests with
--warnings-as-errors
, and we have number of tests for deprecated code. The test discovery stubs in SwiftPM generate warnings when those tests are present up until 5.6, which is why our CI continues to useLinuxMain.swift
for 5.4 and 5.5. But we are at least finally on a path to dropping it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filed, swiftlang/swift-package-manager#5717.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be fixed in 5.7 and main. but perhaps not available in the nightly toolchain yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is fixed with the latest Aug. 9 trunk snapshot build for linux, but I'm using a June trunk snapshot because of another breaking regression for me. As you noted in that issue, should only be a problem with 5.6 now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea will be hard to justify pulling into 5.6 given workaround.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which workaround? Adding @main is a non-starter if someone is testing 5.3 and earlier, when the attribute wasn't there, swiftlang/swift@df99de8. As for overriding it with
--enable-test-discovery
, adding that only for 5.6.3 for all future CI testing is going to be annoying and has other consequences.