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 tvOS build #21

Merged
merged 14 commits into from
Mar 24, 2025
Merged

Add support for tvOS build #21

merged 14 commits into from
Mar 24, 2025

Conversation

devahmedshendy
Copy link
Contributor

No description provided.

@devahmedshendy devahmedshendy requested a review from leogdion March 22, 2025 09:31
Copy link

codecov bot commented Mar 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (fccc318) to head (963bf1b).
Report is 1 commits behind head on v1.0.0.

Additional details and impacted files
@@          Coverage Diff           @@
##           v1.0.0     #21   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files          24      24           
  Lines         393     393           
======================================
  Misses        393     393           
Flag Coverage Δ
ios18.1 0.00% <ø> (ø)
ios18.2 0.00% <ø> (ø)
spm 0.00% <ø> (ø)
swift- 0.00% <ø> (ø)
tvos18.2 0.00% <ø> (?)
ubuntu 0.00% <ø> (ø)
visionos2.1 0.00% <ø> (ø)
watchos11.1 0.00% <ø> (ø)
watchos11.2 0.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@devahmedshendy
Copy link
Contributor Author

devahmedshendy commented Mar 22, 2025

Update:
I add this condition !os(tvOS) to solve this issue.

Original:
@leogdion
I see now what do you mean by "Fix" in the issue title. Adding support for tvOS build doesn't work:

 /Users/runner/work/RadiantKit/RadiantKit/Sources/RadiantKit/Views/SliderStepperView.swift:57:11: error: 'Slider' is unavailable in tvOS
          Slider(value: $value, in: safeBounds, step: step).blur(radius: blurRadius)
          ^~~~~~
SwiftUI.Slider:3:15: note: 'Slider' has been explicitly marked unavailable here
public struct Slider<Label, ValueLabel> : View where Label : View, ValueLabel : View {
              ^
/Users/runner/work/RadiantKit/RadiantKit/Sources/RadiantKit/Views/SliderStepperView.swift:57:11: error: 'init(value:in:step:onEditingChanged:)' is unavailable in tvOS
          Slider(value: $value, in: safeBounds, step: step).blur(radius: blurRadius)
          ^~~~~~
SwiftUI.Slider:5:24: note: 'init(value:in:step:onEditingChanged:)' has been explicitly marked unavailable here
    nonisolated public init<V>(value: Binding<V>, in bounds: ClosedRange<V>, step: V.Stride = 1, onEditingChanged: @escaping (Bool) -> Void = { _ in }) where V : BinaryFloatingPoint, V.Stride : BinaryFloatingPoint
                       ^
/Users/runner/work/RadiantKit/RadiantKit/Sources/RadiantKit/Views/SliderStepperView.swift:60:11: error: 'Stepper' is unavailable in tvOS
          Stepper(value: $value, in: safeBounds, step: 1.0, label: { self.label(self.title) })
          ^~~~~~~
SwiftUI.Stepper:3:15: note: 'Stepper' has been explicitly marked unavailable here
public struct Stepper<Label> : View where Label : View {
              ^
/Users/runner/work/RadiantKit/RadiantKit/Sources/RadiantKit/Views/SliderStepperView.swift:60:11: error: 'init(value:in:step:onEditingChanged:label:)' is unavailable in tvOS
          Stepper(value: $value, in: safeBounds, step: 1.0, label: { self.label(self.title) })
          ^~~~~~~
SwiftUI.Stepper:18:24: note: 'init(value:in:step:onEditingChanged:label:)' has been explicitly marked unavailable here
    nonisolated public init<V>(value: Binding<V>, in bounds: ClosedRange<V>, step: V.Stride = 1, onEditingChanged: @escaping (Bool) -> Void = { _ in }, @ViewBuilder label: () -> Label) where V : Strideable

What do you suggest then with such issue when the SwiftUI component is not available in tvOS?

@devahmedshendy
Copy link
Contributor Author

devahmedshendy commented Mar 22, 2025

@leogdion
For these lines in ci configurations, why don't we have a matrix entries for sdk and destination?

-sdk ${{ matrix.type == 'ios' && 'iphonesimulator' || matrix.type == 'watchos' && 'watchsimulator' || matrix.type == 'tvis' && 'tvsimulator' || 'xrsimulator' }}
-destination 'platform=${{ matrix.type == 'ios' && 'iOS Simulator' || matrix.type == 'watchos' && 'watchOS Simulator' || matrix.type == 'tvos' && 'tvOS Simulator' || 'visionOS Simulator' }},name=${{ matrix.deviceName }},OS=${{ matrix.osVersion }}'
          

Or maybe we should make use of brightdigit/swift-build action, right? like we did in Bushel:

- uses: actions/checkout@v4
- name: Build and Test
  uses: brightdigit/swift-build@v1
  with:
    scheme: BushelApp-Package
    type: ${{ matrix.type }}
    xcode: ${{ matrix.xcode }}
    deviceName: ${{ matrix.deviceName }}
    osVersion: ${{ matrix.osVersion }}
    working-directory: ./Packages/BushelApp

@devahmedshendy devahmedshendy mentioned this pull request Mar 22, 2025
@leogdion
Copy link
Member

@leogdion For these lines in ci configurations, why don't we have a matrix entries for sdk and destination?

-sdk ${{ matrix.type == 'ios' && 'iphonesimulator' || matrix.type == 'watchos' && 'watchsimulator' || matrix.type == 'tvis' && 'tvsimulator' || 'xrsimulator' }}
-destination 'platform=${{ matrix.type == 'ios' && 'iOS Simulator' || matrix.type == 'watchos' && 'watchOS Simulator' || matrix.type == 'tvos' && 'tvOS Simulator' || 'visionOS Simulator' }},name=${{ matrix.deviceName }},OS=${{ matrix.osVersion }}'
          

Or maybe we should make use of brightdigit/swift-build action, right? like we did in Bushel:

- uses: actions/checkout@v4
- name: Build and Test
  uses: brightdigit/swift-build@v1
  with:
    scheme: BushelApp-Package
    type: ${{ matrix.type }}
    xcode: ${{ matrix.xcode }}
    deviceName: ${{ matrix.deviceName }}
    osVersion: ${{ matrix.osVersion }}
    working-directory: ./Packages/BushelApp

😆 I was about to say the same thing about swift-build. Let's do that first. I'll create a new issue for it.

@leogdion leogdion mentioned this pull request Mar 22, 2025
@devahmedshendy
Copy link
Contributor Author

devahmedshendy commented Mar 22, 2025

@leogdion need your help here, what is wrong here?

Run sersoft-gmbh/swift-coverage-action@v4
Validating input
Setting up paths
Finding coverage files
Error: No coverage files found (or none succeeded to convert)!

@leogdion
Copy link
Member

@leogdion need your help here, what is wrong here?

Run sersoft-gmbh/swift-coverage-action@v4
Validating input
Setting up paths
Finding coverage files
Error: No coverage files found (or none succeeded to convert)!

I just ran into this. Try this

@devahmedshendy devahmedshendy marked this pull request as ready for review March 23, 2025 02:50
This was linked to issues Mar 24, 2025
@leogdion leogdion merged commit 4e8d026 into v1.0.0 Mar 24, 2025
13 checks passed
@leogdion leogdion deleted the v1.0.0-fix_tvOS_build branch March 24, 2025 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate to Swift-Build Fix tvOS Build
2 participants