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 AppleTV #3174

Merged
merged 18 commits into from
Feb 2, 2023
Merged

Add support for AppleTV #3174

merged 18 commits into from
Feb 2, 2023

Conversation

fealebenpae
Copy link
Member

@fealebenpae fealebenpae commented Jan 12, 2023

Description

Fixes #3161

TODO

  • Changelog entry
  • Tests (if applicable)

return;
case BuildTarget.iOS:
case BuildTarget.tvOS:
UpdateiOSFrameworks(false, false, report.summary.platform);

Check warning

Code scanning / CodeQL

Dereferenced variable may be null

Variable [report](1) may be null at this access as suggested by [this](2) null check.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a false negative - we won't get into this case if report is null.

UpdateiOSFrameworks(
enableForDevice: PlayerSettings.iOS.sdkVersion == iOSSdkVersion.DeviceSDK,
enableForSimulator: PlayerSettings.iOS.sdkVersion == iOSSdkVersion.SimulatorSDK);
UpdateiOSFrameworks(enableForDevice, enableForSimulator, report.summary.platform);

Check warning

Code scanning / CodeQL

Dereferenced variable may be null

Variable [report](1) may be null at this access as suggested by [this](2) null check.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

False negative again - if report is null, we would have returned from the method.

@nirinchev nirinchev changed the title Build tvOS wrappers Add support for AppleTV Feb 1, 2023
@nirinchev nirinchev marked this pull request as ready for review February 1, 2023 13:00
@nirinchev nirinchev assigned nirinchev and unassigned fealebenpae Feb 1, 2023
@nirinchev nirinchev requested a review from LaPeste February 1, 2023 13:00
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is actually important even though it's kind of difficult to review - it indicates that the tvOS wrappers are disabled on all platforms. This is because they're enabled on build by the logic in UnityWeaver.cs. This is pretty similar to what we're doing with the iOS wrappers.

return;
case BuildTarget.iOS:
case BuildTarget.tvOS:
UpdateiOSFrameworks(false, false, report.summary.platform);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a false negative - we won't get into this case if report is null.


UpdateiOSFrameworks(
enableForDevice: false,
enableForSimulator: false);
}

public void OnPreprocessBuild(BuildReport report)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly to iOS, we need to include the correct framework depending on the target we're building.

UpdateiOSFrameworks(
enableForDevice: PlayerSettings.iOS.sdkVersion == iOSSdkVersion.DeviceSDK,
enableForSimulator: PlayerSettings.iOS.sdkVersion == iOSSdkVersion.SimulatorSDK);
UpdateiOSFrameworks(enableForDevice, enableForSimulator, report.summary.platform);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

False negative again - if report is null, we would have returned from the method.

@@ -109,7 +109,7 @@
</None>
</ItemGroup>

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND '$(UseRealmNupkgsWithVersion)' == ''">
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND '$(UseRealmNupkgsWithVersion)' == '' AND '$(RealmTestsStandaloneExe)' == 'true'">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this to prevent msbuild from complaining when we're building the iOS/tvOS tests without having built the macOS wrappers.

@nirinchev nirinchev merged commit c9e0546 into main Feb 2, 2023
@nirinchev nirinchev deleted the yg/tvos branch February 2, 2023 15:01
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request: Support for Apple TV (tvOS) with Unity
2 participants