Skip to content

Commit a1033ec

Browse files
authored
Merge pull request #16 from kkk669/revert-remove-swiftcompilerplugin
2 parents 979ea45 + 4f9350d commit a1033ec

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

Package.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ let package = Package(
1414
],
1515
products: [
1616
.library(name: "SwiftBasicFormat", targets: ["SwiftBasicFormat"]),
17+
.library(name: "SwiftCompilerPlugin", targets: ["SwiftCompilerPlugin"]),
1718
.library(name: "SwiftCompilerPluginMessageHandling", targets: ["SwiftCompilerPluginMessageHandling"]),
1819
.library(name: "SwiftDiagnostics", targets: ["SwiftDiagnostics"]),
1920
.library(name: "SwiftIDEUtils", targets: ["SwiftIDEUtils"]),
@@ -69,6 +70,19 @@ let package = Package(
6970
dependencies: ["_SwiftSyntaxTestSupport", "SwiftBasicFormat", "SwiftSyntaxBuilder"]
7071
),
7172

73+
// MARK: SwiftCompilerPlugin
74+
75+
.target(
76+
name: "SwiftCompilerPlugin",
77+
dependencies: ["SwiftCompilerPluginMessageHandling", "SwiftSyntaxMacros"],
78+
exclude: ["CMakeLists.txt"]
79+
),
80+
81+
.testTarget(
82+
name: "SwiftCompilerPluginTest",
83+
dependencies: ["SwiftCompilerPlugin"]
84+
),
85+
7286
// MARK: SwiftCompilerPluginMessageHandling
7387

7488
.target(

Sources/SwiftCompilerPlugin/CompilerPlugin.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
// NOTE: This basic plugin mechanism is mostly copied from
1313
// https://github.com/apple/swift-package-manager/blob/main/Sources/PackagePlugin/Plugin.swift
1414

15+
#if !os(WASI)
16+
1517
#if swift(>=6.0)
1618
public import SwiftSyntaxMacros
1719
private import Foundation
@@ -257,3 +259,5 @@ struct CompilerPluginError: Error, CustomStringConvertible {
257259
self.description = message
258260
}
259261
}
262+
263+
#endif

Tests/SwiftCompilerPluginTest/CompilerPluginTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
#if !os(WASI)
14+
1315
@_spi(Testing) import SwiftCompilerPlugin
1416
import SwiftSyntax
1517
import SwiftSyntaxMacros
@@ -68,3 +70,5 @@ class CompilerPluginTests: XCTestCase {
6870

6971
}
7072
}
73+
74+
#endif

0 commit comments

Comments
 (0)