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
14 changes: 14 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ let package = Package(
],
products: [
.library(name: "SwiftBasicFormat", targets: ["SwiftBasicFormat"]),
.library(name: "SwiftCompilerPlugin", targets: ["SwiftCompilerPlugin"]),
.library(name: "SwiftCompilerPluginMessageHandling", targets: ["SwiftCompilerPluginMessageHandling"]),
.library(name: "SwiftDiagnostics", targets: ["SwiftDiagnostics"]),
.library(name: "SwiftIDEUtils", targets: ["SwiftIDEUtils"]),
Expand Down Expand Up @@ -69,6 +70,19 @@ let package = Package(
dependencies: ["_SwiftSyntaxTestSupport", "SwiftBasicFormat", "SwiftSyntaxBuilder"]
),

// MARK: SwiftCompilerPlugin

.target(
name: "SwiftCompilerPlugin",
dependencies: ["SwiftCompilerPluginMessageHandling", "SwiftSyntaxMacros"],
exclude: ["CMakeLists.txt"]
),

.testTarget(
name: "SwiftCompilerPluginTest",
dependencies: ["SwiftCompilerPlugin"]
),

// MARK: SwiftCompilerPluginMessageHandling

.target(
Expand Down
4 changes: 4 additions & 0 deletions Sources/SwiftCompilerPlugin/CompilerPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// NOTE: This basic plugin mechanism is mostly copied from
// https://github.com/apple/swift-package-manager/blob/main/Sources/PackagePlugin/Plugin.swift

#if !os(WASI)

#if swift(>=6.0)
public import SwiftSyntaxMacros
private import Foundation
Expand Down Expand Up @@ -257,3 +259,5 @@ struct CompilerPluginError: Error, CustomStringConvertible {
self.description = message
}
}

#endif
4 changes: 4 additions & 0 deletions Tests/SwiftCompilerPluginTest/CompilerPluginTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
//
//===----------------------------------------------------------------------===//

#if !os(WASI)

@_spi(Testing) import SwiftCompilerPlugin
import SwiftSyntax
import SwiftSyntaxMacros
Expand Down Expand Up @@ -68,3 +70,5 @@ class CompilerPluginTests: XCTestCase {

}
}

#endif