diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 428b4cd..f9de8ee 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -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 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f71f8cb..2d91ab2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,25 +7,44 @@ 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: @@ -33,19 +52,27 @@ jobs: - '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 diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example.xcodeproj/project.pbxproj index 2668288..7625d4a 100644 --- a/Example/Example.xcodeproj/project.pbxproj +++ b/Example/Example.xcodeproj/project.pbxproj @@ -7,55 +7,28 @@ objects = { /* Begin PBXBuildFile section */ - 082D241E2943A6F100DAAC5A /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 082D24142943A6F000DAAC5A /* ViewController.swift */; }; - 082D241F2943A6F100DAAC5A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 082D24152943A6F000DAAC5A /* Assets.xcassets */; }; - 082D24202943A6F100DAAC5A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 082D24162943A6F000DAAC5A /* LaunchScreen.storyboard */; }; - 082D24212943A6F100DAAC5A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 082D24182943A6F000DAAC5A /* Main.storyboard */; }; - 082D24222943A6F100DAAC5A /* LottieLogo1.json in Resources */ = {isa = PBXBuildFile; fileRef = 082D241A2943A6F000DAAC5A /* LottieLogo1.json */; }; - 082D24232943A6F100DAAC5A /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 082D241B2943A6F000DAAC5A /* AppDelegate.swift */; }; - 082D24252943A6F100DAAC5A /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 082D241D2943A6F000DAAC5A /* SceneDelegate.swift */; }; - 2E11D9B5297ADDDC00662020 /* Lottie in Frameworks */ = {isa = PBXBuildFile; productRef = 2E11D9B4297ADDDC00662020 /* Lottie */; }; - 2E70924129968FC300E3F0B7 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E70924029968FC300E3F0B7 /* AppDelegate.swift */; }; - 2E70924329968FC300E3F0B7 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E70924229968FC300E3F0B7 /* ViewController.swift */; }; - 2E70924529968FC500E3F0B7 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2E70924429968FC500E3F0B7 /* Assets.xcassets */; }; - 2E70924829968FC500E3F0B7 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2E70924629968FC500E3F0B7 /* Main.storyboard */; }; - 2E70924D29968FEA00E3F0B7 /* LottieLogo1.json in Resources */ = {isa = PBXBuildFile; fileRef = 082D241A2943A6F000DAAC5A /* LottieLogo1.json */; }; - 2E70924F29968FF900E3F0B7 /* Lottie in Frameworks */ = {isa = PBXBuildFile; productRef = 2E70924E29968FF900E3F0B7 /* Lottie */; }; + 0816EC182AB12BBF007D7F3F /* Lottie in Frameworks */ = {isa = PBXBuildFile; productRef = 0816EC172AB12BBF007D7F3F /* Lottie */; }; + 08CB607E2AB127E10059AF6F /* ExampleApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08CB607D2AB127E10059AF6F /* ExampleApp.swift */; }; + 08CB60802AB127E10059AF6F /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08CB607F2AB127E10059AF6F /* ContentView.swift */; }; + 08CB60822AB127E20059AF6F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 08CB60812AB127E20059AF6F /* Assets.xcassets */; }; + 08CB608B2AB128060059AF6F /* LottieLogo1.json in Resources */ = {isa = PBXBuildFile; fileRef = 08CB608A2AB128060059AF6F /* LottieLogo1.json */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 082D23EB2943A62100DAAC5A /* Example (iOS).app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Example (iOS).app"; sourceTree = BUILT_PRODUCTS_DIR; }; - 082D24142943A6F000DAAC5A /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - 082D24152943A6F000DAAC5A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 082D24172943A6F000DAAC5A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 082D24192943A6F000DAAC5A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 082D241A2943A6F000DAAC5A /* LottieLogo1.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = LottieLogo1.json; sourceTree = ""; }; - 082D241B2943A6F000DAAC5A /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 082D241C2943A6F000DAAC5A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 082D241D2943A6F000DAAC5A /* SceneDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; - 08CA5AF1299D468900066293 /* Example (iOS).entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Example (iOS).entitlements"; sourceTree = ""; }; - 2E70923E29968FC300E3F0B7 /* Example (macOS).app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Example (macOS).app"; sourceTree = BUILT_PRODUCTS_DIR; }; - 2E70924029968FC300E3F0B7 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 2E70924229968FC300E3F0B7 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - 2E70924429968FC500E3F0B7 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 2E70924729968FC500E3F0B7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 2E70924929968FC500E3F0B7 /* macOS_Example.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = macOS_Example.entitlements; sourceTree = ""; }; + 08CB607B2AB127E10059AF6F /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 08CB607D2AB127E10059AF6F /* ExampleApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleApp.swift; sourceTree = ""; }; + 08CB607F2AB127E10059AF6F /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 08CB60812AB127E20059AF6F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 08CB60832AB127E20059AF6F /* Example.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Example.entitlements; sourceTree = ""; }; + 08CB608A2AB128060059AF6F /* LottieLogo1.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = LottieLogo1.json; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 082D23E82943A62100DAAC5A /* Frameworks */ = { + 08CB60782AB127E10059AF6F /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 2E11D9B5297ADDDC00662020 /* Lottie in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 2E70923B29968FC300E3F0B7 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 2E70924F29968FF900E3F0B7 /* Lottie in Frameworks */, + 0816EC182AB12BBF007D7F3F /* Lottie in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -65,8 +38,7 @@ 082D23E22943A62100DAAC5A = { isa = PBXGroup; children = ( - 082D24132943A6F000DAAC5A /* iOS */, - 2E70923F29968FC300E3F0B7 /* macOS */, + 08CB607C2AB127E10059AF6F /* Example */, 082D23EC2943A62100DAAC5A /* Products */, 2E11D9AD297ADBA900662020 /* Frameworks */, ); @@ -75,26 +47,21 @@ 082D23EC2943A62100DAAC5A /* Products */ = { isa = PBXGroup; children = ( - 082D23EB2943A62100DAAC5A /* Example (iOS).app */, - 2E70923E29968FC300E3F0B7 /* Example (macOS).app */, + 08CB607B2AB127E10059AF6F /* Example.app */, ); name = Products; sourceTree = ""; }; - 082D24132943A6F000DAAC5A /* iOS */ = { + 08CB607C2AB127E10059AF6F /* Example */ = { isa = PBXGroup; children = ( - 08CA5AF1299D468900066293 /* Example (iOS).entitlements */, - 082D24142943A6F000DAAC5A /* ViewController.swift */, - 082D24152943A6F000DAAC5A /* Assets.xcassets */, - 082D24162943A6F000DAAC5A /* LaunchScreen.storyboard */, - 082D24182943A6F000DAAC5A /* Main.storyboard */, - 082D241A2943A6F000DAAC5A /* LottieLogo1.json */, - 082D241B2943A6F000DAAC5A /* AppDelegate.swift */, - 082D241C2943A6F000DAAC5A /* Info.plist */, - 082D241D2943A6F000DAAC5A /* SceneDelegate.swift */, + 08CB607D2AB127E10059AF6F /* ExampleApp.swift */, + 08CB607F2AB127E10059AF6F /* ContentView.swift */, + 08CB608A2AB128060059AF6F /* LottieLogo1.json */, + 08CB60812AB127E20059AF6F /* Assets.xcassets */, + 08CB60832AB127E20059AF6F /* Example.entitlements */, ); - path = iOS; + path = Example; sourceTree = ""; }; 2E11D9AD297ADBA900662020 /* Frameworks */ = { @@ -104,59 +71,27 @@ name = Frameworks; sourceTree = ""; }; - 2E70923F29968FC300E3F0B7 /* macOS */ = { - isa = PBXGroup; - children = ( - 2E70924029968FC300E3F0B7 /* AppDelegate.swift */, - 2E70924229968FC300E3F0B7 /* ViewController.swift */, - 2E70924429968FC500E3F0B7 /* Assets.xcassets */, - 2E70924629968FC500E3F0B7 /* Main.storyboard */, - 2E70924929968FC500E3F0B7 /* macOS_Example.entitlements */, - ); - path = macOS; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 082D23EA2943A62100DAAC5A /* Example (iOS) */ = { + 08CB607A2AB127E10059AF6F /* Example */ = { isa = PBXNativeTarget; - buildConfigurationList = 082D23FF2943A62200DAAC5A /* Build configuration list for PBXNativeTarget "Example (iOS)" */; + buildConfigurationList = 08CB60872AB127E20059AF6F /* Build configuration list for PBXNativeTarget "Example" */; buildPhases = ( - 082D23E72943A62100DAAC5A /* Sources */, - 082D23E82943A62100DAAC5A /* Frameworks */, - 082D23E92943A62100DAAC5A /* Resources */, + 08CB60772AB127E10059AF6F /* Sources */, + 08CB60782AB127E10059AF6F /* Frameworks */, + 08CB60792AB127E10059AF6F /* Resources */, ); buildRules = ( ); dependencies = ( ); - name = "Example (iOS)"; + name = Example; packageProductDependencies = ( - 2E11D9B4297ADDDC00662020 /* Lottie */, + 0816EC172AB12BBF007D7F3F /* Lottie */, ); productName = Example; - productReference = 082D23EB2943A62100DAAC5A /* Example (iOS).app */; - productType = "com.apple.product-type.application"; - }; - 2E70923D29968FC300E3F0B7 /* Example (macOS) */ = { - isa = PBXNativeTarget; - buildConfigurationList = 2E70924C29968FC500E3F0B7 /* Build configuration list for PBXNativeTarget "Example (macOS)" */; - buildPhases = ( - 2E70923A29968FC300E3F0B7 /* Sources */, - 2E70923B29968FC300E3F0B7 /* Frameworks */, - 2E70923C29968FC300E3F0B7 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "Example (macOS)"; - packageProductDependencies = ( - 2E70924E29968FF900E3F0B7 /* Lottie */, - ); - productName = "macOS Example"; - productReference = 2E70923E29968FC300E3F0B7 /* Example (macOS).app */; + productReference = 08CB607B2AB127E10059AF6F /* Example.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -166,14 +101,11 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = 1; - LastSwiftUpdateCheck = 1420; + LastSwiftUpdateCheck = 1500; LastUpgradeCheck = 1420; TargetAttributes = { - 082D23EA2943A62100DAAC5A = { - CreatedOnToolsVersion = 14.1; - }; - 2E70923D29968FC300E3F0B7 = { - CreatedOnToolsVersion = 14.2; + 08CB607A2AB127E10059AF6F = { + CreatedOnToolsVersion = 15.0; }; }; }; @@ -192,85 +124,35 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 082D23EA2943A62100DAAC5A /* Example (iOS) */, - 2E70923D29968FC300E3F0B7 /* Example (macOS) */, + 08CB607A2AB127E10059AF6F /* Example */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 082D23E92943A62100DAAC5A /* Resources */ = { + 08CB60792AB127E10059AF6F /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 082D24212943A6F100DAAC5A /* Main.storyboard in Resources */, - 082D241F2943A6F100DAAC5A /* Assets.xcassets in Resources */, - 082D24202943A6F100DAAC5A /* LaunchScreen.storyboard in Resources */, - 082D24222943A6F100DAAC5A /* LottieLogo1.json in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 2E70923C29968FC300E3F0B7 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 2E70924529968FC500E3F0B7 /* Assets.xcassets in Resources */, - 2E70924D29968FEA00E3F0B7 /* LottieLogo1.json in Resources */, - 2E70924829968FC500E3F0B7 /* Main.storyboard in Resources */, + 08CB60822AB127E20059AF6F /* Assets.xcassets in Resources */, + 08CB608B2AB128060059AF6F /* LottieLogo1.json in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - 082D23E72943A62100DAAC5A /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 082D24232943A6F100DAAC5A /* AppDelegate.swift in Sources */, - 082D241E2943A6F100DAAC5A /* ViewController.swift in Sources */, - 082D24252943A6F100DAAC5A /* SceneDelegate.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 2E70923A29968FC300E3F0B7 /* Sources */ = { + 08CB60772AB127E10059AF6F /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 2E70924329968FC300E3F0B7 /* ViewController.swift in Sources */, - 2E70924129968FC300E3F0B7 /* AppDelegate.swift in Sources */, + 08CB60802AB127E10059AF6F /* ContentView.swift in Sources */, + 08CB607E2AB127E10059AF6F /* ExampleApp.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXVariantGroup section */ - 082D24162943A6F000DAAC5A /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 082D24172943A6F000DAAC5A /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; - 082D24182943A6F000DAAC5A /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 082D24192943A6F000DAAC5A /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 2E70924629968FC500E3F0B7 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 2E70924729968FC500E3F0B7 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - /* Begin XCBuildConfiguration section */ 082D23FD2943A62200DAAC5A /* Debug */ = { isa = XCBuildConfiguration; @@ -322,7 +204,8 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + MACOSX_DEPLOYMENT_TARGET = 10.11; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -376,7 +259,8 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + MACOSX_DEPLOYMENT_TARGET = 10.11; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = iphoneos; @@ -386,125 +270,86 @@ }; name = Release; }; - 082D24002943A62200DAAC5A /* Debug */ = { + 08CB60882AB127E20059AF6F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_ENTITLEMENTS = "iOS/Example (iOS).entitlements"; + CODE_SIGN_ENTITLEMENTS = Example/Example.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = FZ89A5SZ7C; + ENABLE_PREVIEWS = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = iOS/Info.plist; - INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; - INFOPLIST_KEY_UIMainStoryboardFile = Main; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphoneos*]" = UIStatusBarStyleDefault; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MACOSX_DEPLOYMENT_TARGET = 12.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = com.airbnb.lottie.Example; PRODUCT_NAME = "$(TARGET_NAME)"; - SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; - SUPPORTS_MACCATALYST = YES; - SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; + SDKROOT = auto; + SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx xros xrsimulator"; + SUPPORTS_MACCATALYST = NO; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; + TARGETED_DEVICE_FAMILY = "1,2,3,7"; + TVOS_DEPLOYMENT_TARGET = 15.0; }; name = Debug; }; - 082D24012943A62200DAAC5A /* Release */ = { + 08CB60892AB127E20059AF6F /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_ENTITLEMENTS = "iOS/Example (iOS).entitlements"; + CODE_SIGN_ENTITLEMENTS = Example/Example.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = FZ89A5SZ7C; + ENABLE_PREVIEWS = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = iOS/Info.plist; - INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; - INFOPLIST_KEY_UIMainStoryboardFile = Main; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphoneos*]" = UIStatusBarStyleDefault; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MACOSX_DEPLOYMENT_TARGET = 12.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = com.airbnb.lottie.Example; PRODUCT_NAME = "$(TARGET_NAME)"; - SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; - SUPPORTS_MACCATALYST = YES; - SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; - 2E70924A29968FC500E3F0B7 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_ENTITLEMENTS = macOS/macOS_Example.entitlements; - CODE_SIGN_IDENTITY = "-"; - CODE_SIGN_STYLE = Automatic; - COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1; - DEAD_CODE_STRIPPING = YES; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_KEY_NSHumanReadableCopyright = ""; - INFOPLIST_KEY_NSMainStoryboardFile = Main; - INFOPLIST_KEY_NSPrincipalClass = NSApplication; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - ); - MACOSX_DEPLOYMENT_TARGET = 13.0; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = "com.airbnb.lottie.macOS-Example"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = macosx; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; - }; - name = Debug; - }; - 2E70924B29968FC500E3F0B7 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_ENTITLEMENTS = macOS/macOS_Example.entitlements; - CODE_SIGN_IDENTITY = "-"; - CODE_SIGN_STYLE = Automatic; - COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1; - DEAD_CODE_STRIPPING = YES; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_KEY_NSHumanReadableCopyright = ""; - INFOPLIST_KEY_NSMainStoryboardFile = Main; - INFOPLIST_KEY_NSPrincipalClass = NSApplication; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - ); - MACOSX_DEPLOYMENT_TARGET = 13.0; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = "com.airbnb.lottie.macOS-Example"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = macosx; + SDKROOT = auto; + SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx xros xrsimulator"; + SUPPORTS_MACCATALYST = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2,3,7"; + TVOS_DEPLOYMENT_TARGET = 15.0; }; name = Release; }; @@ -520,20 +365,11 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 082D23FF2943A62200DAAC5A /* Build configuration list for PBXNativeTarget "Example (iOS)" */ = { + 08CB60872AB127E20059AF6F /* Build configuration list for PBXNativeTarget "Example" */ = { isa = XCConfigurationList; buildConfigurations = ( - 082D24002943A62200DAAC5A /* Debug */, - 082D24012943A62200DAAC5A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 2E70924C29968FC500E3F0B7 /* Build configuration list for PBXNativeTarget "Example (macOS)" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 2E70924A29968FC500E3F0B7 /* Debug */, - 2E70924B29968FC500E3F0B7 /* Release */, + 08CB60882AB127E20059AF6F /* Debug */, + 08CB60892AB127E20059AF6F /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -541,11 +377,7 @@ /* End XCConfigurationList section */ /* Begin XCSwiftPackageProductDependency section */ - 2E11D9B4297ADDDC00662020 /* Lottie */ = { - isa = XCSwiftPackageProductDependency; - productName = Lottie; - }; - 2E70924E29968FF900E3F0B7 /* Lottie */ = { + 0816EC172AB12BBF007D7F3F /* Lottie */ = { isa = XCSwiftPackageProductDependency; productName = Lottie; }; diff --git a/Example/Example.xcodeproj/xcshareddata/xcschemes/Example (iOS).xcscheme b/Example/Example.xcodeproj/xcshareddata/xcschemes/Example (iOS).xcscheme deleted file mode 100644 index 9ef7f65..0000000 --- a/Example/Example.xcodeproj/xcshareddata/xcschemes/Example (iOS).xcscheme +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Example/Example.xcodeproj/xcshareddata/xcschemes/Example (macOS).xcscheme b/Example/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme similarity index 78% rename from Example/Example.xcodeproj/xcshareddata/xcschemes/Example (macOS).xcscheme rename to Example/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme index 84a7338..df38452 100644 --- a/Example/Example.xcodeproj/xcshareddata/xcschemes/Example (macOS).xcscheme +++ b/Example/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme @@ -1,7 +1,7 @@ + LastUpgradeVersion = "1500" + version = "1.7"> @@ -14,9 +14,9 @@ buildForAnalyzing = "YES"> @@ -26,9 +26,8 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - shouldUseLaunchSchemeArgsEnv = "YES"> - - + shouldUseLaunchSchemeArgsEnv = "YES" + shouldAutocreateTestPlan = "YES"> @@ -61,9 +60,9 @@ runnableDebuggingMode = "0"> diff --git a/Example/iOS/Assets.xcassets/AccentColor.colorset/Contents.json b/Example/Example/Assets.xcassets/AccentColor.colorset/Contents.json similarity index 100% rename from Example/iOS/Assets.xcassets/AccentColor.colorset/Contents.json rename to Example/Example/Assets.xcassets/AccentColor.colorset/Contents.json diff --git a/Example/macOS/Assets.xcassets/AppIcon.appiconset/Contents.json b/Example/Example/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 90% rename from Example/macOS/Assets.xcassets/AppIcon.appiconset/Contents.json rename to Example/Example/Assets.xcassets/AppIcon.appiconset/Contents.json index 3f00db4..532cd72 100644 --- a/Example/macOS/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/Example/Example/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,5 +1,10 @@ { "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, { "idiom" : "mac", "scale" : "1x", diff --git a/Example/iOS/Assets.xcassets/Contents.json b/Example/Example/Assets.xcassets/Contents.json similarity index 100% rename from Example/iOS/Assets.xcassets/Contents.json rename to Example/Example/Assets.xcassets/Contents.json diff --git a/Example/Example/ContentView.swift b/Example/Example/ContentView.swift new file mode 100644 index 0000000..5d7f71b --- /dev/null +++ b/Example/Example/ContentView.swift @@ -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 { + var body: some View { + VStack { + Spacer() + Text("lottie-spm") + Spacer() + + LottieView(animation: .named("LottieLogo1")) + .playing(loopMode: .loop) + } + } +} diff --git a/Example/macOS/macOS_Example.entitlements b/Example/Example/Example.entitlements similarity index 100% rename from Example/macOS/macOS_Example.entitlements rename to Example/Example/Example.entitlements diff --git a/Example/Example/ExampleApp.swift b/Example/Example/ExampleApp.swift new file mode 100644 index 0000000..f2d5f45 --- /dev/null +++ b/Example/Example/ExampleApp.swift @@ -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() + } + } +} diff --git a/Example/iOS/LottieLogo1.json b/Example/Example/LottieLogo1.json similarity index 100% rename from Example/iOS/LottieLogo1.json rename to Example/Example/LottieLogo1.json diff --git a/Example/iOS/AppDelegate.swift b/Example/iOS/AppDelegate.swift deleted file mode 100644 index 2ead9dc..0000000 --- a/Example/iOS/AppDelegate.swift +++ /dev/null @@ -1,16 +0,0 @@ -// Created by Cal Stephens on 12/9/22. -// Copyright © 2022 Airbnb Inc. All rights reserved. - -import UIKit - -@main -class AppDelegate: UIResponder, UIApplicationDelegate { - func application( - _ application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) - -> Bool - { - return true - } -} - diff --git a/Example/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json b/Example/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 13613e3..0000000 --- a/Example/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "platform" : "ios", - "size" : "1024x1024" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/Example/iOS/Base.lproj/LaunchScreen.storyboard b/Example/iOS/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index 865e932..0000000 --- a/Example/iOS/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Example/iOS/Base.lproj/Main.storyboard b/Example/iOS/Base.lproj/Main.storyboard deleted file mode 100644 index 25a7638..0000000 --- a/Example/iOS/Base.lproj/Main.storyboard +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Example/iOS/Example (iOS).entitlements b/Example/iOS/Example (iOS).entitlements deleted file mode 100644 index ee95ab7..0000000 --- a/Example/iOS/Example (iOS).entitlements +++ /dev/null @@ -1,10 +0,0 @@ - - - - - com.apple.security.app-sandbox - - com.apple.security.network.client - - - diff --git a/Example/iOS/Info.plist b/Example/iOS/Info.plist deleted file mode 100644 index dd3c9af..0000000 --- a/Example/iOS/Info.plist +++ /dev/null @@ -1,25 +0,0 @@ - - - - - UIApplicationSceneManifest - - UIApplicationSupportsMultipleScenes - - UISceneConfigurations - - UIWindowSceneSessionRoleApplication - - - UISceneConfigurationName - Default Configuration - UISceneDelegateClassName - $(PRODUCT_MODULE_NAME).SceneDelegate - UISceneStoryboardFile - Main - - - - - - diff --git a/Example/iOS/SceneDelegate.swift b/Example/iOS/SceneDelegate.swift deleted file mode 100644 index fe9df56..0000000 --- a/Example/iOS/SceneDelegate.swift +++ /dev/null @@ -1,9 +0,0 @@ -// Created by Cal Stephens on 12/9/22. -// Copyright © 2022 Airbnb Inc. All rights reserved. - -import UIKit - -class SceneDelegate: UIResponder, UIWindowSceneDelegate { - var window: UIWindow? -} - diff --git a/Example/iOS/ViewController.swift b/Example/iOS/ViewController.swift deleted file mode 100644 index 0a9d995..0000000 --- a/Example/iOS/ViewController.swift +++ /dev/null @@ -1,27 +0,0 @@ -// Created by Cal Stephens on 12/9/22. -// Copyright © 2022 Airbnb Inc. All rights reserved. - -import UIKit -import Lottie - -class ViewController: UIViewController { - - override func viewDidLoad() { - super.viewDidLoad() - - let animationView = LottieAnimationView(name: "LottieLogo1") - animationView.translatesAutoresizingMaskIntoConstraints = false - view.addSubview(animationView) - - NSLayoutConstraint.activate([ - animationView.topAnchor.constraint(equalTo: view.topAnchor), - animationView.leftAnchor.constraint(equalTo: view.leftAnchor), - animationView.rightAnchor.constraint(equalTo: view.rightAnchor), - animationView.bottomAnchor.constraint(equalTo: view.bottomAnchor), - ]) - - animationView.loopMode = .loop - animationView.play() - } - -} diff --git a/Example/macOS/AppDelegate.swift b/Example/macOS/AppDelegate.swift deleted file mode 100644 index 42d67b9..0000000 --- a/Example/macOS/AppDelegate.swift +++ /dev/null @@ -1,12 +0,0 @@ -// Created by Cal Stephens on 2/1/23. -// Copyright © 2023 Airbnb Inc. All rights reserved. - -import Cocoa - -@main -class AppDelegate: NSObject, NSApplicationDelegate { - func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { - return true - } -} - diff --git a/Example/macOS/Assets.xcassets/AccentColor.colorset/Contents.json b/Example/macOS/Assets.xcassets/AccentColor.colorset/Contents.json deleted file mode 100644 index eb87897..0000000 --- a/Example/macOS/Assets.xcassets/AccentColor.colorset/Contents.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "colors" : [ - { - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/Example/macOS/Assets.xcassets/Contents.json b/Example/macOS/Assets.xcassets/Contents.json deleted file mode 100644 index 73c0059..0000000 --- a/Example/macOS/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/Example/macOS/Base.lproj/Main.storyboard b/Example/macOS/Base.lproj/Main.storyboard deleted file mode 100644 index e7682a6..0000000 --- a/Example/macOS/Base.lproj/Main.storyboard +++ /dev/null @@ -1,717 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Default - - - - - - - Left to Right - - - - - - - Right to Left - - - - - - - - - - - Default - - - - - - - Left to Right - - - - - - - Right to Left - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Example/macOS/ViewController.swift b/Example/macOS/ViewController.swift deleted file mode 100644 index 3be8ae0..0000000 --- a/Example/macOS/ViewController.swift +++ /dev/null @@ -1,27 +0,0 @@ -// Created by Cal Stephens on 2/1/23. -// Copyright © 2023 Airbnb Inc. All rights reserved. - -import Cocoa -import Lottie - -class ViewController: NSViewController { - - override func viewDidLoad() { - super.viewDidLoad() - - let animationView = LottieAnimationView(name: "LottieLogo1") - animationView.translatesAutoresizingMaskIntoConstraints = false - view.addSubview(animationView) - - NSLayoutConstraint.activate([ - animationView.topAnchor.constraint(equalTo: view.topAnchor), - animationView.leftAnchor.constraint(equalTo: view.leftAnchor), - animationView.rightAnchor.constraint(equalTo: view.rightAnchor), - animationView.bottomAnchor.constraint(equalTo: view.bottomAnchor), - ]) - - animationView.loopMode = .loop - animationView.play() - } - -} diff --git a/Gemfile.lock b/Gemfile.lock index 22e9a19..9d517a4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,6 +8,7 @@ GEM PLATFORMS universal-darwin-22 + universal-darwin-23 DEPENDENCIES rake (~> 13.0.0)! diff --git a/Package.swift b/Package.swift index 1458c14..d37c6ad 100644 --- a/Package.swift +++ b/Package.swift @@ -2,21 +2,37 @@ import PackageDescription +#if compiler(>=5.9) +/// TODO: Update to Lottie 4.4.0 +/// A precompiled XCFramework of the lottie-ios repo that was compiled with Xcode 15.2 / Swift 5.9. +/// This XCFramework can be use by Xcode 15.0 and later. +let lottieXCFramework = Target.binaryTarget( + name: "Lottie", + url: "https://github.com/airbnb/lottie-ios/releases/download/4.3.4/Lottie.xcframework.zip", + checksum: "33c4efc87130f751e8a4bee1de5c557c6821566e05d0fa77cdcc1beae23858ca") +#else +/// TODO: Update to Lottie 4.4.0 +/// A precompiled XCFramework of the lottie-ios repo that was compiled with Xcode 14.1 / Swift 5.7. +/// This XCFramework bundle doesn't support visionOS, but does support Xcode 14. +let lottieXCFramework = Target.binaryTarget( + name: "Lottie", + url: "https://github.com/airbnb/lottie-ios/releases/download/4.3.4/Lottie.xcframework.zip", + checksum: "33c4efc87130f751e8a4bee1de5c557c6821566e05d0fa77cdcc1beae23858ca") +#endif + let package = Package( name: "Lottie", - platforms: [.iOS("11.0"), .macOS("10.11"), .tvOS("11.0")], + platforms: [.iOS("11.0"), .macOS("10.11"), .tvOS("11.0"), .custom("visionOS", versionString: "1.0")], products: [.library(name: "Lottie", targets: ["Lottie", "_LottieStub"])], targets: [ - .binaryTarget( - name: "Lottie", - url: "https://github.com/airbnb/lottie-ios/releases/download/4.3.4/Lottie.xcframework.zip", - checksum: "33c4efc87130f751e8a4bee1de5c557c6821566e05d0fa77cdcc1beae23858ca"), + lottieXCFramework, // Without at least one regular (non-binary) target, this package doesn't show up // in Xcode under "Frameworks, Libraries, and Embedded Content". That prevents // Lottie from being embedded in the app product, causing the app to crash when // ran on a physical device. As a workaround, we can include a stub target // with at least one source file. + // https://github.com/apple/swift-package-manager/issues/6069 .target(name: "_LottieStub"), .testTarget( diff --git a/Rakefile b/Rakefile index 0078573..383c130 100644 --- a/Rakefile +++ b/Rakefile @@ -2,35 +2,49 @@ namespace :build do desc 'Builds the Lottie example app' namespace :example do desc 'Builds the Example apps for all supported platforms / architectures. Requires valid code signing.' - task all: ['iOS:simulator', 'iOS:device', 'macOS:arm64', 'macOS:x86_64', 'macCatalyst:arm64', 'macCatalyst:x86_64'] + task all: ['iOS:simulator', 'iOS:device', 'tvOS:simulator', 'visionOS:simulator', 'macOS:arm64', 'macOS:x86_64', 'macCatalyst:arm64', 'macCatalyst:x86_64'] desc 'Builds the Example app for platforms / architectures supported by Github Actions CI' - task github_actions: ['iOS:simulator', 'macOS:x86_64'] + task github_actions: ['iOS:simulator', 'tvOS:simulator', 'visionOS:simulator', 'macOS:x86_64'] namespace :iOS do task :simulator do - xcodebuild('build -scheme "Example (iOS)" -destination "platform=iOS Simulator,name=iPhone SE (3rd generation)" -workspace Example/Example.xcworkspace') + xcodebuild('build -scheme "Example" -destination "platform=iOS Simulator,name=iPhone SE (3rd generation)" -workspace Example/Example.xcworkspace') end task :device do - xcodebuild('build -scheme "Example (iOS)" -destination generic/platform=iOS -workspace Example/Example.xcworkspace') + xcodebuild('build -scheme "Example" -destination generic/platform=iOS -workspace Example/Example.xcworkspace') + end + end + + namespace :tvOS do + task :simulator do + xcodebuild('build -scheme "Example" -destination "platform=tvOS Simulator,name=Apple TV 4K (3rd generation)" -workspace Example/Example.xcworkspace') + end + end + + namespace :visionOS do + task :simulator do + ifVisionOSEnabled { + xcodebuild('build -scheme "Example" -destination "platform=visionOS Simulator,name=Apple Vision Pro" -workspace Example/Example.xcworkspace') + } end end namespace :macOS do task :arm64 do - xcodebuild('build -scheme "Example (macOS)" -destination "platform=macOS,arch=arm64" -workspace Example/Example.xcworkspace') + xcodebuild('build -scheme "Example" -destination "platform=macOS,arch=arm64" -workspace Example/Example.xcworkspace') end task :x86_64 do - xcodebuild('build -scheme "Example (macOS)" -destination "platform=macOS,arch=x86_64" -workspace Example/Example.xcworkspace') + xcodebuild('build -scheme "Example" -destination "platform=macOS,arch=x86_64" -workspace Example/Example.xcworkspace') end end namespace :macCatalyst do task :arm64 do - xcodebuild('build -scheme "Example (iOS)" -destination "platform=macOS,variant=Mac Catalyst,arch=arm64" -workspace Example/Example.xcworkspace') + xcodebuild('build -scheme "Example" -destination "platform=macOS,variant=Mac Catalyst,arch=arm64" -workspace Example/Example.xcworkspace') end task :x86_64 do - xcodebuild('build -scheme "Example (iOS)" -destination "platform=macOS,variant=Mac Catalyst,arch=x86_64" -workspace Example/Example.xcworkspace') + xcodebuild('build -scheme "Example" -destination "platform=macOS,variant=Mac Catalyst,arch=x86_64" -workspace Example/Example.xcworkspace') end end end @@ -40,7 +54,7 @@ namespace :test do desc 'Tests the Lottie package for supported platforms' namespace :package do desc 'Tests the Lottie package for all supported platforms' - task all: ['iOS', 'macOS', 'tvOS'] + task all: ['iOS', 'macOS', 'tvOS', 'visionOS'] desc 'Tests the Lottie package for iOS' task :iOS do @@ -56,6 +70,13 @@ namespace :test do task :tvOS do xcodebuild('test -scheme Lottie -destination "platform=tvOS Simulator,name=Apple TV"') end + + desc 'Tests the Lottie package for visionOS' + task :visionOS do + ifVisionOSEnabled { + xcodebuild('test -scheme Lottie -destination "platform=visionOS Simulator,name=Apple Vision Pro"') + } + end end end @@ -69,3 +90,23 @@ def xcodebuild(command) sh "xcodebuild #{command}" end end + +# Runs the given code block, unless `SKIP_VISION_OS=true`. +# TODO: Remove this once CI only uses Xcode 15.2+. +def ifVisionOSEnabled + if ENV["SKIP_VISION_OS"] == "true" + puts "Skipping visionOS build" + else + 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