Meet Swift Package plugins

RSS for tag

Discuss the WWDC22 Session Meet Swift Package plugins

Posts under wwdc2022-110359 tag

2 Posts
Sort by:
Post marked as solved
2 Replies
244 Views
For WWDC22 session "Meet Swift Package plugins " the following code snipped is shared in Apple's Developer application: In Xcode 14 Beta 1 I receive the compilation error Cannot find type 'XcodeBuildToolPlugin' in scope Is the given example valid and is a struct/type missing in the new library module XcodeProjectPlugin ? Or needs the example code to be adjusted (further then I bug I mentioned below in the comments)? import PackagePlugin @main struct MyPlugin: BuildToolPlugin {? /// This entry point is called when operating on a Swift package. func createBuildCommands(context: PluginContext, target: Target) throws -> [Command] debugPrint(context) // BUG: needs to return an array !!!!!!!!!!!!!!!!!!!!!! } } #if canImport(XcodeProjectPlugin) import XcodeProjectPlugin extension MyPlugin: XcodeBuildToolPlugin { /// This entry point is called when operating on an Xcode project. func createBuildCommands(context: XcodePluginContext, target: XcodeTarget) throws -> [Command] debugPrint(context) return [] } } #endif
Posted Last updated
.