File tree 5 files changed +48
-16
lines changed
5 files changed +48
-16
lines changed Original file line number Diff line number Diff line change @@ -45,16 +45,29 @@ jobs:
45
45
- name : Test example tvOS
46
46
run : scripts/test.sh example-cross-platform tvos
47
47
48
- upcoming_feature :
49
- name : Upcoming features
48
+ test_upcoming_features :
49
+ name : Test upcoming features with Xcode 15
50
50
runs-on : macos-14
51
51
env :
52
52
DEVELOPER_DIR : /Applications/Xcode_15.4.app
53
53
steps :
54
54
- uses : actions/checkout@v4
55
- - name : Test with upcoming features
55
+ - name : Test upcoming features
56
56
run : ENABLE_UPCOMING_FEATURES=1 scripts/test.sh library ios
57
57
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
+
58
71
benchmark :
59
72
name : Benchmark
60
73
runs-on : macos-14
Original file line number Diff line number Diff line change 2
2
3
3
import PackageDescription
4
4
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
+ }
8
21
9
22
let package = Package (
10
23
name: " swiftui-atom-properties " ,
Original file line number Diff line number Diff line change @@ -4,10 +4,11 @@ import PackageDescription
4
4
5
5
let swiftSettings : [ SwiftSetting ]
6
6
7
- if Context . environment [ " ENABLE_UPCOMING_FEATURES " ] != nil {
7
+ if Context . environment [ " ENABLE_UPCOMING_FEATURES " ] == " 1 " {
8
8
swiftSettings = [
9
- . enableUpcomingFeature( " ExistentialAny " ) ,
10
9
. enableUpcomingFeature( " DisableOutwardActorInference " ) ,
10
+ . enableUpcomingFeature( " IsolatedDefaultValues " ) ,
11
+ . enableUpcomingFeature( " ExistentialAny " ) ,
11
12
]
12
13
}
13
14
else {
Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ import Foundation
4
4
internal final class SubscriberState {
5
5
let token = SubscriberKey . Token ( )
6
6
7
+ #if !hasFeature(IsolatedDefaultValues)
8
+ nonisolated init ( ) { }
9
+ #endif
10
+
7
11
#if compiler(>=6)
8
12
nonisolated ( unsafe) var subscribing = Set < AtomKey > ( )
9
13
nonisolated ( unsafe) var unsubscribe: ( ( Set < AtomKey > ) -> Void ) ?
@@ -34,10 +38,6 @@ internal final class SubscriberState {
34
38
_modify { yield & _unsubscribe. value }
35
39
}
36
40
37
- #if hasFeature(DisableOutwardActorInference)
38
- nonisolated init ( ) { }
39
- #endif
40
-
41
41
deinit {
42
42
if Thread . isMainThread {
43
43
_unsubscribe. value ? ( _subscribing. value)
Original file line number Diff line number Diff line change 4
4
5
5
TARGET=$1
6
6
PLATFORM=$2
7
+ ARGS=${@: 3}
7
8
8
9
pushd " $( cd $( dirname $0 ) /.. && pwd) " & > /dev/null
9
10
@@ -22,20 +23,24 @@ watchos)
22
23
;;
23
24
esac
24
25
26
+ clean_test () {
27
+ xcodebuild clean test " $@ " $ARGS
28
+ }
29
+
25
30
case $TARGET in
26
31
library)
27
- xcodebuild clean test -scheme swiftui-atom-properties -destination platform=" $platform "
32
+ clean_test -scheme swiftui-atom-properties -destination platform=" $platform "
28
33
;;
29
34
example-ios)
30
35
cd Examples/Packages/iOS
31
- xcodebuild clean test -scheme iOSExamples -destination platform=" $platform "
36
+ clean_test -scheme iOSExamples -destination platform=" $platform "
32
37
;;
33
38
example-cross-platform)
34
39
cd Examples/Packages/CrossPlatform
35
- xcodebuild clean test -scheme CrossPlatformExamples -destination platform=" $platform "
40
+ clean_test -scheme CrossPlatformExamples -destination platform=" $platform "
36
41
;;
37
42
benchmark)
38
43
cd Benchmarks
39
- xcodebuild clean test -scheme BenchmarkTests -destination platform=" $platform "
44
+ clean_test -scheme BenchmarkTests -destination platform=" $platform "
40
45
;;
41
46
esac
You can’t perform that action at this time.
0 commit comments