Skip to content

Commit

Permalink
Merge pull request #67
Browse files Browse the repository at this point in the history
[MAN-442] add support for maccatalyst
  • Loading branch information
ksidirop-laerdal authored Nov 13, 2024
2 parents e5248e3 + c28f81c commit fcf291c
Show file tree
Hide file tree
Showing 17 changed files with 688 additions and 646 deletions.
1 change: 1 addition & 0 deletions Laerdal.Dfu.sln
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Misc", "_Misc", "{37EBD209
.github\workflows\github-actions.yml = .github\workflows\github-actions.yml
.gitignore = .gitignore
global.json = global.json
Laerdal.Scripts\Laerdal.GenerateSignAndUploadSbom.sh = Laerdal.Scripts\Laerdal.GenerateSignAndUploadSbom.sh
EndProjectSection
EndProject
Global
Expand Down
53 changes: 36 additions & 17 deletions Laerdal.Dfu/Laerdal.Dfu.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
<PropertyGroup>
<TargetFrameworks>$(TargetFrameworks)net8.0;</TargetFrameworks>
<TargetFrameworks>$(TargetFrameworks)net8.0-ios;</TargetFrameworks>
<TargetFrameworks>$(TargetFrameworks)net8.0-android</TargetFrameworks>
<TargetFrameworks>$(TargetFrameworks)net8.0-android;</TargetFrameworks>
<TargetFrameworks>$(TargetFrameworks)net8.0-maccatalyst</TargetFrameworks>
</PropertyGroup>

<!-- =================== TARGET FRAMEWORK DETECTION ===================== -->
Expand All @@ -33,27 +34,39 @@
<!-- ==================== TARGET PLATFORM VERSION ======================= -->
<PropertyGroup>
<!-- android the TargetPlatformVersion must be aligned with the maxsdkversion used in androidmanifest.xml -->
<TargetPlatformVersion Condition=" '$(IsForAndroid)' == 'true' ">34</TargetPlatformVersion>
<TargetPlatformMinVersion Condition=" '$(IsForAndroid)' == 'true' ">21.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition=" '$(IsForAndroid)' == 'true' ">21.0</SupportedOSPlatformVersion>
<TargetPlatformVersion Condition=" '$(IsForAndroid)' == 'true' ">34</TargetPlatformVersion>
<TargetPlatformMinVersion Condition=" '$(IsForAndroid)' == 'true' ">21.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition=" '$(IsForAndroid)' == 'true' ">21.0</SupportedOSPlatformVersion>

<!-- ios you will need specific workloads though dotnet workload install maui -/-version 8.0.402 -->
<TargetPlatformVersion Condition=" '$(IsForIOS)' == 'true' ">17.0</TargetPlatformVersion>
<TargetPlatformMinVersion Condition=" '$(IsForIOS)' == 'true' ">14.2</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition=" '$(IsForIOS)' == 'true' ">14.2</SupportedOSPlatformVersion>
<TargetPlatformVersion Condition=" '$(IsForIOS)' == 'true' ">17.0</TargetPlatformVersion>
<TargetPlatformMinVersion Condition=" '$(IsForIOS)' == 'true' ">14.2</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition=" '$(IsForIOS)' == 'true' ">14.2</SupportedOSPlatformVersion>

<!-- maccatalyst you will need specific workloads though dotnet workload install maui -/-version 8.0.402 -->
<TargetPlatformVersion Condition=" '$(IsForMacCatalyst)' == 'true' ">17.0</TargetPlatformVersion>
<TargetPlatformMinVersion Condition=" '$(IsForMacCatalyst)' == 'true' ">13.1</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition=" '$(IsForMacCatalyst)' == 'true' ">13.1</SupportedOSPlatformVersion>
</PropertyGroup>

<!-- ==================== NON-NETSTANDARD ==================== -->
<ItemGroup Condition=" '$(IsForPlainNetX)' != 'true' ">
<Compile Remove="Platforms.NetX\**" />
<!-- Android -->
<ItemGroup Condition=" '$(IsForAndroid)' == 'true' ">
<Compile Remove="Platforms.NetX\**"/>
<Compile Remove="Platforms.iOSandMacCatalyst\**"/>
</ItemGroup>

<!-- ===================== NETSTANDARD ======================= -->
<!-- iOS/MacCatalyst -->
<ItemGroup Condition=" '$(IsForAppleStuff)' == 'true' ">
<Compile Remove="Platforms.NetX\**"/>
<Compile Remove="Platforms.Droid\**"/>
</ItemGroup>

<!-- NetStandard -->
<ItemGroup Condition=" '$(IsForPlainNetX)' == 'true' ">
<Compile Remove="Platforms\**\**" />
<!-- <Compile Include="Platforms.NetX\**" /> no need to include this explicitly -->
<Compile Remove="Platforms.Droid\**"/>
<Compile Remove="Platforms.iOSandMacCatalyst\**"/>
</ItemGroup>

<PropertyGroup>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
Expand Down Expand Up @@ -81,12 +94,18 @@

<Import Project="Laerdal.targets"/>

<!-- =========================== PACKAGES ============================ -->
<!-- =========================== PACKAGES ============================ -->
<!-- Android -->
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
<PackageReference Include="Laerdal.Dfu.Bindings.Android" Version="2.7.0.43895" />
<PackageReference Include="Laerdal.Dfu.Bindings.Android" Version="2.7.0.43895"/>
</ItemGroup>
<!-- iOS -->
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-ios'">
<PackageReference Include="Laerdal.Dfu.Bindings.iOS" Version="4.15.3.43950" />
<PackageReference Include="Laerdal.Dfu.Bindings.iOS" Version="4.15.3.43972" />
</ItemGroup>
<!-- MacCatalyst -->
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-maccatalyst'">
<PackageReference Include="Laerdal.Dfu.Bindings.iOS" Version="4.15.3.43972" />
</ItemGroup>
<!-- =========================== PACKAGES ============================ -->

Expand Down
5 changes: 5 additions & 0 deletions Laerdal.Dfu/Laerdal.Dfu.csproj.DotSettings
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=android/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=ios/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=platforms/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=platforms_002Eandroid/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=platforms_002Eios/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=platforms_002Eiosandmaccatalyst/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=platforms_002Enetx/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=platforms_005Candroid/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=platforms_005Cios/@EntryIndexedValue">True</s:Boolean>
Expand Down
27 changes: 17 additions & 10 deletions Laerdal.Dfu/Laerdal.targets
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,23 @@

<!-- ==================== LOGGING ==================== -->
<Target Name="PrintBuildInfo" BeforeTargets="BeforeBuild">
<Message Importance="High" Text="*** Package Info ***" />
<Message Importance="High" Text="PackageId: $(PackageId)" />
<Message Importance="High" Text="Configuration: $(Configuration)" />
<Message Importance="High" Text="TargetFramework: $(TargetFramework)" />
<Message Importance="High" Text="DefineConstants: $(DefineConstants)" />
<Message Importance="High" Text="Platform: $(Platform)" />
<Message Importance="High" Text="PackageVersion: $(PackageVersion)" />
<Message Importance="High" Text="AssemblyVersion: $(AssemblyVersion)" />
<Message Importance="High" Text="AssemblyFileVersion: $(AssemblyFileVersion)"/>
<Message Importance="High" Text="Version: $(Version)" />
<Message Importance="High" Text="*** Package Info ***"/>
<Message Importance="High" Text="Version : $(Version) "/>
<Message Importance="High" Text="Platform : $(Platform) "/>
<Message Importance="High" Text="PackageId : $(PackageId) "/>
<Message Importance="High" Text="Configuration : $(Configuration) "/>
<Message Importance="High" Text="PackageVersion : $(PackageVersion) "/>
<Message Importance="High" Text="TargetFramework : $(TargetFramework) "/>
<Message Importance="High" Text="DefineConstants : $(DefineConstants) "/>
<Message Importance="High" Text="AssemblyVersion : $(AssemblyVersion) "/>
<Message Importance="High" Text="AssemblyFileVersion : $(AssemblyFileVersion) "/>
<Message Importance="High" Text=" "/>
<Message Importance="high" Text="IsForIOS : $(IsForIOS) "/>
<Message Importance="high" Text="IsForAndroid : $(IsForAndroid) "/>
<Message Importance="high" Text="IsForWindows : $(IsForWindows) "/>
<Message Importance="high" Text="IsForPlainNetX : $(IsForPlainNetX) "/>
<Message Importance="high" Text="IsForAppleStuff : $(IsForAppleStuff) "/>
<Message Importance="high" Text="IsForMacCatalyst : $(IsForMacCatalyst) "/>
</Target>

<!-- ==================== MAUI for .NET8 changes ==================== -->
Expand Down
Loading

0 comments on commit fcf291c

Please sign in to comment.