Skip to content

Commit

Permalink
Add deployment targets to samples (#570)
Browse files Browse the repository at this point in the history
* Add deployment targets to samples

* Define versions once

* Remove visionOS platform installation
  • Loading branch information
bamx23 committed Sep 21, 2024
1 parent d5bf3ba commit aff9901
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 26 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/build-sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,6 @@ jobs:
with:
xcode-version: latest-stable

- name: Install visionOS Platform
if: matrix.platform == 'visionOS'
shell: bash
run: |
# See https://github.com/actions/runner-images/issues/8144#issuecomment-1902072070
defaults write com.apple.dt.Xcode AllowUnsupportedVisionOSHost -bool YES
defaults write com.apple.CoreSimulator AllowUnsupportedVisionOSHost -bool YES
xcodebuild -downloadPlatform visionOS
- name: Install Tuist
run: |
brew tap tuist/tuist
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/cocoapods-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,6 @@ jobs:
with:
xcode-version: latest-stable

- name: Install visionOS Platform
if: matrix.platform == 'visionOS'
shell: bash
run: |
# See https://github.com/actions/runner-images/issues/8144#issuecomment-1902072070
defaults write com.apple.dt.Xcode AllowUnsupportedVisionOSHost -bool YES
defaults write com.apple.CoreSimulator AllowUnsupportedVisionOSHost -bool YES
xcodebuild -downloadPlatform visionOS
- name: Lint Podspec
id: lint
run: |
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ jobs:
with:
xcode-version: latest-stable

- name: Install visionOS Platform
shell: bash
run: |
# See https://github.com/actions/runner-images/issues/8144#issuecomment-1902072070
defaults write com.apple.dt.Xcode AllowUnsupportedVisionOSHost -bool YES
defaults write com.apple.CoreSimulator AllowUnsupportedVisionOSHost -bool YES
xcodebuild -downloadPlatform visionOS
- name: Update version in podspec
run: sed -i '' 's/s.version = "[^"]*"/s.version = "${{ github.event.inputs.version }}"/' KSCrash.podspec

Expand Down
20 changes: 20 additions & 0 deletions Samples/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ let project = Project(
destinations: .allForSample,
product: .app,
bundleId: "com.github.kstenerud.KSCrash.Sample",
deploymentTargets: .allForSample,
infoPlist: InfoPlist.extendingDefault(with: [
"UILaunchScreen": [
"UIImageName": "LaunchImage",
Expand All @@ -31,6 +32,7 @@ let project = Project(
destinations: .allForSample.subtracting(.visionOS),
product: .uiTests,
bundleId: "com.github.kstenerud.KSCrash.Sample.Tests",
deploymentTargets: .allForSample.excludingVisionOS,
sources: ["Tests/**"],
dependencies: [
.target(name: "Sample"),
Expand Down Expand Up @@ -64,3 +66,21 @@ extension Set where Element == ProjectDescription.Destination {
return sets.reduce(.init()) { $0.union($1) }
}
}

extension DeploymentTargets {
static var allForSample: Self {
.multiplatform(
iOS: "15.0",
macOS: "13.0",
watchOS: "8.0",
tvOS: "15.0",
visionOS: "1.0"
)
}

var excludingVisionOS: Self {
var excluded = self
excluded.visionOS = nil
return excluded
}
}

0 comments on commit aff9901

Please sign in to comment.