@@ -4,63 +4,65 @@ import PackageDescription
44
55let buildTests = true
66
7- func filterNil< T> ( _ array: [ T ? ] ) -> [ T ] {
8- return array. flatMap { $0 }
9- }
10-
117extension Product {
12- static func allTests( ) -> Product ? {
8+ static func allTests( ) -> [ Product ] {
139 if buildTests {
14- return . executable( name: " AllTestz " , targets: [ " AllTestz " ] )
10+ return [ . executable( name: " AllTestz " , targets: [ " AllTestz " ] ) ]
1511 } else {
16- return nil
12+ return [ ]
1713 }
1814 }
1915}
2016
2117extension Target {
22- static func rxCocoa( ) -> Target ? {
18+ static func rxCocoa( ) -> [ Target ] {
2319 #if os(Linux)
24- return . target( name: " RxCocoa " , dependencies: [ " RxSwift " ] )
20+ return [ . target( name: " RxCocoa " , dependencies: [ " RxSwift " ] ) ]
2521 #else
26- return . target( name: " RxCocoa " , dependencies: [ " RxSwift " , " RxCocoaRuntime " ] )
22+ return [ . target( name: " RxCocoa " , dependencies: [ " RxSwift " , " RxCocoaRuntime " ] ) ]
2723 #endif
2824 }
2925
30- static func rxCocoaRuntime( ) -> Target ? {
26+ static func rxCocoaRuntime( ) -> [ Target ] {
3127 #if os(Linux)
32- return nil
28+ return [ ]
3329 #else
34- return . target( name: " RxCocoaRuntime " , dependencies: [ " RxSwift " ] )
30+ return [ . target( name: " RxCocoaRuntime " , dependencies: [ " RxSwift " ] ) ]
3531 #endif
3632 }
3733
38- static func allTests( ) -> Target ? {
34+ static func allTests( ) -> [ Target ] {
3935 if buildTests {
40- return . target( name: " AllTestz " , dependencies: [ " RxSwift " , " RxCocoa " , " RxBlocking " , " RxTest " ] )
36+ return [ . target( name: " AllTestz " , dependencies: [ " RxSwift " , " RxCocoa " , " RxBlocking " , " RxTest " ] ) ]
4137 } else {
42- return nil
38+ return [ ]
4339 }
4440 }
4541}
4642
4743let package = Package (
4844 name: " RxSwift " ,
49- products: filterNil ( [
50- . library( name: " RxAtomic " , targets: [ " RxAtomic " ] ) ,
51- . library( name: " RxSwift " , targets: [ " RxSwift " ] ) ,
52- . library( name: " RxCocoa " , targets: [ " RxCocoa " ] ) ,
53- . library( name: " RxBlocking " , targets: [ " RxBlocking " ] ) ,
54- . library( name: " RxTest " , targets: [ " RxTest " ] ) ,
55- . allTests( ) ,
56- ] ) ,
57- targets: filterNil ( [
58- . target( name: " RxAtomic " , dependencies: [ ] ) ,
59- . target( name: " RxSwift " , dependencies: [ " RxAtomic " ] ) ,
60- . rxCocoa( ) ,
61- . rxCocoaRuntime( ) ,
62- . target( name: " RxBlocking " , dependencies: [ " RxSwift " , " RxAtomic " ] ) ,
63- . target( name: " RxTest " , dependencies: [ " RxSwift " ] ) ,
64- . allTests( ) ,
65- ] )
45+ products: ( [
46+ [
47+ . library( name: " RxAtomic " , targets: [ " RxAtomic " ] ) ,
48+ . library( name: " RxSwift " , targets: [ " RxSwift " ] ) ,
49+ . library( name: " RxCocoa " , targets: [ " RxCocoa " ] ) ,
50+ . library( name: " RxBlocking " , targets: [ " RxBlocking " ] ) ,
51+ . library( name: " RxTest " , targets: [ " RxTest " ] ) ,
52+ ] ,
53+ Product . allTests ( )
54+ ] as [ [ Product ] ] ) . flatMap { $0 } ,
55+ targets: ( [
56+ [
57+ . target( name: " RxAtomic " , dependencies: [ ] ) ,
58+ . target( name: " RxSwift " , dependencies: [ " RxAtomic " ] ) ,
59+ ] ,
60+ Target . rxCocoa ( ) ,
61+ Target . rxCocoaRuntime ( ) ,
62+ [
63+ . target( name: " RxBlocking " , dependencies: [ " RxSwift " , " RxAtomic " ] ) ,
64+ . target( name: " RxTest " , dependencies: [ " RxSwift " ] ) ,
65+ ] ,
66+ Target . allTests ( )
67+ ] as [ [ Target ] ] ) . flatMap { $0 }
6668)
0 commit comments