diff --git a/.jazzy.yaml b/.jazzy.yaml index fbd6fcc8..1728502d 100644 --- a/.jazzy.yaml +++ b/.jazzy.yaml @@ -1,11 +1,11 @@ # jazzy --help config module: SKTiled -module_version: 1.22 +module_version: 1.23 author: Michael Fessenden author_url: https://github.com/mfessenden github_url: https://github.com/mfessenden/SKTiled dash_url: https://mfessenden.github.io/SKTiled/docsets/SKTiled.xml -github_file_prefix: https://github.com/mfessenden/SKTiled/tree/1.22 +github_file_prefix: https://github.com/mfessenden/SKTiled/tree/1.23 clean: true skip_undocumented: true output: Docs/html diff --git a/CHANGELOG.md b/CHANGELOG.md index ee29a157..60f9c8d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,19 @@ Change Log ========== +1.23 +----- + +#### Changes + +- add **Swift Package Manager** support +- add target for building binary framework + +#### Breaking + +- nothing + + 1.22 ----- diff --git a/Docs/Documentation/Getting Started.md b/Docs/Documentation/Getting Started.md index 767e30ae..ede54d92 100644 --- a/Docs/Documentation/Getting Started.md +++ b/Docs/Documentation/Getting Started.md @@ -3,7 +3,9 @@ - [Requirements](#requirements) - [Installation](#installation) - [Framework Installation](#framework-installation) + - [Swift Package Manager](#swift-package-manager) - [Carthage Installation](#carthage-installation) + - [Binary Frameworks](#binary-frameworks) - [CocoaPods Installation](#cocoapods-installation) - [Building the Demo Projects](#building-the-demo-projects) - [Building the Documentation](#building-the-documentation) @@ -27,11 +29,10 @@ ## Installation -The **SKTiled** project contains six targets; three are demo applications for iOS/tvOS/macOS. These are included to let you quickly test your own content, or simple play around with the included demo files. The other three are frameworks for use in your own projects. +The **SKTiled** project contains six targets; three are demo applications for iOS/tvOS/macOS. These are included to let you quickly test your own content, or simple play around with the included demo files. The other three are frameworks for use in your own projects. If the three demo targets do not appear in the active scheme list, choose **Manage Schemes** and press the **Autocreate Schemes Now** button. ![Project Schemes](images/project-schemes.png) -To use the frameworks, build the appropriate framework target and add to your project. Make sure the **Minimum Deployment Target** is set correctly for your project (iOS11+/macOS 10.12+/tvOS12+). ### Framework Installation @@ -39,24 +40,25 @@ To use the frameworks, build the appropriate framework target and add to your pr ![adding framework](images/framework.png) -After building the framework(s), you'll need to add them to your project. Select your target, and add the framework to the **Embedded Binaries** and **Linked Frameworks and Libraries** sections of the **General** tab. You'll also need to make sure it is linked in the **Build Phases > Embed Frameworks** section. +After building the framework(s), you'll need to link them with your project. Select your target, and add the framework to the **Frameworks, Libraries and Embedded Content** section. -![framework embed](images/links.png) +### Swift Package Manager +To add the SKTiled framework dependency to your Xcode project, select **File > Swift Packages > Add Package Dependency** and enter the repository URL. Once the dependency is resolved, you can add it to your targets by clicking the **`+`** button in the **Frameworks, Libraries and Embedded Content** area of the target's **General** tab. ### Carthage Installation -To build with [Carthage](https://github.com/Carthage/Carthage), create a Cartfile in your project root and add a reference to **SKTiled** (be sure to check the current version number): +To build with [Carthage](https://github.com/Carthage/Carthage), create a Cartfile in your project root and add a reference to **SKTiled**: - github "mfessenden/SKTiled" ~> 1.22 + github "mfessenden/SKTiled" Close the file and run Carthage from the terminal to build the framework(s): carthage update -To build for a specific platform, use the `platform` argument in your build command: +To build for a specific platform, use the `--platform` argument in your build command: carthage update --platform iOS @@ -66,6 +68,21 @@ Once you've run the build command frameworks are built, you'll find a **Carthage See the [Carthage](https://github.com/Carthage/Carthage) home page for help and additional build instructions. + +#### Binary Frameworks + +It's also possible to build the new binary **xcframework** framework for use with multiple platforms/architectures. Pass the `--use-xcframeworks` argument to the update command: + + + carthage update --use-xcframeworks + + +The resulting framework file **`SKTiled.xcframework`** can be added to your project via dragging it into the **General > Frameworks, Libraries, and Embedded Content** section of each target. Unlike normal frameworks, this framework can be used with *any* platform. If your project will be build for multiple processor architectures (x86, Apple ARM), this is the preferred method. + +![xcframework embed](images/embed-xcframeworks.svg) + +You'll need **Carthage v0.37.0** to build binary frameworks. See [**this issue**][carthage-issue-url] for more information. + ### CocoaPods Installation Installation with [CocoaPods](https://cocoapods.org) is similar to Carthage. Create a **podfile** in your project root with the command: @@ -79,7 +96,7 @@ Add references to **SKTiled** in each of your targets: use_frameworks! # Pods for iOS - pod 'SKTiled', '~> 1.22' + pod 'SKTiled', '~> 1.23' end @@ -87,7 +104,7 @@ Add references to **SKTiled** in each of your targets: use_frameworks! # Pods for macOS - pod 'SKTiled', '~> 1.22' + pod 'SKTiled', '~> 1.23' end @@ -95,7 +112,7 @@ Add references to **SKTiled** in each of your targets: use_frameworks! # Pods for tvOS - pod 'SKTiled', '~> 1.22' + pod 'SKTiled', '~> 1.23' end @@ -121,12 +138,12 @@ SAMPLE_CODE_DISAMBIGUATOR = ${DEVELOPMENT_TEAM} For more information, see the [**Apple Development Documentation**][apple-code-signing-url] on code signing requirements. - ### Building the Documentation To build the documentation, you'll need to install [**jazzy**][jazzy-url]. To build the html content, simply run the included script in a shell: - ./scripts/build-docs.sh + ./scripts/build-documentation.sh + ## tvOS Support @@ -198,3 +215,6 @@ Next: [Scene Setup](scene-setup.html) - [Index](Table of Contents.html) [working-with-maps-url]:working-with-maps.html#loading-a-tilemap [jazzy-url]:https://github.com/realm/jazzy [apple-code-signing-url]:https://developer.apple.com/library/archive/documentation/Security/Conceptual/CodeSigningGuide/Procedures/Procedures.html +[carthage-issue-url]:https://github.com/Carthage/Carthage/issues/3097 + +[adding-spm-url]:https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app diff --git a/Docs/Documentation/What's New.md b/Docs/Documentation/What's New.md index e63408c4..329a273e 100644 --- a/Docs/Documentation/What's New.md +++ b/Docs/Documentation/What's New.md @@ -19,7 +19,7 @@ ![Swift 5][swift-5-img] -With v1.22, **SKTiled** now supports **Swift 5.3**. +With v1.23, **SKTiled** now supports **Swift 5.3**. ## tvOS Support diff --git a/Docs/Start.md b/Docs/Start.md index 40ef183c..2dd30f56 100644 --- a/Docs/Start.md +++ b/Docs/Start.md @@ -7,7 +7,7 @@ [![Carthage Compatible][carthage-image]][carthage-url] [![Cocoapods Compatible][pod-image]][pod-url] -## SKTiled v1.22 Documentation +## SKTiled v1.23 Documentation - [What's New](whats-new.html) - [Getting Started](getting-started.html) diff --git a/Docs/images/embed-xcframeworks.svg b/Docs/images/embed-xcframeworks.svg new file mode 100644 index 00000000..11d6db3f --- /dev/null +++ b/Docs/images/embed-xcframeworks.svg @@ -0,0 +1,163 @@ + + + embed-xcframeworks + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SKTiled.xcframework + + + macOS + iOS + + + + + + + + + + + + + + + Embed + + + Platforms + + + Name + + + + + + + + Frameworks, Libraries, and Embedded Content + + + + + + + + + + + + + Do Not Embed + + + + + + + Embed & Sign + + + + + + Embed Without Signing + + + + + + diff --git a/Docs/images/link_binary.png b/Docs/images/link_binary.png deleted file mode 100644 index f275b121..00000000 Binary files a/Docs/images/link_binary.png and /dev/null differ diff --git a/Docs/images/links.png b/Docs/images/links.png index 5ae3e017..06a0d9ca 100644 Binary files a/Docs/images/links.png and b/Docs/images/links.png differ diff --git a/Docs/images/links@2x.png b/Docs/images/links@2x.png index b324aedb..3c85a659 100644 Binary files a/Docs/images/links@2x.png and b/Docs/images/links@2x.png differ diff --git a/Docs/images/sktiled-linked.png b/Docs/images/sktiled-linked.png new file mode 100644 index 00000000..3e782399 Binary files /dev/null and b/Docs/images/sktiled-linked.png differ diff --git a/README.md b/README.md index e984ad89..c0804859 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ ![Demo Image](Docs/images/demo-iphone.png?raw=true) -Check out the [**Official Documentation**][sktiled-12-doc-url]. +Check out the [**Official Documentation**][sktiled-12-doc-url]. ## Features @@ -39,6 +39,8 @@ Check out the [**Official Documentation**][sktiled-12-doc-url]. - [ ] infinite maps - [ ] tile collision objects - [ ] Zstandard compression support +- [ ] layer tinting +- [ ] file properties ## Requirements @@ -50,16 +52,28 @@ Check out the [**Official Documentation**][sktiled-12-doc-url]. ## Installation -### Carthage & CocoaPods Support + + +### Carthage For Carthage installation, create a Cartfile in the root of your project: - github "mfessenden/SKTiled" ~> 1.22 + github "mfessenden/SKTiled" ~> 1.2 + + +To use the new **[binary framework][binary-frameworks-url]** format, pass the **`--use-xcframeworks`** parameter to the build command: + + carthage update --use-xcframeworks + +For more information, see the **[Carthage Installation][docs-carthage-url]** documentation. + + +### CocoaPods For CocoaPods, install via a reference in your podfile: - pod 'SKTiled', '~> 1.22' + pod 'SKTiled', '~> 1.2' ## Usage @@ -87,6 +101,7 @@ Layers represent containers that hold various types of data: - tile layers hold an array of tile sprites and associated tileset data - object groups contain vector shape objects - image layers display a single image +- group layers encapsulate other layers All **SKTiled** layer types are subclasses of the base [`SKTiledLayerObject`][sktiledlayerobject-url] object and provide access to coordinate transformation and positioning information. Additionally, every layer type can have individual offset transforms and rendering flags. @@ -279,7 +294,7 @@ let allWalkable = tilemap.getTilesWithProperty("walkable", true") [carthage-image]:https://img.shields.io/badge/Carthage-compatible-4BC51D.svg [carthage-url]:https://github.com/Carthage/Carthage [pod-image]:https://img.shields.io/cocoapods/v/SKTiled.svg - +[mailto-url]:(mailto:michael.fessenden@gmail.com?subject=[SKTiled]%20Projects) [xcode11-image]:https://img.shields.io/badge/Xcode-11.0-orange.svg [xcode10-image]:https://img.shields.io/badge/Xcode-10.0-orange.svg @@ -312,6 +327,7 @@ let allWalkable = tilemap.getTilesWithProperty("walkable", true") [sktilelayer-url]:https://mfessenden.github.io/SKTiled/1.2/Classes/SKTileLayer.html [sktileobject-url]:https://mfessenden.github.io/SKTiled/1.2/Classes/SKTileObject.html [sktileset-url]:https://mfessenden.github.io/SKTiled/1.2/Classes/SKTileset.html +[docs-carthage-url]:https://mfessenden.github.io/SKTiled/1.3/getting-started.html#carthage-installation @@ -328,3 +344,4 @@ let allWalkable = tilemap.getTilesWithProperty("walkable", true") [uitouch-url]:https://developer.apple.com/documentation/uikit/uitouch [nsevent-url]:https://developer.apple.com/documentation/appkit/nsevent [swift-package-doc-url]:https://developer.apple.com/documentation/swift_packages +[binary-frameworks-url]:https://developer.apple.com/videos/play/wwdc2019/416/ diff --git a/SKTiled.podspec b/SKTiled.podspec index ea676a52..73fd85ec 100644 --- a/SKTiled.podspec +++ b/SKTiled.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "SKTiled" - s.version = "1.22" + s.version = "1.23" s.summary = "SKTiled is a framework for using Tiled content with Apple's SpriteKit." s.description = <<-DESC SKTiled is a framework for using Tiled content with Apple's SpriteKit, allowing the creation of game assets from .tmx files. diff --git a/SKTiled.xcodeproj/project.pbxproj b/SKTiled.xcodeproj/project.pbxproj index e8dfe216..d3fe89e7 100644 --- a/SKTiled.xcodeproj/project.pbxproj +++ b/SKTiled.xcodeproj/project.pbxproj @@ -6,6 +6,31 @@ objectVersion = 46; objects = { +/* Begin PBXAggregateTarget section */ + 4C328F6A26F2358C00EABFAB /* Build Documentation */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 4C328F6D26F2358C00EABFAB /* Build configuration list for PBXAggregateTarget "Build Documentation" */; + buildPhases = ( + 4C328F6E26F235AD00EABFAB /* Run Documentation Build */, + ); + dependencies = ( + ); + name = "Build Documentation"; + productName = "Build Docs"; + }; + 4C328F6F26F2374000EABFAB /* Build XCFramework */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 4C328F7126F2374000EABFAB /* Build configuration list for PBXAggregateTarget "Build XCFramework" */; + buildPhases = ( + 4C328F7026F2374000EABFAB /* Build XCFramework */, + ); + dependencies = ( + ); + name = "Build XCFramework"; + productName = "Build Docs"; + }; +/* End PBXAggregateTarget section */ + /* Begin PBXBuildFile section */ 4C01D3A91F1E07AB00FFAD28 /* SKTiled+GameplayKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C01D3A61F1E07AB00FFAD28 /* SKTiled+GameplayKit.swift */; }; 4C01D3AA1F1E07AB00FFAD28 /* SKTiled+GameplayKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C01D3A61F1E07AB00FFAD28 /* SKTiled+GameplayKit.swift */; }; @@ -1434,6 +1459,15 @@ }; }; }; + 4C328F6A26F2358C00EABFAB = { + CreatedOnToolsVersion = 13.0; + DevelopmentTeam = 747QKN4G7U; + ProvisioningStyle = Automatic; + }; + 4C328F6F26F2374000EABFAB = { + DevelopmentTeam = 747QKN4G7U; + ProvisioningStyle = Automatic; + }; 4C41A5DF1F437118001622FF = { CreatedOnToolsVersion = 8.3.3; LastSwiftMigration = 1150; @@ -1490,6 +1524,8 @@ 4CA6A7D82184F531002BC924 /* Tests (macOS) */, 4C4ADA622189F3F100DB1A02 /* Tests (iOS) */, 4C4ADA812189F5FB00DB1A02 /* Tests (tvOS) */, + 4C328F6A26F2358C00EABFAB /* Build Documentation */, + 4C328F6F26F2374000EABFAB /* Build XCFramework */, ); }; /* End PBXProject section */ @@ -1852,6 +1888,42 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 4C328F6E26F235AD00EABFAB /* Run Documentation Build */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Run Documentation Build"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "# Type a script or drag a script file from your workspace to insert its path.\n./$(PROJECT_DIR)/scripts/build-documentation.sh\n"; + }; + 4C328F7026F2374000EABFAB /* Build XCFramework */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Build XCFramework"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "# Type a script or drag a script file from your workspace to insert its path.\n./$(PROJECT_DIR)/scripts/build-xcframeworks.sh\n"; + }; 4C3496881EA513D9003900C8 /* Clean Assets */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -2455,6 +2527,42 @@ }; name = Release; }; + 4C328F6B26F2358C00EABFAB /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 747QKN4G7U; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 4C328F6C26F2358C00EABFAB /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 747QKN4G7U; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 4C328F7226F2374000EABFAB /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 747QKN4G7U; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 4C328F7326F2374000EABFAB /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 747QKN4G7U; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; 4C41A5E51F437118001622FF /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -2895,6 +3003,24 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 4C328F6D26F2358C00EABFAB /* Build configuration list for PBXAggregateTarget "Build Documentation" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4C328F6B26F2358C00EABFAB /* Debug */, + 4C328F6C26F2358C00EABFAB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 4C328F7126F2374000EABFAB /* Build configuration list for PBXAggregateTarget "Build XCFramework" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4C328F7226F2374000EABFAB /* Debug */, + 4C328F7326F2374000EABFAB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 4C41A5E71F437118001622FF /* Build configuration list for PBXNativeTarget "SKTiled-macOS" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/scripts/build-docs.sh b/scripts/build-documentation.sh similarity index 100% rename from scripts/build-docs.sh rename to scripts/build-documentation.sh diff --git a/scripts/build-xcframeworks.sh b/scripts/build-xcframeworks.sh new file mode 100755 index 00000000..83cb0636 --- /dev/null +++ b/scripts/build-xcframeworks.sh @@ -0,0 +1,159 @@ +#! /bin/sh +# +# Description: +# This script creates a binary framework for use with all supported platforms & architectures. + +HELP=" + +build-xcframeworks -- build binary frameworks script. + +Usage: build-xcframeworks [command] + +Options (general): + -h, --help print help message. + -c, --clean clean the build directories on exit. + -o, --output xcframework output path. +" + + +# Release dir path +PROJECT_PATH=$PWD +BUILD_DIR=${PROJECT_PATH}/build +ARCHIVE_DIR=${BUILD_DIR}/archives +FRAMEWORKS_DIR=${BUILD_DIR}/Frameworks +FRAMEWORK_FILE=${FRAMEWORKS_DIR}/SKTiled.xcframework + + +# parse arguments +CLEAN_BUILD_DIRS=0 +PARAMS="" +while (( "$#" )); do + case "$1" in + -h|--help) + printf '%s' "$HELP" + exit 0 + shift + ;; + -c|--clean) + CLEAN_BUILD_DIRS=1 + shift + ;; + -o|--output) + if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then + OUTPUT_PATH=$2 + FRAMEWORK_FILE=${OUTPUT_PATH}/SKTiled.xcframework + shift 2 + else + echo "Error: Argument for $1 is missing" >&2 + exit 1 + fi + ;; + -*|--*=) # unsupported flags + echo "Error: Unsupported flag $1" >&2 + exit 1 + ;; + *) # preserve positional arguments + PARAMS="$PARAMS $1" + shift + ;; + esac +done + +# set positional arguments in their proper place +eval set -- "$PARAMS" + +# remove the build dir if it exists +if [ -d $BUILD_DIR ] +then + rm -rf $BUILD_DIR +fi + +# remove the output file if it already exists +if [ -d $FRAMEWORK_FILE ] +then + rm -rf "$FRAMEWORK_FILE" +fi + + +mkdir $BUILD_DIR +mkdir $ARCHIVE_DIR + +if [ ! -d $FRAMEWORKS_DIR ] +then + mkdir $FRAMEWORKS_DIR +fi + + +# archive the various platforms... +xcodebuild archive \ +-project SKTiled.xcodeproj \ +-scheme SKTiled-macOS \ +-destination "generic/platform=macOS" \ +-archivePath ${ARCHIVE_DIR}/SKTiled-macOS \ +SKIP_INSTALL=NO \ +BUILD_LIBRARY_FOR_DISTRIBUTION=YES | xcpretty + + +xcodebuild archive \ +-project SKTiled.xcodeproj \ +-scheme SKTiled-iOS \ +-destination "generic/platform=iOS" \ +-archivePath ${ARCHIVE_DIR}/SKTiled-iOS \ +SKIP_INSTALL=NO \ +BUILD_LIBRARY_FOR_DISTRIBUTION=YES | xcpretty + + +xcodebuild archive \ +-project SKTiled.xcodeproj \ +-scheme SKTiled-iOS \ +-destination "generic/platform=iOS Simulator" \ +-archivePath ${ARCHIVE_DIR}/SKTiled-iOS-Sim \ +SKIP_INSTALL=NO \ +BUILD_LIBRARY_FOR_DISTRIBUTION=YES | xcpretty + + +xcodebuild archive \ +-project SKTiled.xcodeproj \ +-scheme SKTiled-tvOS \ +-destination "generic/platform=tvOS" \ +-archivePath ${ARCHIVE_DIR}/SKTiled-tvOS \ +SKIP_INSTALL=NO \ +BUILD_LIBRARY_FOR_DISTRIBUTION=YES | xcpretty + + +xcodebuild archive \ +-project SKTiled.xcodeproj \ +-scheme SKTiled-tvOS \ +-destination "generic/platform=tvOS Simulator" \ +-archivePath ${ARCHIVE_DIR}/SKTiled-tvOS-Sim \ +SKIP_INSTALL=NO \ +BUILD_LIBRARY_FOR_DISTRIBUTION=YES | xcpretty + + +# create the xcframework +xcodebuild -create-xcframework \ +-framework ${ARCHIVE_DIR}/SKTiled-macOS.xcarchive/Products/Library/Frameworks/SKTiled.framework \ +-framework ${ARCHIVE_DIR}/SKTiled-iOS.xcarchive/Products/Library/Frameworks/SKTiled.framework \ +-framework ${ARCHIVE_DIR}/SKTiled-iOS-Sim.xcarchive/Products/Library/Frameworks/SKTiled.framework \ +-framework ${ARCHIVE_DIR}/SKTiled-tvOS.xcarchive/Products/Library/Frameworks/SKTiled.framework \ +-framework ${ARCHIVE_DIR}/SKTiled-tvOS-Sim.xcarchive/Products/Library/Frameworks/SKTiled.framework \ +-output ${BUILD_DIR}/SKTiled.xcframework | xcpretty + + +# move the resulting framework to the output directory +mv ${BUILD_DIR}/SKTiled.xcframework $FRAMEWORK_FILE + +if [ -d $FRAMEWORK_FILE ] +then + echo "▶︎ writing xcframework to '${FRAMEWORK_FILE}'" +else + echo "Error creating framework file '${FRAMEWORK_FILE}'" + exit 1 +fi + +# cleanup build directory on exit +if [ $CLEAN_BUILD_DIRS = 1 ] +then + echo "▶︎ cleaning up archives '${BUILD_DIR}'" + rm -rf "$BUILD_DIR" +fi