How to emit errors/warnings from build tool plugins for Xcode log
I started by creating a simple CLI tool to detect build settings in a project's pbxproj file using XcodeProj. I figured when it's called from a plugin it could take advantage of the same "Warning:...
View ArticleUsing custom swift-stdlib while running a swift package on mac OS
Hi, We have an executable that we're trying to test using a snapshot toolchain on mac OS. The exact command we're using looks as below -...
View ArticleUnable to Link C system libs on windows
I have just started learning swift and I am trying to use GLFW but am unable to link it I am running swift build -Xswiftc -IC:\glfw-338\include -Xlinker -LC:\glfw-338\lib-vc2022 and I get a bunch of...
View ArticleUsing a Homebrew package executable from a swift plugin
Hello, I would like to use a third party code-gen tool that is installed via homebrew. The homebrew bin directory is not a listed path when the plugin executes. Is there a way to modify the tool...
View ArticleVersioning a SwiftPM catalog
Hello Everyone, I'm looking a way to reproduce a versionning catalog with spm in multi module project. Does anyone has any clue how I could achieve that ? To give more context to what I want achieve :...
View ArticleAdding "other linker flags" to a swift package
I've run into this issue: Xcode 15 beta 3 linker issue: ld: … | Apple Developer Forums (duplicate library warning) when upgrading to Xcode 15, with my project and a related Swift package i'm building....
View ArticleInsert package version(s) into source code
I would like to use the package version (Git tag and/or commit hash) in the source code for automated version information within the executables, also checking the Git status. I implemented a function...
View ArticleCpp interop on windows not finding swift/bridging
Hi, I'm trying to make a cross platform app for Mac and Windows (and eventually Linux), using the new cxx-interop to call a 3rd party cpp library. I have this all working great on Mac (via SPM) and...
View ArticleVersioning for packages that depend on packages that require -ObjC
Hi all, I'm currently developing a Swift package that depends on a number of 3rd party frameworks (one example is Firebase) that require the -ObjC linker flag added to be linked correctly. The problem...
View ArticleSupport for rewriting package urls?
Hi, I am working for government and we cannot use GitHub. In order to use SPM I wrote a script that mirrors git repositories from GitHub into our internal bitbucket server. There, I can only use a...
View ArticleHow to access the build directory in a build tool plugin?
I'm trying to write a build tool plugin to automate copying libraries into the build directory (for windows and linux builds, since they have to rely on .sytemLibrary targets for 3rd party libs, and...
View ArticleSPM Package.swift linkerSettings passed to dependent main app target
Linker flag specified in Package.swift as unsafe flag is passed to main app target. steps: create empty package add linkerSettings: [.unsafeFlags(["-Wl,-make_mergeable"])] to target import...
View ArticleManually replicate what swift package generate xcodeproj did
Because of a wrapper on swift that I have to use I cannot directly use SPM to import packges. I have to create*.xcodeproj for the project I am importing and I cannot use swift package generate...
View ArticleFor in-build plugins adding new files to the Target's source is expensive...
My in build plugin runs from scratch every time a new file is created in Target's source directory even if it doesn't affect the plugin's input list. About the plugin: Using swift package init --type...
View ArticlePackage dependencies adding in my package and no module found
(topic deleted by author) 1 post - 1 participant Read full topic
View ArticleBuild dependent packages automatically
A part of my application is written in Rust which gets compiled into an XCFramework and wrapped into its own SwiftPM package together with some Swift bridge code generated by UniFFI. My project...
View ArticleBuilding just SPM dependencies to cache in a Docker layer
I'm building a Swift app via Docker. It's got a decent number of SPM dependencies none of which change frequently. While I can cache the resolution of the dependencies like so: COPY ./Package.* ./ #...
View ArticleIs there a way to truly clear dep cache?
Fighting xcode's perception of what dependencies are at what version is a constant PITA. I just want to find whatever directory those dependencies are in and rm -rf. Can I do that and where do I do...
View ArticleIs it possible to distribute a compiled version of swift package?
Hey. I have been wondering if it is possible to distribute a swift package in a compiled form? The way you can distribute c source code using .h and .o files. In this way, the developer can distribute...
View ArticleIs it possible to use @import in a header file?
I've created a package with the following structure: Models - Swift UseObjc - Objc, depends on Models UseSwift - Swift, depends on UseObjc The idea is to use an enum from Models as a property of an...
View Article