Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Sources/Workspace/InitPackage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ public final class InitPackage {

extension \(typeName): XcodeBuildToolPlugin {
// Entry point for creating build commands for targets in Xcode projects.
func createBuildCommands(context: XcodePluginContext, target: XcodeTarget) async throws -> [Command] {
func createBuildCommands(context: XcodePluginContext, target: XcodeTarget) throws -> [Command] {
// Find the code generator tool to run (replace this with the actual one).
let generatorTool = try context.tool(named: "my-code-generator")

Expand Down Expand Up @@ -469,9 +469,9 @@ public final class InitPackage {
#if canImport(XcodeProjectPlugin)
import XcodeProjectPlugin

extension MyCommandPlugin: CommandPlugin {
extension MyCommandPlugin: XcodeCommandPlugin {
// Entry point for command plugins applied to Xcode projects.
func performCommand(context: XcodePluginContext, arguments: [String]) async throws {
func performCommand(context: XcodePluginContext, arguments: [String]) throws {
print("Hello, World!")
}
}
Expand Down
2 changes: 2 additions & 0 deletions Tests/WorkspaceTests/InitTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ class InitTests: XCTestCase {
XCTAssertMatch(sourceContents, .contains("struct MyCommandPlugin: CommandPlugin"))
XCTAssertMatch(sourceContents, .contains("performCommand(context: PluginContext"))
XCTAssertMatch(sourceContents, .contains("import XcodeProjectPlugin"))
XCTAssertMatch(sourceContents, .contains("extension MyCommandPlugin: XcodeCommandPlugin"))
XCTAssertMatch(sourceContents, .contains("performCommand(context: XcodePluginContext"))
}
}
Expand Down Expand Up @@ -212,6 +213,7 @@ class InitTests: XCTestCase {
XCTAssertMatch(sourceContents, .contains("struct MyBuildToolPlugin: BuildToolPlugin"))
XCTAssertMatch(sourceContents, .contains("createBuildCommands(context: PluginContext"))
XCTAssertMatch(sourceContents, .contains("import XcodeProjectPlugin"))
XCTAssertMatch(sourceContents, .contains("extension MyBuildToolPlugin: XcodeBuildToolPlugin"))
XCTAssertMatch(sourceContents, .contains("createBuildCommands(context: XcodePluginContext"))
}
}
Expand Down