-
Notifications
You must be signed in to change notification settings - Fork 162
Disable traits for imported runtime #878
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
+177
−3
Merged
Changes from 4 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
f8ef6e8
disable traits for runtime
madsodgaard 4d8e66a
change to 6.0
madsodgaard 2ba19b4
Merge branch 'main' into traits
madsodgaard 0e9cf87
use manifests
madsodgaard 843b3ce
back to 5.10
madsodgaard 8e3bf81
swift 5 language mode
madsodgaard 1996230
remove whitespace
madsodgaard 86c7dc4
Update Package.swift
madsodgaard 880d186
update licenseignore
madsodgaard 06ffab8
update format ignore
madsodgaard 9f41cc4
unchecked sendable
madsodgaard 2778ad1
update ignores
madsodgaard 242a461
more updates to ignore files
madsodgaard 74b4704
remove unchecked sendable
madsodgaard 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,167 @@ | ||
| // swift-tools-version:6.0 | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // This source file is part of the SwiftOpenAPIGenerator open source project | ||
| // | ||
| // Copyright (c) 2023 Apple Inc. and the SwiftOpenAPIGenerator project authors | ||
| // Licensed under Apache License v2.0 | ||
| // | ||
| // See LICENSE.txt for license information | ||
| // See CONTRIBUTORS.txt for the list of SwiftOpenAPIGenerator project authors | ||
| // | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
| import Foundation | ||
| import PackageDescription | ||
|
|
||
| // General Swift-settings for all targets. | ||
| var swiftSettings: [SwiftSetting] = [ | ||
| // https://github.com/apple/swift-evolution/blob/main/proposals/0335-existential-any.md | ||
| // Require `any` for existential types. | ||
| .enableUpcomingFeature("ExistentialAny"), .enableExperimentalFeature("StrictConcurrency=complete"), | ||
| ] | ||
|
|
||
| let package = Package( | ||
| name: "swift-openapi-generator", | ||
| platforms: [ | ||
| .macOS(.v10_15), | ||
|
|
||
| // The platforms below are not currently supported for running | ||
| // the generator itself. We include them here to allow the generator | ||
| // to emit a more descriptive compiler error. | ||
| .iOS(.v13), .tvOS(.v13), .watchOS(.v6), .visionOS(.v1), | ||
| ], | ||
| products: [ | ||
| .executable(name: "swift-openapi-generator", targets: ["swift-openapi-generator"]), | ||
| .plugin(name: "OpenAPIGenerator", targets: ["OpenAPIGenerator"]), | ||
| .plugin(name: "OpenAPIGeneratorCommand", targets: ["OpenAPIGeneratorCommand"]), | ||
| .library(name: "_OpenAPIGeneratorCore", targets: ["_OpenAPIGeneratorCore"]), | ||
| ], | ||
| dependencies: [ | ||
|
|
||
| // General algorithms | ||
| .package(url: "https://github.com/apple/swift-algorithms", from: "1.2.0"), | ||
| .package(url: "https://github.com/apple/swift-collections", from: "1.1.4"), | ||
|
|
||
| // Read OpenAPI documents | ||
| .package(url: "https://github.com/mattpolzin/OpenAPIKit", from: "3.9.0"), | ||
| .package(url: "https://github.com/jpsim/Yams", "4.0.0"..<"7.0.0"), | ||
|
|
||
| // CLI Tool | ||
| .package(url: "https://github.com/apple/swift-argument-parser", from: "1.3.0"), | ||
|
|
||
| // Tests-only: Runtime library linked by generated code, and also | ||
| // helps keep the runtime library new enough to work with the generated | ||
| // code. | ||
| .package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.11.0"), | ||
| .package(url: "https://github.com/apple/swift-http-types", from: "1.0.2"), | ||
| ], | ||
| targets: [ | ||
|
|
||
| // Generator Core | ||
| .target( | ||
| name: "_OpenAPIGeneratorCore", | ||
| dependencies: [ | ||
| .product(name: "OpenAPIKit", package: "OpenAPIKit"), | ||
| .product(name: "OpenAPIKit30", package: "OpenAPIKit"), | ||
| .product(name: "OpenAPIKitCompat", package: "OpenAPIKit"), | ||
| .product(name: "Algorithms", package: "swift-algorithms"), | ||
| .product(name: "OrderedCollections", package: "swift-collections"), | ||
| .product(name: "Yams", package: "Yams"), | ||
| ], | ||
| swiftSettings: swiftSettings | ||
| ), | ||
|
|
||
| // Generator Core Tests | ||
| .testTarget( | ||
| name: "OpenAPIGeneratorCoreTests", | ||
| dependencies: ["_OpenAPIGeneratorCore"], | ||
| swiftSettings: swiftSettings | ||
| ), | ||
|
|
||
| // GeneratorReferenceTests | ||
| .testTarget( | ||
| name: "OpenAPIGeneratorReferenceTests", | ||
| dependencies: ["_OpenAPIGeneratorCore"], | ||
| resources: [.copy("Resources")], | ||
| swiftSettings: swiftSettings | ||
| ), | ||
|
|
||
| // Common types for concrete PetstoreConsumer*Tests test targets. | ||
| .target( | ||
| name: "PetstoreConsumerTestCore", | ||
| dependencies: [ | ||
| .product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"), | ||
| .product(name: "HTTPTypes", package: "swift-http-types"), | ||
| ], | ||
| swiftSettings: swiftSettings | ||
| ), | ||
|
|
||
| // PetstoreConsumerTests | ||
| // Builds and tests the reference code from GeneratorReferenceTests | ||
| // to ensure it actually works correctly at runtime. | ||
| .testTarget( | ||
| name: "PetstoreConsumerTests", | ||
| dependencies: ["PetstoreConsumerTestCore"], | ||
| swiftSettings: swiftSettings | ||
| ), | ||
|
|
||
| // Test Target for swift-openapi-generator | ||
| .testTarget( | ||
| name: "OpenAPIGeneratorTests", | ||
| dependencies: [ | ||
| "_OpenAPIGeneratorCore", | ||
| // Everything except windows: https://github.com/swiftlang/swift-package-manager/issues/6367 | ||
| .target( | ||
| name: "swift-openapi-generator", | ||
| condition: .when(platforms: [.android, .linux, .macOS, .openbsd, .wasi, .custom("freebsd")]) | ||
| ), .product(name: "ArgumentParser", package: "swift-argument-parser"), | ||
| ], | ||
| resources: [.copy("Resources")], | ||
| swiftSettings: swiftSettings | ||
| ), | ||
|
|
||
| // Generator CLI | ||
| .executableTarget( | ||
| name: "swift-openapi-generator", | ||
| dependencies: [ | ||
| "_OpenAPIGeneratorCore", .product(name: "ArgumentParser", package: "swift-argument-parser"), | ||
| ], | ||
| swiftSettings: swiftSettings | ||
| ), | ||
|
|
||
| // Build Plugin | ||
| .plugin(name: "OpenAPIGenerator", capability: .buildTool(), dependencies: ["swift-openapi-generator"]), | ||
|
|
||
| // Command Plugin | ||
| .plugin( | ||
| name: "OpenAPIGeneratorCommand", | ||
| capability: .command( | ||
| intent: .custom( | ||
| verb: "generate-code-from-openapi", | ||
| description: "Generate Swift code from an OpenAPI document." | ||
| ), | ||
| permissions: [ | ||
| .writeToPackageDirectory( | ||
| reason: "To write the generated Swift files back into the source directory of the package." | ||
| ) | ||
| ] | ||
| ), | ||
| dependencies: ["swift-openapi-generator"] | ||
| ), | ||
| ] | ||
| ) | ||
|
|
||
| // --- STANDARD CROSS-REPO SETTINGS DO NOT EDIT --- // | ||
| for target in package.targets { | ||
| switch target.type { | ||
| case .regular, .test, .executable: | ||
| var settings = target.swiftSettings ?? [] | ||
| // https://github.com/swiftlang/swift-evolution/blob/main/proposals/0444-member-import-visibility.md | ||
| settings.append(.enableUpcomingFeature("MemberImportVisibility")) | ||
| target.swiftSettings = settings | ||
| case .macro, .plugin, .system, .binary: () // not applicable | ||
| @unknown default: () // we don't know what to do here, do nothing | ||
| } | ||
| }// --- END: STANDARD CROSS-REPO SETTINGS DO NOT EDIT --- // | ||
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.
maincurrently supports 5.10+, but I guess this PR drops support for 5.10 and moves to 6.0. #867 does this as well.Do you want me to revert this to 5.10?