-
Notifications
You must be signed in to change notification settings - Fork 19
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
Catalyst support #34
Comments
@dvkch Thank you for reporting this issue. I found that it is possible to build using the workaround below, but it does not solve the fundamental problem. @main
struct PrepareLicenseList: BuildToolPlugin {
// ...
// This command works with the plugin specified in `Package.swift`.
func createBuildCommands(context: PluginContext, target: Target) async throws -> [Command] {
+ var executablePath = try context.tool(named: "spp").path
+ .removingLastComponent()
+ .removingLastComponent()
+ .appending(["Debug-maccatalyst", "spp"])
return [
makeBuildCommand(
+ executablePath: executablePath,
sourcePackagesPath: try sourcePackages(context.pluginWorkDirectory),
outputPath: context.pluginWorkDirectory
)
]
}
} https://github.com/cybozu/LicenseList/blob/support-catalyst/Plugins/PrepareLicenseList/main.swift
|
Oh! I didn't know you could modify the build commands like this, that's good to know! But as you say, the underlying issue is still there |
I will try this problem again. |
This seems great ! Do you think there would be a way to detect if we are building Release vs Debug ? Maybe something like this instead ? But honestly even if the env doesn't match, it seems already really great to have let macCatalystPath = try context.tool(named: "spp").path.string
.replacingOccurrences(of: "/Debug/", with: "/Debug-maccatalyst/")
.replacingOccurrences(of: "/Release/", with: "/Release-maccatalyst/") |
@dvkch I forgot about release builds. And I realized that there is a problem with workaround. |
I don't think it is, but it might still exist from a previous Debug build? |
Hi there!
First of all thank you for this amazing and easy to setup library :)
I've been using it for a couple apps using SPM and it works perfectly. I've only encountered one issue: when archiving a catalyst target it fails when running
spp
:Indeed,
spp
exists but in theRelease-maccatalyst
folder, notRelease
.For now I'm gonna do a simple symlink, but if you have any idea on how to fix this that would be amazing :)
EDIT:
it does look awfully similar to https://forums.swift.org/t/package-manager-executable-not-available-when-building-for-platforms-other-than-macos/56279/2, and the solution doesn't seem that simple to setup.
EDIT2:
Because the build folder always changes I had to be a bit creative. I created an aggregate build target, containing the following script, and added it as a dependecy for my main target
This is...suboptimal, but at least lets the project archive for catalyst properly
The text was updated successfully, but these errors were encountered: