@@ -11,16 +11,36 @@ let package = Package(
1111 ] ,
1212 dependencies: [
1313 . package ( url: " https://github.com/hummingbird-project/hummingbird.git " , from: " 2.0.0 " ) ,
14- . package ( url: " https://github.com/apple/swift-argument-parser.git " , from: " 1.3.0 " )
14+ . package ( url: " https://github.com/apple/swift-argument-parser.git " , from: " 1.3.0 " ) ,
15+ { { #HB_OPENAPI} }
16+ . package ( url: " https://github.com/apple/swift-openapi-generator " , from: " 1.6.0 " ) ,
17+ . package ( url: " https://github.com/apple/swift-openapi-runtime " , from: " 1.7.0 " ) ,
18+ . package ( url: " https://github.com/swift-server/swift-openapi-hummingbird.git " , from: " 2.0.1 " ) ,
19+ { { / HB_OPENAPI} }
1520 ] ,
1621 targets: [
1722 . executableTarget( name: " {{HB_EXECUTABLE_NAME}} " ,
1823 dependencies: [
1924 . product( name: " ArgumentParser " , package : " swift-argument-parser " ) ,
2025 . product( name: " Hummingbird " , package : " hummingbird " ) ,
26+ { { #HB_OPENAPI} }
27+ . byName ( name: " {{HB_EXECUTABLE_NAME}}API " ) ,
28+ . product( name: " OpenAPIRuntime " , package : " swift-openapi-runtime " ) ,
29+ . product( name: " OpenAPIHummingbird " , package : " swift-openapi-hummingbird " ) ,
30+ { { / HB_OPENAPI} }
2131 ] ,
2232 path: " Sources/App "
2333 ) ,
34+ { { #HB_OPENAPI} }
35+ . target (
36+ name: " {{HB_EXECUTABLE_NAME}}API " ,
37+ dependencies: [
38+ . product( name: " OpenAPIRuntime " , package : " swift-openapi-runtime " )
39+ ] ,
40+ path: " Sources/AppAPI " ,
41+ plugins: [ . plugin( name: " OpenAPIGenerator " , package : " swift-openapi-generator " ) ] ,
42+ ) ,
43+ { { / HB_OPENAPI} }
2444 . testTarget ( name: " {{HB_EXECUTABLE_NAME}}Tests " ,
2545 dependencies: [
2646 . byName( name: " {{HB_EXECUTABLE_NAME}} " ) ,
0 commit comments