33
44import PackageDescription
55
6- #if os(Windows)
7- let plugins : [ Target . PluginUsage ] ? = nil
8- #else
9- let plugins : [ Target . PluginUsage ] ? = [ . plugin( name: " SwiftFormatPlugin " ) ]
10- #endif
11-
12- let target : Target = . target(
13- name: " ANSI " ,
14- dependencies: [
15- . product( name: " ASCII " , package : " ASCII " ) ,
16- . product( name: " Algorithms " , package : " swift-algorithms " ) ,
17- ] ,
18- plugins: plugins
19- )
20-
21- let testTarget : Target = . testTarget(
22- name: " ANSITests " ,
23- dependencies: [ " ANSI " ]
24- )
25-
26- #if os(Windows)
27- let targets : [ Target ] = [ target, testTarget]
28- #else
29- let targets : [ Target ] = [
30- target,
31- testTarget,
32- . plugin(
33- name: " SwiftFormatPlugin " ,
34- capability: . buildTool( ) ,
35- path: " Plugins/SwiftFormatPlugin " ,
36- packageAccess: true
37- ) ,
38- ]
39- #endif
40-
416let package = Package (
427 name: " ANSI " ,
438 platforms: [ . macOS( . v12) ] ,
@@ -47,6 +12,22 @@ let package = Package(
4712 dependencies: [
4813 . package ( url: " https://github.com/besya/ascii.git " , from: " 1.1.0 " ) ,
4914 . package ( url: " https://github.com/apple/swift-algorithms " , from: " 1.2.0 " ) ,
15+ . package ( url: " https://github.com/besya/swift-format-plugin.git " , from: " 0.0.5 " ) ,
5016 ] ,
51- targets: targets
17+ targets: [
18+ . target(
19+ name: " ANSI " ,
20+ dependencies: [
21+ . product( name: " ASCII " , package : " ASCII " ) ,
22+ . product( name: " Algorithms " , package : " swift-algorithms " ) ,
23+ ] ,
24+ plugins: [
25+ . plugin( name: " LintOnBuild " , package : " swift-format-plugin " )
26+ ]
27+ ) ,
28+ . testTarget(
29+ name: " ANSITests " ,
30+ dependencies: [ " ANSI " ]
31+ ) ,
32+ ]
5233)
0 commit comments