Xcode import executable target issues

When importing an executable target for testing purposes, Xcode says the casing in the import is wrong, however it is not.

The module is named Swiftly, importing it as Swiftly results in the error Cannot load module 'swiftly' as 'Swiftly'.

Building it using the Swift CLI however, works perfectly fine, no issues. Also the Swift build using GitHub actions works. Xcode is the only tool that throws this error and denies to build the package.

I've already tried clearing all of Xcode's cache, cloning a clean version of the package, changing the executable name to use upper case, all without any results...

Is this an Xcode issue? Any suggestions for getting this solved?

Also note that changing the import to lower case makes the build work in Xcode, but this then breaks builds using the Swift CLI and GitHub actions, so this is not a solution.

The import:

@testable import Swiftly // Cannot load module 'swiftly' as 'Swiftly'

Package.swift

// swift-tools-version: 5.5

import PackageDescription

let package = Package(
    name: "Swiftly",
    platforms: [
        .macOS(.v10_12),
    ],
    products: [
        .executable(
            name: "swiftly",
            targets: ["Swiftly"]),
    ],
    dependencies: [
        .package(url: "https://github.com/apple/swift-argument-parser", from: "1.0.0"),
        .package(url: "https://github.com/JochenBe/Shell", from: "1.0.0")
    ],
    targets: [
        .executableTarget(
            name: "Swiftly",
            dependencies: [
                .product(name: "ArgumentParser", package: "swift-argument-parser"),
                "Shell"
            ]),
        .testTarget(
            name: "SwiftlyTests",
            dependencies: ["Swiftly"]),
    ]
)
Xcode import executable target issues
 
 
Q