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

Build Windows and Tizen targets for Sentry.Maui #2005

Merged
merged 5 commits into from
Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/actions/environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ runs:
run: >
dotnet workload install \
maui-android \
${{ runner.os == 'macOS' && 'maui-ios maui-maccatalyst' || '' }} \
${{ runner.os == 'macOS' && 'maui-ios maui-maccatalyst maui-windows maui-tizen' || '' }} \
${{ runner.os == 'Windows' && 'maui-windows' || '' }} \
--temp-dir "${{ runner.temp }}"

# We build Sentry.Maui for every supported MAUI target so we can access platform-specific features.
# That includes Tizen. We don't need the entire Tizen SDK, but we do need the base Tizen workload.
# Though we could install it on all runners, we really only need it when building and packing for NuGet, which we do on macOS only.
- name: Install Tizen Workload
if: runner.os == 'macOS'
shell: bash
run: "curl -sSL https://raw.githubusercontent.com/Samsung/Tizen.NET/main/workload/scripts/workload-install.sh | sudo bash"
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Allow custom processors to be added as a scoped dependency ([#1979](https://github.com/getsentry/sentry-dotnet/pull/1979))
- Support DI for custom transaction processors ([#1993](https://github.com/getsentry/sentry-dotnet/pull/1993))
- Mark Transaction as aborted when unhandled exception occurs ([#1996](https://github.com/getsentry/sentry-dotnet/pull/1996))
- Build Windows and Tizen targets for `Sentry.Maui` ([#2005](https://github.com/getsentry/sentry-dotnet/pull/2005))

### Fixes

Expand Down
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'ios'">10.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'tizen'">6.5</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="'$(TargetPlatformIdentifier)' == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
</PropertyGroup>
Expand Down
6 changes: 6 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'ios'">10.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'tizen'">6.5</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="'$(TargetPlatformIdentifier)' == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
</PropertyGroup>
Expand All @@ -28,6 +29,11 @@
<Compile Remove="**\Windows\**\*.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetPlatformIdentifier)' != 'tizen'">
<Compile Remove="**\*.Tizen.cs" />
<Compile Remove="**\Tizen\**\*.cs" />
</ItemGroup>

<!-- Workaround the fact that http doesnt exist in earlier frameworks -->
<ItemGroup>
<Using Remove="System.Net.Http" />
Expand Down
14 changes: 12 additions & 2 deletions src/Sentry.Maui/Sentry.Maui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,21 @@
<PropertyGroup>
<Description>Official MAUI integration for Sentry - Open-source error tracking that helps developers monitor and fix crashes in real time.</Description>
<!--
Build for net6.0 to cover all managed platforms,
but also target platforms where we intend to bundle native SDKs.
Target net6.0 so we can run unit tests on platform-neutral code.
Target other platforms so we can include platform-specific code, and bundle native SDKs.
-->
<TargetFrameworks>net6.0;net6.0-android</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('OSX'))">$(TargetFrameworks);net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('Windows')) Or $([MSBuild]::IsOSPlatform('OSX'))">$(TargetFrameworks);net6.0-windows10.0.19041.0</TargetFrameworks>

<!-- Target Tizen only if the Tizen SDK workload pack is installed. -->
<TargetFrameworks Condition="Exists('$(MSBuildBinPath)\..\..\packs\Samsung.Tizen.Sdk')">$(TargetFrameworks);net6.0-tizen</TargetFrameworks>

<!--
This flag allows us to target Windows-specific code when building on OSX, so we can build and pack all platforms on a single machine.
See https://learn.microsoft.com/dotnet/core/tools/sdk-errors/netsdk1100
-->
<EnableWindowsTargeting Condition="$([MSBuild]::IsOSPlatform('OSX'))">true</EnableWindowsTargeting>

<!-- We'll need to package this only on OSX, so we get the iOS native support. -->
<IsPackable Condition="!$([MSBuild]::IsOSPlatform('OSX'))">false</IsPackable>
Expand Down