Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .licenseignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
**.md
**.txt
**Package.swift
Package@swift-*.swift
.editorconfig
1 change: 1 addition & 0 deletions .swiftformatignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
**Package.swift
Package@swift-*.swift
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ let package = Package(
platforms: [.macOS(.v10_15), .macCatalyst(.v13), .iOS(.v13), .tvOS(.v13), .watchOS(.v6), .visionOS(.v1)],
products: [.library(name: "OpenAPIURLSession", targets: ["OpenAPIURLSession"])],
dependencies: [
.package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.8.2"),
.package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.11.0", traits: []),
.package(url: "https://github.com/apple/swift-http-types", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-collections", from: "1.0.0"),
],
Expand Down
81 changes: 81 additions & 0 deletions Package@swift-6.0.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
// 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")
]

// Strict concurrency is enabled in CI; use this environment variable to enable it locally.
if ProcessInfo.processInfo.environment["SWIFT_OPENAPI_STRICT_CONCURRENCY"].flatMap(Bool.init) ?? false {
swiftSettings.append(contentsOf: [
.define("SWIFT_OPENAPI_STRICT_CONCURRENCY"), .enableExperimentalFeature("StrictConcurrency"),
])
}

let package = Package(
name: "swift-openapi-urlsession",
platforms: [.macOS(.v10_15), .macCatalyst(.v13), .iOS(.v13), .tvOS(.v13), .watchOS(.v6), .visionOS(.v1)],
products: [.library(name: "OpenAPIURLSession", targets: ["OpenAPIURLSession"])],
dependencies: [
.package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.8.2"),
.package(url: "https://github.com/apple/swift-http-types", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-collections", from: "1.0.0"),
],
targets: [
.target(
name: "OpenAPIURLSession",
dependencies: [
.product(name: "DequeModule", package: "swift-collections"),
.product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"),
.product(name: "HTTPTypes", package: "swift-http-types"),
],
swiftSettings: swiftSettings
),
.testTarget(
name: "OpenAPIURLSessionTests",
dependencies: ["OpenAPIURLSession"],
swiftSettings: swiftSettings
),
]
)

#if !os(Windows) // NIO not yet supported on Windows
// Test-only dependencies.
package.dependencies += [.package(url: "https://github.com/apple/swift-nio", from: "2.62.0")]
package.targets.forEach { target in
if target.name == "OpenAPIURLSessionTests" {
target.dependencies += [.product(name: "NIOTestUtils", package: "swift-nio")]
}
}
#endif

// --- 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 --- //
Loading