Skip to content

Commit

Permalink
Add visionOS support. (#382)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasvl committed Mar 15, 2024
1 parent 8a28c45 commit 257f7e5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/cocoapods.yml
Expand Up @@ -29,12 +29,16 @@ jobs:
matrix:
# watchOS fails linting when there are test, wedge in --skip-tests for
# those runs.
PLATFORM: ["ios", "macos", "tvos", "watchos --skip-tests"]
PLATFORM: ["ios", "macos", "tvos", "visionos", "watchos --skip-tests"]
CONFIGURATION: ["Debug", "Release"]
steps:
# The "macos-14" image defaults to 15.0.1, select the newer Xcode.
- name: Xcode version
run: sudo xcode-select -switch /Applications/Xcode_15.2.app
# The "macos-14" image has CocoaPods 1.14.x, and 1.15 is needed for visionOS
- name: Update CocoaPods
if: ${{ matrix.PLATFORM == 'visionos' }}
run: gem install cocoapods
- uses: actions/checkout@v4
# Manually expanding out static frameworks to avoid making to many jobs.
- name: Pod lib lint
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/swiftpm.yml
Expand Up @@ -49,7 +49,7 @@ jobs:
strategy:
fail-fast: false
matrix:
PLATFORM: ["ios", "macos", "tvos", "watchos"]
PLATFORM: ["ios", "macos", "tvos", "visionos", "watchos"]
CONFIGURATION: ["Debug", "Release"]
steps:
# The "macos-14" image defaults to 15.0.1, select the newer Xcode.
Expand All @@ -69,6 +69,9 @@ jobs:
tvos)
DESTINATION="platform=tvOS Simulator,name=Apple TV,OS=latest"
;;
visionos)
DESTINATION="platform=visionOS Simulator,name=Apple Vision Pro,OS=latest"
;;
watchos)
DESTINATION="platform=WatchOS Simulator,name=Apple Watch Series 7 (45mm),OS=latest"
;;
Expand Down
3 changes: 3 additions & 0 deletions GTMSessionFetcher.podspec
Expand Up @@ -24,11 +24,13 @@ Pod::Spec.new do |s|
ios_deployment_target = '10.0'
osx_deployment_target = '10.12'
tvos_deployment_target = '10.0'
visionos_deployment_target = '1.0'
watchos_deployment_target = '6.0'

s.ios.deployment_target = ios_deployment_target
s.osx.deployment_target = osx_deployment_target
s.tvos.deployment_target = tvos_deployment_target
s.visionos.deployment_target = visionos_deployment_target
s.watchos.deployment_target = watchos_deployment_target

s.prefix_header_file = false
Expand Down Expand Up @@ -70,6 +72,7 @@ Pod::Spec.new do |s|
:ios => ios_deployment_target,
:osx => osx_deployment_target,
:tvos => tvos_deployment_target,
:visionos => visionos_deployment_target,
# Seem to need a higher min to get a good test runner picked/supported.
:watchos => '7.4'
}
Expand Down
6 changes: 4 additions & 2 deletions Sources/Core/GTMSessionFetcher.m
Expand Up @@ -103,7 +103,8 @@
__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_13_0) || \
(TARGET_OS_WATCH && defined(__WATCHOS_6_0) && \
__WATCH_OS_VERSION_MIN_REQUIRED >= __WATCHOS_6_0) || \
(TARGET_OS_TV && defined(__TVOS_13_0) && __TVOS_VERSION_MIN_REQUIRED >= __TVOS_13_0))
(TARGET_OS_TV && defined(__TVOS_13_0) && __TVOS_VERSION_MIN_REQUIRED >= __TVOS_13_0) || \
(defined(TARGET_OS_VISION) && TARGET_OS_VISION))
#define GTM_SDK_REQUIRES_TLSMINIMUMSUPPORTEDPROTOCOLVERSION 1
#define GTM_SDK_SUPPORTS_TLSMINIMUMSUPPORTEDPROTOCOLVERSION 1
#elif ((TARGET_OS_OSX && defined(__MAC_10_15) && __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_10_15) || \
Expand All @@ -125,7 +126,8 @@
__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_13_0) || \
(TARGET_OS_WATCH && defined(__WATCHOS_6_0) && \
__WATCH_OS_VERSION_MIN_REQUIRED >= __WATCHOS_6_0) || \
(TARGET_OS_TV && defined(__TVOS_13_0) && __TVOS_VERSION_MIN_REQUIRED >= __TVOS_13_0))
(TARGET_OS_TV && defined(__TVOS_13_0) && __TVOS_VERSION_MIN_REQUIRED >= __TVOS_13_0) || \
(defined(TARGET_OS_VISION) && TARGET_OS_VISION))
#define GTM_SDK_REQUIRES_SECTRUSTEVALUATEWITHERROR 1
#else
#define GTM_SDK_REQUIRES_SECTRUSTEVALUATEWITHERROR 0
Expand Down

0 comments on commit 257f7e5

Please sign in to comment.