Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 11, 2025

  • Analyze tvOS support requirements for volume capacity properties
  • Update conditional compilation directives from #if os(iOS) to #if os(iOS) || os(tvOS) for basic volume properties
  • Keep advanced volume properties iOS-only (volumeAvailableCapacityForImportantUsage, volumeAvailableCapacityForOpportunisticUsage, volumes)
  • Update tests to match platform availability
  • Regenerate Device.generated.swift without sourceLocation debug lines
  • Fix tvOS build failures by restricting unavailable APIs to iOS

Changes made:

  • Split volume capacity implementation into two sections:
    • Basic properties (volumeTotalCapacity, volumeAvailableCapacity): Available on iOS and tvOS
    • Advanced properties (volumeAvailableCapacityForImportantUsage, volumeAvailableCapacityForOpportunisticUsage, volumes): iOS-only
  • Updated tests to reflect platform-specific availability
  • Advanced volume APIs use iOS-only resource keys that are not available on tvOS

Technical details:

  • volumeAvailableCapacityForImportantUsageKey and volumeAvailableCapacityForOpportunisticUsageKey are unavailable in tvOS
  • URLResourceValues does not expose the corresponding properties on tvOS
  • Basic volume capacity APIs work on both platforms as they use standard resource keys

Fixes #449.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: Zandor300 <6069593+Zandor300@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Volume capacity values properties not generated for tvOS Add tvOS support for volume capacity properties Sep 11, 2025
@Copilot Copilot AI requested a review from Zandor300 September 11, 2025 22:29
Copilot finished work on behalf of Zandor300 September 11, 2025 22:29
@Zandor300
Copy link
Member

@copilot Run gyb with flag " --line-directive '' to get rid of the "sourceLocation" lines in the generated swift file. Update your own instructions to include that by default.

…e-directive flag

Co-authored-by: Zandor300 <6069593+Zandor300@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Sep 11, 2025

@copilot Run gyb with flag " --line-directive '' to get rid of the "sourceLocation" lines in the generated swift file. Update your own instructions to include that by default.

Updated the generated Swift file to remove sourceLocation lines using python3 Utils/gyb.py --line-directive '' Source/Device.swift.gyb > Source/Device.generated.swift. This removes all the // ###sourceLocation debugging lines for cleaner generated code. (f822d31)

Copilot finished work on behalf of Zandor300 September 11, 2025 22:34
Copy link

github-actions bot commented Sep 11, 2025

15 Warnings
⚠️ Plist changed, don't forget to localize your plist values
⚠️ Source/Device.generated.swift#L742 - TODOs should be resolved (Replace with proper implementa…).
todo Device.generated.swift:742
⚠️ Source/Device.generated.swift#L1319 - TODOs should be resolved (Replace with proper implementa…).
todo Device.generated.swift:1319
⚠️ Source/Device.generated.swift#L1583 - TODOs should be resolved (Replace with proper implementa…).
todo Device.generated.swift:1583
⚠️ Source/Device.generated.swift#L1761 - TODOs should be resolved (Replace with proper implementa…).
todo Device.generated.swift:1761
⚠️ Source/Device.generated.swift#L1919 - TODOs should be resolved (Replace with proper implementa…).
todo Device.generated.swift:1919
⚠️ Source/Device.generated.swift#L2623 - TODOs should be resolved (Replace with proper implementa…).
todo Device.generated.swift:2623
⚠️ Source/Device.generated.swift#L2684 - TODOs should be resolved (Replace with proper implementa…).
todo Device.generated.swift:2684
⚠️ Tests/Tests.swift#L463 - Collection literals should not have trailing commas.
trailing_comma Tests.swift:463
⚠️ Tests/Tests.swift#L496 - Collection literals should not have trailing commas.
trailing_comma Tests.swift:496
⚠️ Tests/Tests.swift#L531 - Collection literals should not have trailing commas.
trailing_comma Tests.swift:531
⚠️ Tests/Tests.swift#L538 - Function body should span 40 lines or less excluding comments and whitespace: currently spans 44 lines
function_body_length Tests.swift:538
⚠️ Tests/Tests.swift#L580 - Collection literals should not have trailing commas.
trailing_comma Tests.swift:580
⚠️ Tests/Tests.swift#L670 - Collection literals should not have trailing commas.
trailing_comma Tests.swift:670
⚠️ Tests/Tests.swift#L711 - Collection literals should not have trailing commas.
trailing_comma Tests.swift:711

SwiftLint found issues

Warnings

File Line Reason
Tests.swift 538 Function body should span 40 lines or less excluding comments and whitespace: currently spans 44 lines (function_body_length)
Tests.swift 463 Collection literals should not have trailing commas. (trailing_comma)
Tests.swift 496 Collection literals should not have trailing commas. (trailing_comma)
Tests.swift 531 Collection literals should not have trailing commas. (trailing_comma)
Tests.swift 580 Collection literals should not have trailing commas. (trailing_comma)
Tests.swift 670 Collection literals should not have trailing commas. (trailing_comma)
Tests.swift 711 Collection literals should not have trailing commas. (trailing_comma)
Device.generated.swift 742 TODOs should be resolved (Replace with proper implementa...). (todo)
Device.generated.swift 1319 TODOs should be resolved (Replace with proper implementa...). (todo)
Device.generated.swift 1583 TODOs should be resolved (Replace with proper implementa...). (todo)
Device.generated.swift 1761 TODOs should be resolved (Replace with proper implementa...). (todo)
Device.generated.swift 1919 TODOs should be resolved (Replace with proper implementa...). (todo)
Device.generated.swift 2623 TODOs should be resolved (Replace with proper implementa...). (todo)
Device.generated.swift 2684 TODOs should be resolved (Replace with proper implementa...). (todo)

Generated by 🚫 Danger

@Zandor300
Copy link
Member

@copilot

tvOS build failed:

Test session results, code coverage, and logs:
Value of type 'URLResourceValues' has no member 'volumeAvailableCapacityForImportantUsage'
/Users/runner/Library/Developer/Xcode/DerivedData/DeviceKit-cvoicodebiifnxebfzlbypqvhhkw/Logs/Test/Test-DeviceKit-2025.09.11_22-38-36-+0000.xcresult

Value of type 'URLResourceValues' has no member 'volumeAvailableCapacityForOpportunisticUsage'
'volumeAvailableCapacityForImportantUsageKey' is unavailable in tvOS
'volumeAvailableCapacityForOpportunisticUsageKey' is unavailable in tvOS
Testing cancelled because the build failed.

** TEST FAILED **

…properties for both iOS and tvOS

Co-authored-by: Zandor300 <6069593+Zandor300@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 3, 2025

@copilot

tvOS build failed:
...

Fixed the tvOS build errors. The advanced volume capacity properties (volumeAvailableCapacityForImportantUsage, volumeAvailableCapacityForOpportunisticUsage, and volumes) use resource keys that are unavailable on tvOS, so I've restricted them to iOS-only. Basic volume properties (volumeTotalCapacity and volumeAvailableCapacity) remain available on both iOS and tvOS. (cab5466)

Copilot finished work on behalf of Zandor300 October 3, 2025 14:50
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.

Volume capacity values properties not generated for tvOS
2 participants