File tree Expand file tree Collapse file tree 5 files changed +48
-16
lines changed Expand file tree Collapse file tree 5 files changed +48
-16
lines changed Original file line number Diff line number Diff line change @@ -45,16 +45,29 @@ jobs:
4545 - name : Test example tvOS
4646 run : scripts/test.sh example-cross-platform tvos
4747
48- upcoming_feature :
49- name : Upcoming features
48+ test_upcoming_features :
49+ name : Test upcoming features with Xcode 15
5050 runs-on : macos-14
5151 env :
5252 DEVELOPER_DIR : /Applications/Xcode_15.4.app
5353 steps :
5454 - uses : actions/checkout@v4
55- - name : Test with upcoming features
55+ - name : Test upcoming features
5656 run : ENABLE_UPCOMING_FEATURES=1 scripts/test.sh library ios
5757
58+ test_language_mode :
59+ name : Test Swift 5 language mode
60+ runs-on : macos-14
61+ strategy :
62+ matrix :
63+ enable_upcoming_features :
64+ - 0
65+ - 1
66+ steps :
67+ - uses : actions/checkout@v4
68+ - name : Test Swift 5 language mode
69+ run : ENABLE_UPCOMING_FEATURES=${{ matrix.enable_upcoming_features }} scripts/test.sh library ios SWIFT_VERSION=5
70+
5871 benchmark :
5972 name : Benchmark
6073 runs-on : macos-14
Original file line number Diff line number Diff line change 22
33import PackageDescription
44
5- let swiftSettings : [ SwiftSetting ] = [
6- . enableUpcomingFeature( " ExistentialAny " )
7- ]
5+ let swiftSettings : [ SwiftSetting ]
6+
7+ if Context . environment [ " ENABLE_UPCOMING_FEATURES " ] == " 1 " {
8+ swiftSettings = [
9+ . enableUpcomingFeature( " DisableOutwardActorInference " ) ,
10+ . enableUpcomingFeature( " InferSendableFromCaptures " ) ,
11+ . enableUpcomingFeature( " IsolatedDefaultValues " ) ,
12+ . enableUpcomingFeature( " StrictConcurrency " ) ,
13+ . enableUpcomingFeature( " ExistentialAny " ) ,
14+ ]
15+ }
16+ else {
17+ swiftSettings = [
18+ . enableUpcomingFeature( " ExistentialAny " )
19+ ]
20+ }
821
922let package = Package (
1023 name: " swiftui-atom-properties " ,
Original file line number Diff line number Diff line change @@ -4,10 +4,11 @@ import PackageDescription
44
55let swiftSettings : [ SwiftSetting ]
66
7- if Context . environment [ " ENABLE_UPCOMING_FEATURES " ] != nil {
7+ if Context . environment [ " ENABLE_UPCOMING_FEATURES " ] == " 1 " {
88 swiftSettings = [
9- . enableUpcomingFeature( " ExistentialAny " ) ,
109 . enableUpcomingFeature( " DisableOutwardActorInference " ) ,
10+ . enableUpcomingFeature( " IsolatedDefaultValues " ) ,
11+ . enableUpcomingFeature( " ExistentialAny " ) ,
1112 ]
1213}
1314else {
Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ import Foundation
44internal final class SubscriberState {
55 let token = SubscriberKey . Token ( )
66
7+ #if !hasFeature(IsolatedDefaultValues)
8+ nonisolated init ( ) { }
9+ #endif
10+
711 #if compiler(>=6)
812 nonisolated ( unsafe) var subscribing = Set < AtomKey > ( )
913 nonisolated ( unsafe) var unsubscribe: ( ( Set < AtomKey > ) -> Void ) ?
@@ -34,10 +38,6 @@ internal final class SubscriberState {
3438 _modify { yield & _unsubscribe. value }
3539 }
3640
37- #if hasFeature(DisableOutwardActorInference)
38- nonisolated init ( ) { }
39- #endif
40-
4141 deinit {
4242 if Thread . isMainThread {
4343 _unsubscribe. value ? ( _subscribing. value)
Original file line number Diff line number Diff line change 44
55TARGET=$1
66PLATFORM=$2
7+ ARGS=${@: 3}
78
89pushd " $( cd $( dirname $0 ) /.. && pwd) " & > /dev/null
910
@@ -22,20 +23,24 @@ watchos)
2223 ;;
2324esac
2425
26+ clean_test () {
27+ xcodebuild clean test " $@ " $ARGS
28+ }
29+
2530case $TARGET in
2631library)
27- xcodebuild clean test -scheme swiftui-atom-properties -destination platform=" $platform "
32+ clean_test -scheme swiftui-atom-properties -destination platform=" $platform "
2833 ;;
2934example-ios)
3035 cd Examples/Packages/iOS
31- xcodebuild clean test -scheme iOSExamples -destination platform=" $platform "
36+ clean_test -scheme iOSExamples -destination platform=" $platform "
3237 ;;
3338example-cross-platform)
3439 cd Examples/Packages/CrossPlatform
35- xcodebuild clean test -scheme CrossPlatformExamples -destination platform=" $platform "
40+ clean_test -scheme CrossPlatformExamples -destination platform=" $platform "
3641 ;;
3742benchmark)
3843 cd Benchmarks
39- xcodebuild clean test -scheme BenchmarkTests -destination platform=" $platform "
44+ clean_test -scheme BenchmarkTests -destination platform=" $platform "
4045 ;;
4146esac
You can’t perform that action at this time.
0 commit comments