@@ -63,29 +63,6 @@ let package = Package(
6363 swiftSettings: swiftSettings
6464 ) ,
6565
66- // Command-line tool library
67- . target(
68- name: " SwiftDocCUtilities " ,
69- dependencies: [
70- . target( name: " SwiftDocC " ) ,
71- . product( name: " NIOHTTP1 " , package : " swift-nio " ) ,
72- . product( name: " ArgumentParser " , package : " swift-argument-parser " )
73- ] ,
74- swiftSettings: swiftSettings
75- ) ,
76- . testTarget(
77- name: " SwiftDocCUtilitiesTests " ,
78- dependencies: [
79- . target( name: " SwiftDocCUtilities " ) ,
80- . target( name: " SwiftDocC " ) ,
81- . target( name: " SwiftDocCTestUtilities " ) ,
82- ] ,
83- resources: [
84- . copy( " Test Resources " ) ,
85- . copy( " Test Bundles " ) ,
86- ] ,
87- swiftSettings: swiftSettings
88- ) ,
8966 // Test utility library
9067 . target(
9168 name: " SwiftDocCTestUtilities " ,
@@ -126,20 +103,74 @@ let package = Package(
126103 ]
127104)
128105
106+ // Command-line tool library
107+ #if os(Windows)
108+ package . targets. append (
109+ . target(
110+ name: " SwiftDocCUtilities " ,
111+ dependencies: [
112+ . target( name: " SwiftDocC " ) ,
113+ . product( name: " ArgumentParser " , package : " swift-argument-parser " )
114+ ] ,
115+ exclude: [
116+ // PreviewServer requires NIO which cannot support non-POSIX platforms.
117+ " PreviewServer " ,
118+ " Action/Actions/PreviewAction.swift " ,
119+ " ArgumentParsing/ActionExtensions/PreviewAction+CommandInitialization.swift " ,
120+ " ArgumentParsing/Subcommands/Preview.swift " ,
121+ ] ,
122+ swiftSettings: swiftSettings
123+ )
124+ )
125+ #else
126+ package . targets. append (
127+ . target(
128+ name: " SwiftDocCUtilities " ,
129+ dependencies: [
130+ . target( name: " SwiftDocC " ) ,
131+ . product( name: " NIOHTTP1 " , package : " swift-nio " ) ,
132+ . product( name: " ArgumentParser " , package : " swift-argument-parser " )
133+ ] ,
134+ swiftSettings: swiftSettings
135+ )
136+ )
137+ #endif
138+
139+ package . targets. append (
140+ . testTarget(
141+ name: " SwiftDocCUtilitiesTests " ,
142+ dependencies: [
143+ . target( name: " SwiftDocCUtilities " ) ,
144+ . target( name: " SwiftDocC " ) ,
145+ . target( name: " SwiftDocCTestUtilities " ) ,
146+ ] ,
147+ resources: [
148+ . copy( " Test Resources " ) ,
149+ . copy( " Test Bundles " ) ,
150+ ] ,
151+ swiftSettings: swiftSettings
152+ )
153+ )
154+
129155// If the `SWIFTCI_USE_LOCAL_DEPS` environment variable is set,
130156// we're building in the Swift.org CI system alongside other projects in the Swift toolchain and
131157// we can depend on local versions of our dependencies instead of fetching them remotely.
132158if ProcessInfo . processInfo. environment [ " SWIFTCI_USE_LOCAL_DEPS " ] == nil {
133159 // Building standalone, so fetch all dependencies remotely.
134160 package . dependencies += [
135- . package ( url: " https://github.com/apple/swift-nio.git " , from: " 2.53.0 " ) ,
136161 . package ( url: " https://github.com/apple/swift-markdown.git " , branch: " main " ) ,
137162 . package ( url: " https://github.com/apple/swift-lmdb.git " , branch: " main " ) ,
138163 . package ( url: " https://github.com/apple/swift-argument-parser " , from: " 1.2.2 " ) ,
139164 . package ( url: " https://github.com/apple/swift-docc-symbolkit " , branch: " main " ) ,
140165 . package ( url: " https://github.com/apple/swift-crypto.git " , from: " 2.5.0 " ) ,
141166 . package ( url: " https://github.com/apple/swift-docc-plugin " , from: " 1.0.0 " ) ,
142167 ]
168+
169+ #if !os(Windows)
170+ package . dependencies += [
171+ . package ( url: " https://github.com/apple/swift-nio.git " , from: " 2.53.0 " ) ,
172+ ]
173+ #endif
143174} else {
144175 // Building in the Swift.org CI system, so rely on local versions of dependencies.
145176 package . dependencies += [
0 commit comments