Skip to content

Commit

Permalink
Test MAUI + .NET 7.0 + Android API 33 on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghostbird committed Jan 26, 2023
1 parent fa6abe3 commit 26b2435
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,14 @@ Built in views are provided for **UWP**, **Xamarin.Forms**, **Xamarin.iOS** and
## License

MIT © [Aloïs Deniel](https://aloisdeniel.com) & [Ed Lomonaco](https://edlomonaco.dev)

## Building on Linux

This branch is just meant for some quick tests of #325. It only suppoorts the specific use case tested: .NET 7.0 + Android API 33 on GNU/Linux (Debian 11).

```sh
dotnet build Sources/Microcharts
dotnet build Sources/Microcharts.Maui
```

I had to add a Linux specific `TargetFrameworks` line to Microcharts.Maui.csproj because I got an error when overriding the property on the command line.
7 changes: 5 additions & 2 deletions Sources/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<PropertyGroup>
<IsWindows>$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))</IsWindows>
<IsMacOS>$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))</IsMacOS>
<IsLinux>$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))</IsLinux>
</PropertyGroup>


Expand All @@ -11,8 +12,10 @@
Condition=" '$(IsWindows)' == 'true' " />
<Message Text="Operating System: macOS"
Condition=" '$(IsMacOS)' == 'true' " />
<Message Text="Operating System: Linux"
Condition=" '$(IsLinux)' == 'true' " />

<Error Text="There appears to be a problem selecting the operating system. IsWindows='$(IsWindows)', IsMacOS='$(IsMacOS)'"
Condition=" !$(IsWindows) and !$(IsMacOS) " />
<Error Text="There appears to be a problem selecting the operating system. IsWindows='$(IsWindows)', IsMacOS='$(IsMacOS)', IsLinux='$(IsLinux)"
Condition=" !$(IsWindows) and !$(IsMacOS) and !$(IsLinux)" />
</Target>
</Project>
1 change: 1 addition & 0 deletions Sources/Microcharts.Maui/Microcharts.Maui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<!-- iOS, Android, MacCatalyst -->
<TargetFrameworks>net6.0-ios;net6.0-android;net6.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$(IsWindows)">$(TargetFrameworks);net6.0-windows10.0.19041</TargetFrameworks>
<TargetFrameworks Condition="$(IsLinux)">net7.0-android33.0</TargetFrameworks>
<TargetPlatformMinVersion Condition="$(TargetFramework.Contains('-windows'))">10.0.17763.0</TargetPlatformMinVersion>
<PackagingPlatform Condition="$(TargetFramework.Contains('-windows'))">net6.0-windows</PackagingPlatform>
<UseMaui>true</UseMaui>
Expand Down

0 comments on commit 26b2435

Please sign in to comment.