Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for visionOS #12

Merged
merged 11 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Setup
description: Setup the Lottie iOS CI Environment
description: Setup the Lottie SPM CI Environment
inputs:
xcode:
description: The version of Xcode to select
Expand Down
45 changes: 36 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,45 +7,72 @@ on:
branches: [ main ]

jobs:
Test-package-macos-12:
test-package-excluding-visionOS:
name: "Test Package"
runs-on: macos-12
runs-on: macos-13
strategy:
fail-fast: false
matrix:
xcode:
- '13.4.1' # Swift 5.6
- '14.2' # Swift 5.7
- '14.3' # Swift 5.8
- '15.0' # Swift 5.9
- '15.1' # Swift 5.9
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/setup
with:
xcode: ${{ matrix.xcode }}
- name: Build Package
run: bundle exec rake test:package:all
run: SKIP_VISION_OS=true bundle exec rake test:package:all

Test-package-macos-13:
test-package-macos-13:
name: "Test Package"
runs-on: macos-13
strategy:
fail-fast: false
matrix:
xcode:
- '15.2' # Swift 5.9, first version with visionOS support
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/setup
with:
xcode: ${{ matrix.xcode }}
- name: Build Package
run: bundle exec rake test:package:all

build-example-excluding-visionOS:
name: "Build Example App"
runs-on: macos-13
strategy:
fail-fast: false
matrix:
xcode:
- '14.2' # Swift 5.7
- '14.3' # Swift 5.8
- '15.0' # Swift 5.9
- '15.1' # Swift 5.9
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/setup
with:
xcode: ${{ matrix.xcode }}
- name: Build Package
run: bundle exec rake test:package:all
- name: Build Example
run: SKIP_VISION_OS=true bundle exec rake build:example:github_actions

build-example:
build-example-macos-13:
name: "Build Example App"
runs-on: macos-12
runs-on: macos-13
strategy:
fail-fast: false
matrix:
xcode:
- '15.2' # Swift 5.9, first version with visionOS support
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/setup
with:
xcode: ${{ matrix.xcode }}
- name: Build Example
run: bundle exec rake build:example:github_actions
362 changes: 97 additions & 265 deletions Example/Example.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1420"
version = "1.3">
LastUpgradeVersion = "1500"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
Expand All @@ -14,9 +14,9 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2E70923D29968FC300E3F0B7"
BuildableName = "Example (macOS).app"
BlueprintName = "Example (macOS)"
BlueprintIdentifier = "08CB607A2AB127E10059AF6F"
BuildableName = "Example.app"
BlueprintName = "Example"
ReferencedContainer = "container:Example.xcodeproj">
</BuildableReference>
</BuildActionEntry>
Expand All @@ -26,9 +26,8 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -44,9 +43,9 @@
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2E70923D29968FC300E3F0B7"
BuildableName = "Example (macOS).app"
BlueprintName = "Example (macOS)"
BlueprintIdentifier = "08CB607A2AB127E10059AF6F"
BuildableName = "Example.app"
BlueprintName = "Example"
ReferencedContainer = "container:Example.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
Expand All @@ -61,9 +60,9 @@
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2E70923D29968FC300E3F0B7"
BuildableName = "Example (macOS).app"
BlueprintName = "Example (macOS)"
BlueprintIdentifier = "08CB607A2AB127E10059AF6F"
BuildableName = "Example.app"
BlueprintName = "Example"
ReferencedContainer = "container:Example.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"images" : [
{
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
},
{
"idiom" : "mac",
"scale" : "1x",
Expand Down
18 changes: 18 additions & 0 deletions Example/Example/ContentView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Created by Cal Stephens on 9/12/23.
// Copyright © 2023 Airbnb Inc. All rights reserved.

import SwiftUI
import Lottie

struct ContentView: View {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted the separate iOS (UIKit) and macOS (AppKit) example apps in favor of a single cross-platform SwiftUI example app.

When we get ready to merge this we'll want to add CI jobs that test all supported platforms on both Xcode 14 and Xcode 15.

var body: some View {
VStack {
Spacer()
Text("lottie-spm")
Spacer()

LottieView(animation: .named("LottieLogo1"))
.playing(loopMode: .loop)
}
}
}
13 changes: 13 additions & 0 deletions Example/Example/ExampleApp.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Created by Cal Stephens on 9/12/23.
// Copyright © 2023 Airbnb Inc. All rights reserved.

import SwiftUI

@main
struct ExampleApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
File renamed without changes.
16 changes: 0 additions & 16 deletions Example/iOS/AppDelegate.swift

This file was deleted.

13 changes: 0 additions & 13 deletions Example/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json

This file was deleted.

25 changes: 0 additions & 25 deletions Example/iOS/Base.lproj/LaunchScreen.storyboard

This file was deleted.

24 changes: 0 additions & 24 deletions Example/iOS/Base.lproj/Main.storyboard

This file was deleted.

10 changes: 0 additions & 10 deletions Example/iOS/Example (iOS).entitlements

This file was deleted.

Loading
Loading