(Xcode 15b1)
I'm trying to create a client SDK for a project I'm working on, and would love to leverage the OpenAPI generator to do it. Following the instructions here, I’m running into errors in Xcode 15b1.
In particular, I get “No config found in the target named 'SwiftClientSDK'. Add a file called 'openapi-generator-config.yaml' to the target's source directory,” but my source directory looks like this:
$ tree
.
├── Package.resolved
├── Package.swift
├── Sources
│ └── SwiftClientSDK
│ ├── OpenAPI.yaml
│ ├── SwiftClientSDK.swift
│ └── openapi-generator-config.yaml
└── Tests
└── SwiftClientSDKTests
└── SwiftClientSDKTests.swift
My Package.swift:
// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "SwiftClientSDK",
platforms:[
.macOS(.v13), .iOS(.v16), .tvOS(.v16), .watchOS(.v9),
],
products:[
.library(name: "SwiftClientSDK", targets: ["SwiftClientSDK"]),
],
dependencies:[
.package(url: "https://github.com/apple/swift-openapi-generator", .upToNextMinor(from: "0.1.0")),
.package(url: "https://github.com/apple/swift-openapi-runtime", .upToNextMinor(from: "0.1.0")),
.package(url: "https://github.com/apple/swift-openapi-urlsession", .upToNextMinor(from: "0.1.0")),
],
targets: [
.target(
name: "SwiftClientSDK",
dependencies:[
.product(name: "OpenAPIRuntime", package: "swift-openapi-runtime" ),
.product(name: "OpenAPIURLSession", package: "swift-openapi-urlsession"),
],
plugins:[
.plugin(name: "OpenAPIGenerator", package: "swift-openapi-generator")
]
),
.testTarget(name: "SwiftClientSDKTests", dependencies: ["SwiftClientSDK"]),
]
)
In Xcode, the error looks like this. I don't know the values of ${BUILD_DIR}
or ${CONFIGURATION}
:
Showing All Messages
working directory:
/Users/rmann/Projects/Personal/SwiftClientSDK
tool mapping:
swift-openapi-generator: /${BUILD_DIR}/${CONFIGURATION}/swift-openapi-generator
tool search paths:
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
/Applications/Xcode-beta.app/Contents/Developer/usr/bin
/bin
/sbin
/usr/bin
/usr/sbin
No config found in the target named 'SwiftClientSDK'. Add a file called 'openapi-generator-config.yaml' to the target's source directory. See documentation for details.
No config found in the target named 'SwiftClientSDK'. Add a file called 'openapi-generator-config.yaml' to the target's source directory. See documentation for details.