Skip to content

Basic setup for SPM buildTool plugins for xcode and SPM targets

Notifications You must be signed in to change notification settings

doozMen/SPMPlugin

Repository files navigation

SPMPlugin

swift-version xcode-version

Contains a plugin conveniently called Plug that can be used on both Swift Package Manager targets as on xcode project targets.

This project was made because there where several issues for me to actually get it to run with visual output on SPM and Xcode targets. This was due to:

  • plugins do not provide breakpoints when run
  • plugins used in xcode should refer to a tool with @main and not a main.swift file as otherwise tool cannot be found
  • output should be located into the pluginWorkingDirectory which is not your sources folder but in the dreaded DerivedData folder
  • If output needs to be compiled than all output generated by your tool should be listed in the output files, or they will just be generated but not compiled

Potential

  • swiftgen can be used to have type safe asset accessors in swift and you do not have to worry about them being up to date or have to commit them
  • sourcery would be awesome for custom code generation but at present no artefact is ready to be used as input

Other examples

About

Basic setup for SPM buildTool plugins for xcode and SPM targets

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages