Quantcast
Channel: Package Manager - Swift Forums
Viewing all articles
Browse latest Browse all 166

How to emit errors/warnings from build tool plugins for Xcode log

$
0
0

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: some warning text" magic that works in build script phases.

I was apparently wrong.

It should be said I'm treating the .executableTarget (the pbxproj build settings detector) as a .buildCommand and not a .prebuildCommand so it can be built from source for what I may mistakenly believe to be simplicity. I set this paragraph apart because I just know it will come back to haunt me.

After quite an adventure wrapping this tool in an Xcode build tool plugin (it's now in the same package as the plugin), it's not treating the output as proper warnings in Xcode's build log. I discovered Diagnostics.warn("...") but I can't figure out how to get from "output of this executable target" to Diagnostics.warn()?

I thought maybe there was somewhere to hook into the execution of the tool and convert, but I can't seem to find documentation pertaining to this particular scenario.

Just how completely wrongly am I holding this thing?

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 166

Trending Articles