11// swift-tools-version:6.1
22// The swift-tools-version declares the minimum version of Swift required to build this package.
33
4+ import Foundation
45import PackageDescription
56
67let swiftSettings : [ SwiftSetting ] = [
78 . enableUpcomingFeature( " ExistentialAny " )
89]
910
11+ // Should we enable all traits.
12+ let enableAllTraitsExplicitly = ProcessInfo . processInfo. environment [ " ENABLE_ALL_TRAITS " ] != nil
13+ let enableAllTraitsInCI = ProcessInfo . processInfo. environment [ " CI " ] != nil
14+ let enableAllTraits = enableAllTraitsExplicitly || enableAllTraitsInCI
15+ // Construct trait set
16+ var traits : Set < Trait > = [
17+ . trait( name: " ExperimentalConfiguration " )
18+ ]
19+ let defaultTraits : Trait = . default( enabledTraits: [ ] )
20+ if enableAllTraits {
21+ traits. insert ( enableAllTraits ? . default( enabledTraits: Set ( traits. map ( \. name) ) ) : defaultTraits)
22+ }
23+
1024let package = Package (
1125 name: " hummingbird " ,
1226 platforms: [ . macOS( . v15) , . iOS( . v17) , . macCatalyst( . v17) , . tvOS( . v17) , . visionOS( . v1) ] ,
@@ -19,10 +33,7 @@ let package = Package(
1933 . library( name: " HummingbirdTesting " , targets: [ " HummingbirdTesting " ] ) ,
2034 . executable( name: " PerformanceTest " , targets: [ " PerformanceTest " ] ) ,
2135 ] ,
22- traits: [
23- . trait( name: " ExperimentalConfiguration " ) ,
24- . default( enabledTraits: [ " ExperimentalConfiguration " ] ) ,
25- ] ,
36+ traits: traits,
2637 dependencies: [
2738 . package ( url: " https://github.com/apple/swift-async-algorithms.git " , from: " 1.0.2 " ) ,
2839 . package ( url: " https://github.com/apple/swift-atomics.git " , from: " 1.0.0 " ) ,
0 commit comments