Skip to content

Commit

Permalink
Install visionOS before testing Carthage support, update CarthageTest…
Browse files Browse the repository at this point in the history
… to support visionOS and tvOS
  • Loading branch information
calda committed Jan 20, 2024
1 parent 1223abc commit fd5a49c
Show file tree
Hide file tree
Showing 21 changed files with 141 additions and 1,360 deletions.
30 changes: 18 additions & 12 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -146,17 +146,21 @@ namespace :test do
sh 'cp -R [^script]* script/test-carthage/Carthage/Checkouts/lottie-ios'

Dir.chdir('script/test-carthage') do
# Build the LottieCarthage framework scheme
installVisionOSIfNecessary()

# Build the Lottie framework scheme
sh 'carthage build --use-xcframeworks'

# Delete Carthage's derived data to verify that the built .xcframework doesn't depend on any
# side effects from building on this specific machine.
# https://github.com/airbnb/lottie-ios/issues/1492
sh 'rm -rf ~/Library/Caches/org.carthage.CarthageKit/DerivedData'

# Build a test app that imports and uses the LottieCarthage framework
xcodebuild('build -scheme CarthageTest -destination "platform=iOS Simulator,name=iPhone SE (3rd generation)"')
xcodebuild('build -scheme CarthageTest-macOS')
# Build a test app that imports and uses the Lottie framework built via Carthage
xcodebuild('build -scheme CarthageTest -destination "platform=iOS"')
xcodebuild('build -scheme CarthageTest -destination "platform=macOS"')
xcodebuild('build -scheme CarthageTest -destination "platform=tvOS"')
xcodebuild('build -scheme CarthageTest -destination "platform=visionOS"')
end
end

Expand Down Expand Up @@ -252,14 +256,16 @@ def ifVisionOSEnabled
if ENV["SKIP_VISION_OS"] == "true"
puts "Skipping visionOS build"
else
# visionOS is unsupported by default on Intel, but we can override this
# https://github.com/actions/runner-images/issues/8144#issuecomment-1902072070
sh 'defaults write com.apple.dt.Xcode AllowUnsupportedVisionOSHost -bool YES'
sh 'defaults write com.apple.CoreSimulator AllowUnsupportedVisionOSHost -bool YES'

# Download visionOS SDK if necessary
xcodebuild("-downloadPlatform visionOS")

installVisionOSIfNecessary()
yield
end
end

def installVisionOSIfNecessary
# visionOS is unsupported by default on Intel, but we can override this
# https://github.com/actions/runner-images/issues/8144#issuecomment-1902072070
sh 'defaults write com.apple.dt.Xcode AllowUnsupportedVisionOSHost -bool YES'
sh 'defaults write com.apple.CoreSimulator AllowUnsupportedVisionOSHost -bool YES'

xcodebuild("-downloadPlatform visionOS")
end
7 changes: 0 additions & 7 deletions script/test-carthage/CarthageTest-macOS/AppDelegate.swift

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

717 changes: 0 additions & 717 deletions script/test-carthage/CarthageTest-macOS/Base.lproj/Main.storyboard

This file was deleted.

15 changes: 0 additions & 15 deletions script/test-carthage/CarthageTest-macOS/ViewController.swift

This file was deleted.

Loading

0 comments on commit fd5a49c

Please sign in to comment.