File tree 9 files changed +100
-2
lines changed
Sources/OpenSwiftUICore/View/InterfaceIdiom
Tests/OpenSwiftUICoreTests/View/InterfaceIdiom
9 files changed +100
-2
lines changed Original file line number Diff line number Diff line change 27
27
OPENSWIFTUI_SWIFT_LOG : 0
28
28
OPENSWIFTUI_SWIFT_CRYPTO : 0
29
29
OPENSWIFTUI_TARGET_RELEASE : ${{ matrix.release }}
30
+ OPENSWIFTUI_USE_LOCAL_DEPS : 1
31
+ OPENGRAPH_TARGET_RELEASE : ${{ matrix.release }}
32
+ OPENGRAPH_ATTRIBUTEGRAPH_VERSION : RELEASE-${{ matrix.release }}
33
+ GH_TOKEN : ${{ github.token }}
30
34
steps :
31
35
- uses : actions/checkout@v4
32
36
- name : Setup Xcode
35
39
xcode-version : ${{ matrix.xcode-version }}
36
40
- name : Swift version
37
41
run : swift --version
42
+ - name : Set up build environment
43
+ run : Scripts/CI/macOS_setup_build.sh
44
+ shell : bash
38
45
- name : Build test target in debug mode
39
46
run : |
40
47
xcodebuild build \
Original file line number Diff line number Diff line change 23
23
OPENSWIFTUI_SWIFT_LOG : 0
24
24
OPENSWIFTUI_SWIFT_CRYPTO : 0
25
25
OPENSWIFTUI_TARGET_RELEASE : ${{ matrix.release }}
26
+ OPENSWIFTUI_USE_LOCAL_DEPS : 1
27
+ OPENGRAPH_TARGET_RELEASE : ${{ matrix.release }}
28
+ OPENGRAPH_ATTRIBUTEGRAPH_VERSION : RELEASE-${{ matrix.release }}
29
+ GH_TOKEN : ${{ github.token }}
26
30
steps :
27
31
- uses : actions/checkout@v4
28
32
- name : Setup Xcode
31
35
xcode-version : ${{ matrix.xcode-version }}
32
36
- name : Swift version
33
37
run : swift --version
38
+ - name : Set up build environment
39
+ run : Scripts/CI/macOS_setup_build.sh
40
+ shell : bash
34
41
- name : Build and run tests in debug mode with coverage
35
42
run : |
36
43
swift test \
Original file line number Diff line number Diff line change 7
7
"location" : " https://github.com/OpenSwiftUIProject/OpenGraph" ,
8
8
"state" : {
9
9
"branch" : " main" ,
10
- "revision" : " f2b16a1145acadd47c708d528f7eb1047d412f78 "
10
+ "revision" : " 074491f9950c7692142630b08b7c87b8cb682e28 "
11
11
}
12
12
},
13
13
{
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # This script extracts the revision of a specific dependency from the Package.resolved file (Only support v3).
4
+ # Usage: ./get_revision.sh <dependency_name>
5
+ # Output: revision of the dependency
6
+
7
+ # A `realpath` alternative using the default C implementation.
8
+ filepath () {
9
+ [[ $1 = /* ]] && echo " $1 " || echo " $PWD /${1# ./ } "
10
+ }
11
+
12
+ REPO_ROOT=" $( dirname $( dirname $( dirname $( filepath $0 ) ) ) ) "
13
+ cd $REPO_ROOT
14
+
15
+ # Ensure a dependency name is provided as an argument
16
+ if [[ $# -lt 1 ]]; then
17
+ echo " Usage: $0 <dependency_name>"
18
+ exit 1
19
+ fi
20
+
21
+ DEPENDENCY_NAME=" $1 "
22
+ PACKAGE_RESOLVED_PATH=" Package.resolved"
23
+
24
+ # Check if the Package.resolved file exists
25
+ if [[ ! -f " $PACKAGE_RESOLVED_PATH " ]]; then
26
+ echo " Error: $PACKAGE_RESOLVED_PATH file not found!"
27
+ exit 1
28
+ fi
29
+
30
+ # Extract the revision using jq
31
+ REVISION=$( jq -r --arg name " $DEPENDENCY_NAME " '
32
+ .pins[]?
33
+ | select(.identity == $name)
34
+ | .state.revision
35
+ ' " $PACKAGE_RESOLVED_PATH " )
36
+
37
+ # Check if a revision was found
38
+ if [[ -z " $REVISION " ]]; then
39
+ echo " No revision found for dependency: $DEPENDENCY_NAME "
40
+ exit 1
41
+ else
42
+ echo " $REVISION "
43
+ fi
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # A `realpath` alternative using the default C implementation.
4
+ filepath () {
5
+ [[ $1 = /* ]] && echo " $1 " || echo " $PWD /${1# ./ } "
6
+ }
7
+
8
+ REPO_ROOT=" $( dirname $( dirname $( dirname $( filepath $0 ) ) ) ) "
9
+ cd $REPO_ROOT
10
+
11
+ Scripts/CI/og_setup.sh
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # A `realpath` alternative using the default C implementation.
4
+ filepath () {
5
+ [[ $1 = /* ]] && echo " $1 " || echo " $PWD /${1# ./ } "
6
+ }
7
+
8
+ REPO_ROOT=" $( dirname $( dirname $( dirname $( filepath $0 ) ) ) ) "
9
+
10
+ clone_checkout_og () {
11
+ cd $REPO_ROOT
12
+ revision=$( Scripts/CI/get_revision.sh opengraph)
13
+ cd ..
14
+ gh repo clone OpenSwiftUIProject/OpenGraph
15
+ cd OpenGraph
16
+ git checkout --quiet $revision
17
+ }
18
+
19
+ update_og () {
20
+ cd $REPO_ROOT /../OpenGraph
21
+ ./AG/update.sh
22
+ }
23
+
24
+ clone_checkout_og
25
+ update_og
Original file line number Diff line number Diff line change @@ -5,7 +5,8 @@ filepath() {
5
5
[[ $1 = /* ]] && echo " $1 " || echo " $PWD /${1# ./ } "
6
6
}
7
7
8
- OG_ROOT=" $( dirname $( dirname $( filepath $0 ) ) ) "
8
+ REPO_ROOT=" $( dirname $( dirname $( filepath $0 ) ) ) "
9
+ cd $REPO_ROOT
9
10
10
11
# Get the language and input file path from the arguments
11
12
language=${1:- " swift" }
Original file line number Diff line number Diff line change 5
5
// Audited for iOS 18.0
6
6
// Status: Complete
7
7
8
+ #if OPENSWIFTUI_RELEASE_2024
8
9
package struct InterfaceIdiomPredicate < Idiom> : ViewInputPredicate where Idiom: InterfaceIdiom {
9
10
package init ( ) { }
10
11
@@ -42,3 +43,4 @@ extension AnyInterfaceIdiom {
42
43
value == AnyInterfaceIdiom ( pattern)
43
44
}
44
45
}
46
+ #endif
Original file line number Diff line number Diff line change 5
5
@testable import OpenSwiftUICore
6
6
import Testing
7
7
8
+ #if OPENSWIFTUI_RELEASE_2024
8
9
struct InterfaceIdiomTests {
9
10
@Test
10
11
func idiomEqual( ) {
@@ -35,3 +36,4 @@ struct InterfaceIdiomTests {
35
36
#expect( ( WidgetInterfaceIdiom ( ) ~= AnyInterfaceIdiom ( . complication) ) == false )
36
37
}
37
38
}
39
+ #endif
You can’t perform that action at this time.
0 commit comments