Skip to content

Commit

Permalink
feat (Laerdal.McuMgr.csproj): switch gears net7->net8
Browse files Browse the repository at this point in the history
  • Loading branch information
ksidirop-laerdal committed Feb 14, 2024
1 parent a1e6aac commit 6816eda
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 76 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
<IsWindows Condition=" '$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true' ">true</IsWindows>
<IsUnix Condition=" '$(IsOSX)' == 'true' OR '$(IsLinux)' == 'true' ">true</IsUnix>

<TargetFramework>net7.0-android</TargetFramework>
<TargetFramework>net8.0-android</TargetFramework>

<IsNet7 Condition=" '$(TargetFramework.ToLower().StartsWith(net7))' == 'true' ">true</IsNet7>
<IsNetX Condition=" '$(IsNet7)' == 'true' ">true</IsNetX>
<IsNet8 Condition=" '$(TargetFramework.ToLower().StartsWith(net8))' == 'true' ">true</IsNet8>
<IsNetX Condition=" '$(IsNet8)' == 'true' ">true</IsNetX>

<!-- keep this sort of parameterization around because it will be very difficult to reintroduce it if we add more target-frameworks in the future -->
<ShouldBuildNativeLibraries Condition=" '$(IsNet7)' == 'true' ">true</ShouldBuildNativeLibraries>
<ShouldBuildNativeLibraries Condition=" '$(IsNet8)' == 'true' ">true</ShouldBuildNativeLibraries>

<DebugType>pdbonly</DebugType>
<DefineConstants>$(DefineConstants);TRACE</DefineConstants>
<IsBindingProject>true</IsBindingProject>

<NoWarn>$(NoWarn);CS0108;CS0114;BG8700;NETSDK1202;</NoWarn>
<NoWarn>$(NoWarn);CS0108;CS0114;BG8700;BG8605;BG8606;NETSDK1202;</NoWarn>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -37,7 +37,7 @@

<PropertyGroup>
<PackageId>Laerdal.McuMgr.Bindings.Android</PackageId>
<PackageTags>Laerdal;Nordic;McuMgr;Bindings;Android;Net7;</PackageTags>
<PackageTags>Laerdal;Nordic;McuMgr;Bindings;Android;Net8;</PackageTags>
<PackageProjectUrl>https://github.com/Laerdal/Laerdal.McuMgr</PackageProjectUrl>
<PackageReadmeFile Condition=" '$(IsNetX)' == 'true' ">README.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
Expand All @@ -50,15 +50,15 @@
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>

<!-- these versions are getting replaced by the build script in one swift pass -->
<Version>1.0.1008.0</Version>
<FileVersion>1.0.1008.0</FileVersion>
<PackageVersion>1.0.1008.0</PackageVersion>
<AssemblyVersion>1.0.1008.0</AssemblyVersion>
<Version>1.0.1009.0</Version>
<FileVersion>1.0.1009.0</FileVersion>
<PackageVersion>1.0.1009.0</PackageVersion>
<AssemblyVersion>1.0.1009.0</AssemblyVersion>

<Title>$(PackageId)</Title>
<Owners>$(Authors)</Owners>
<Authors>Kyriakos Sidiropoulos, François Raminosona, Laerdal</Authors>
<Summary>.Net7+ McuMgr Bindings for Android</Summary>
<Summary>.Net8+ McuMgr Bindings for Android</Summary>
<Copyright>$(Authors)</Copyright>
<Description>$(PackageDescription)</Description>

Expand Down Expand Up @@ -93,15 +93,15 @@
<Message Importance="High" Text="DefineConstants: '$(DefineConstants)' "/>
<Message Importance="high" Text="MSBuildNodeCount: '$(MSBuildNodeCount)' "/>

<Message Importance="high" Text="IsNet7: '$(IsNet7)' "/>
<Message Importance="high" Text="IsNet8: '$(IsNet8)' "/>
<Message Importance="high" Text="IsNetX: '$(IsNetX)' "/>

<Message Importance="high" Text="ShouldBuildNativeLibraries: '$(ShouldBuildNativeLibraries)' "/>
</Target>

<!-- considering the highly customized nature of the build system we need to ensure that parallelization is turned off otherwise we will end up with -->
<!-- cryptic errors in azure due to target-frameworks trying to build themselves in parallel thus stepping onto eachothers toes thats because the -->
<!-- intended way of building stuff is to let net7.0-android build the android libs and once that is done then and only then proceed to any additional -->
<!-- intended way of building stuff is to let net8.0-android build the android libs and once that is done then and only then proceed to any additional -->
<!-- target-frameworks which will find the .aar and .jars already in place -->
<Target Name="EnsureThatParallelizedBuildingIsDisabled"
BeforeTargets="PrepareForBuild">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@
<IsWindows>$( [System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)) )</IsWindows>
<IsUnix Condition=" '$(IsOSX)' == 'true' OR '$(IsLinux)' == 'true' ">true</IsUnix>

<!-- if we are building under osx then we issue a proper full blown build notice that net7.0-maccatalyst must always be first for the -->
<!-- if we are building under osx then we issue a proper full blown build notice that net8.0-maccatalyst must always be first for the -->
<!-- native swift-libs to be build properly so that they will be readymade when/if we add additional builds right afterwards in the future -->
<TargetFrameworks Condition=" '$(IsOSX)' == 'true' ">$(TargetFrameworks)net7.0-maccatalyst;</TargetFrameworks>
<TargetFrameworks Condition=" '$(IsOSX)' == 'true' ">$(TargetFrameworks)net8.0-maccatalyst;</TargetFrameworks>

<!-- if we are building under a non-osx platform then we issue a dummy build which spawns a dud nuget -->
<!-- then the mcumgr projects skips its own ios build completely so that is sorted out as well -->
<TargetFrameworks Condition=" '$(IsOSX)' == 'False' ">netstandard2.1;</TargetFrameworks>

<IsMacCatalyst Condition=" $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst' ">true</IsMacCatalyst>

<IsNet7 Condition=" '$(TargetFramework.ToLower().StartsWith(net7))' == 'true' ">true</IsNet7>
<IsNetX Condition=" '$(IsNet7)' == 'true' ">true</IsNetX>
<IsNet8 Condition=" '$(TargetFramework.ToLower().StartsWith(net8))' == 'true' ">true</IsNet8>
<IsNetX Condition=" '$(IsNet8)' == 'true' ">true</IsNetX>

<ShouldBuildNativeLibraries Condition=" '$(IsNet7)' == 'true' ">true</ShouldBuildNativeLibraries>
<ShouldBuildNativeLibraries Condition=" '$(IsNet8)' == 'true' ">true</ShouldBuildNativeLibraries>

<TargetPlatformVersion>13.1</TargetPlatformVersion>

Expand Down Expand Up @@ -60,10 +60,10 @@
<AllowedReferenceRelatedFileExtensions>$(AllowedReferenceRelatedFileExtensions);.pdb</AllowedReferenceRelatedFileExtensions>

<!-- these versions are getting replaced by the build script in one swift pass -->
<Version>1.0.1008.0</Version>
<FileVersion>1.0.1008.0</FileVersion>
<PackageVersion>1.0.1008.0</PackageVersion>
<AssemblyVersion>1.0.1008.0</AssemblyVersion>
<Version>1.0.1009.0</Version>
<FileVersion>1.0.1009.0</FileVersion>
<PackageVersion>1.0.1009.0</PackageVersion>
<AssemblyVersion>1.0.1009.0</AssemblyVersion>

<Title>$(PackageId)</Title>
<Summary>McuMgr Bindings for MacCatalyst - MAUI ready</Summary>
Expand Down Expand Up @@ -124,7 +124,7 @@
<Message Importance="High" Text="DefineConstants: '$(DefineConstants)' "/>
<Message Importance="high" Text="MSBuildNodeCount: '$(MSBuildNodeCount)' "/>

<Message Importance="high" Text="IsNet7: '$(IsNet7)' "/>
<Message Importance="high" Text="IsNet8: '$(IsNet8)' "/>
<Message Importance="high" Text="IsNetX: '$(IsNetX)' "/>
<Message Importance="high" Text="IsMacCatalyst: '$(IsMacCatalyst)' "/>
<Message Importance="high" Text="TargetPlatformVersion: '$(TargetPlatformVersion)' "/>
Expand All @@ -135,7 +135,7 @@

<!-- considering the highly customized nature of the build system we need to ensure that parallelization is turned off otherwise we will end up with -->
<!-- cryptic errors in azure due to target-frameworks trying to build themselves in parallel thus stepping onto eachothers toes thats because the -->
<!-- intended way of building stuff is to let net7.0-maccatalyst build the maccatalyst libs and once that is done then and only then proceed to -->
<!-- intended way of building stuff is to let net8.0-maccatalyst build the maccatalyst libs and once that is done then and only then proceed to -->
<!-- compiling any additional target-framework which will find the compiled framework-libs already in place -->
<Target Name="EnsureThatParallelizedBuildingIsDisabled"
BeforeTargets="CompileProxyProjectAndGenerateFatLibs">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
<AllowedReferenceRelatedFileExtensions>$(AllowedReferenceRelatedFileExtensions);.pdb</AllowedReferenceRelatedFileExtensions>

<!-- these versions are getting replaced by the build script in one swift pass -->
<Version>1.0.1008.0</Version>
<FileVersion>1.0.1008.0</FileVersion>
<PackageVersion>1.0.1008.0</PackageVersion>
<AssemblyVersion>1.0.1008.0</AssemblyVersion>
<Version>1.0.1009.0</Version>
<FileVersion>1.0.1009.0</FileVersion>
<PackageVersion>1.0.1009.0</PackageVersion>
<AssemblyVersion>1.0.1009.0</AssemblyVersion>

<Title>$(PackageId)</Title>
<Summary>McuMgr C# Implementation (WIP)</Summary>
Expand Down
20 changes: 10 additions & 10 deletions Laerdal.McuMgr.Bindings.iOS/Laerdal.McuMgr.Bindings.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@

<!-- if we are building under a non-osx platform then we issue a dummy build which spawns a dud nuget -->
<!-- then the mcumgr projects skips its own ios build completely so that is sorted out as well -->
<TargetFrameworks Condition=" '$(IsOSX)' == 'true' ">$(TargetFrameworks)net7.0-ios;</TargetFrameworks>
<TargetFrameworks Condition=" '$(IsOSX)' == 'true' ">$(TargetFrameworks)net8.0-ios;</TargetFrameworks>
<TargetFrameworks Condition=" '$(IsOSX)' == 'false' ">$(TargetFrameworks)netstandard2.1;</TargetFrameworks>

<IsIOS Condition=" $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' ">true</IsIOS>

<IsNet7 Condition=" '$(TargetFramework.ToLower().StartsWith(net7))' == 'true' ">true</IsNet7>
<IsNetX Condition=" '$(IsNet7)' == 'true' ">true</IsNetX>
<IsNet8 Condition=" '$(TargetFramework.ToLower().StartsWith(net8))' == 'true' ">true</IsNet8>
<IsNetX Condition=" '$(IsNet8)' == 'true' ">true</IsNetX>
<IsNetXIos Condition=" '$(IsNetX)' == 'true' and '$(IsIOS)' == 'true' ">true</IsNetXIos>

<ShouldBuildNativeLibraries Condition=" '$(IsNet7)' == 'true' ">true</ShouldBuildNativeLibraries>
<ShouldBuildNativeLibraries Condition=" '$(IsNet8)' == 'true' ">true</ShouldBuildNativeLibraries>

<TargetPlatformVersion Condition=" '$(IsNetXIos)' == 'true' ">11.0</TargetPlatformVersion>

Expand Down Expand Up @@ -58,10 +58,10 @@
<AllowedReferenceRelatedFileExtensions>$(AllowedReferenceRelatedFileExtensions);.pdb</AllowedReferenceRelatedFileExtensions>

<!-- these versions are getting replaced by the build script in one swift pass -->
<Version>1.0.1008.0</Version>
<FileVersion>1.0.1008.0</FileVersion>
<PackageVersion>1.0.1008.0</PackageVersion>
<AssemblyVersion>1.0.1008.0</AssemblyVersion>
<Version>1.0.1009.0</Version>
<FileVersion>1.0.1009.0</FileVersion>
<PackageVersion>1.0.1009.0</PackageVersion>
<AssemblyVersion>1.0.1009.0</AssemblyVersion>

<Title>$(PackageId)</Title>
<Summary>McuMgr Bindings for iOS - MAUI ready</Summary>
Expand Down Expand Up @@ -132,7 +132,7 @@
<Message Importance="high" Text="MSBuildNodeCount: '$(MSBuildNodeCount)' "/>

<Message Importance="high" Text="IsIOS: '$(IsIOS)' "/>
<Message Importance="high" Text="IsNet7: '$(IsNet7)' "/>
<Message Importance="high" Text="IsNet8: '$(IsNet8)' "/>
<Message Importance="high" Text="IsNetX: '$(IsNetX)' "/>
<Message Importance="high" Text="IsNetXIos: '$(IsNetXIos)' "/>
<Message Importance="high" Text="TargetPlatformVersion: '$(TargetPlatformVersion)' "/>
Expand All @@ -143,7 +143,7 @@

<!-- considering the highly customized nature of the build system we need to ensure that parallelization is turned off otherwise we will end up with -->
<!-- cryptic errors in azure due to target-frameworks trying to build themselves in parallel thus stepping onto eachothers toes thats because the -->
<!-- intended way of building stuff is to let net7.0-ios build the ios libs and once that is done then and only then proceed to any additional target -->
<!-- intended way of building stuff is to let net8.0-ios build the ios libs and once that is done then and only then proceed to any additional target -->
<!-- frameworks which will find the compiled framework-libs already in place -->
<Target Name="EnsureThatParallelizedBuildingIsDisabled"
BeforeTargets="CompileProxyProjectAndGenerateFatLibs">
Expand Down
2 changes: 1 addition & 1 deletion Laerdal.McuMgr.Tests/Laerdal.McuMgr.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>

Expand Down
42 changes: 21 additions & 21 deletions Laerdal.McuMgr/Laerdal.McuMgr.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@
<!-- - note that we build against netstandard2.1 merely as a dud-placeholder for windows in which we are bound to get not-implemented exceptions all over the place -->
<!-- - also note it only makes sense to build ios stuff under osx because xcodebuild is only available there -->
<TargetFrameworks>$(TargetFrameworks)netstandard2.1;</TargetFrameworks>
<TargetFrameworks>$(TargetFrameworks)net7.0-android;</TargetFrameworks>
<TargetFrameworks Condition=" '$(IsOSX)' == 'true' ">$(TargetFrameworks)net7.0-ios11;</TargetFrameworks>
<TargetFrameworks Condition=" '$(IsOSX)' == 'true' ">$(TargetFrameworks)net7.0-maccatalyst;</TargetFrameworks>
<TargetFrameworks>$(TargetFrameworks)net8.0-android;</TargetFrameworks>
<TargetFrameworks Condition=" '$(IsOSX)' == 'true' ">$(TargetFrameworks)net8.0-ios11;</TargetFrameworks>
<TargetFrameworks Condition=" '$(IsOSX)' == 'true' ">$(TargetFrameworks)net8.0-maccatalyst;</TargetFrameworks>

<IsNet7 Condition=" '$(TargetFramework.ToLower().StartsWith(net7))' == 'true' ">true</IsNet7>
<IsNet7IOS Condition=" '$(TargetFramework.ToLower().StartsWith(net7.0-ios))' == 'true' ">true</IsNet7IOS>
<IsNet7Android Condition=" '$(TargetFramework.ToLower().StartsWith(net7.0-android))' == 'true' ">true</IsNet7Android>
<IsNet8 Condition=" '$(TargetFramework.ToLower().StartsWith(net8))' == 'true' ">true</IsNet8>
<IsNet8IOS Condition=" '$(TargetFramework.ToLower().StartsWith(net8.0-ios))' == 'true' ">true</IsNet8IOS>
<IsNet8Android Condition=" '$(TargetFramework.ToLower().StartsWith(net8.0-android))' == 'true' ">true</IsNet8Android>
<IsNetStandard Condition=" '$(TargetFramework.ToLower().StartsWith(netstandard))' == 'true' ">true</IsNetStandard>
<IsNet7MacCatalyst Condition=" '$(TargetFramework.ToLower().StartsWith(net7.0-maccatalyst))' == 'true' ">true</IsNet7MacCatalyst>
<IsNet8MacCatalyst Condition=" '$(TargetFramework.ToLower().StartsWith(net8.0-maccatalyst))' == 'true' ">true</IsNet8MacCatalyst>

<IsNetX Condition=" '$(IsNet7)' == 'true' ">true</IsNetX>
<IsNetXIOS Condition=" '$(IsNet7IOS)' == 'true' ">true</IsNetXIOS>
<IsNetXAndroid Condition=" '$(IsNet7Android)' == 'true' ">true</IsNetXAndroid>
<IsNetXMacCatalyst Condition=" '$(IsNet7MacCatalyst)' == 'true' ">true</IsNetXMacCatalyst>
<IsNetX Condition=" '$(IsNet8)' == 'true' ">true</IsNetX>
<IsNetXIOS Condition=" '$(IsNet8IOS)' == 'true' ">true</IsNetXIOS>
<IsNetXAndroid Condition=" '$(IsNet8Android)' == 'true' ">true</IsNetXAndroid>
<IsNetXMacCatalyst Condition=" '$(IsNet8MacCatalyst)' == 'true' ">true</IsNetXMacCatalyst>

<IsIOS Condition=" '$(IsNetXIOS)' == 'true' ">true</IsIOS>
<IsAndroid Condition=" '$(IsNetXAndroid)' == 'true' ">true</IsAndroid>
Expand Down Expand Up @@ -53,10 +53,10 @@
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>

<!-- these versions are getting replaced by the build script in one swift pass -->
<Version>1.0.1008.0</Version>
<FileVersion>1.0.1008.0</FileVersion>
<PackageVersion>1.0.1008.0</PackageVersion>
<AssemblyVersion>1.0.1008.0</AssemblyVersion>
<Version>1.0.1009.0</Version>
<FileVersion>1.0.1009.0</FileVersion>
<PackageVersion>1.0.1009.0</PackageVersion>
<AssemblyVersion>1.0.1009.0</AssemblyVersion>

<Title>$(PackageId)</Title>
<Owners>$(Authors)</Owners>
Expand Down Expand Up @@ -104,10 +104,10 @@
<Message Importance="High" Text="DefineConstants: '$(DefineConstants)' "/>
<Message Importance="high" Text="MSBuildNodeCount: '$(MSBuildNodeCount)' "/>

<Message Importance="high" Text="IsNet7: '$(IsNet7)' "/>
<Message Importance="high" Text="IsNet8: '$(IsNet8)' "/>
<Message Importance="high" Text="IsNetX: '$(IsNetX)' "/>

<Message Importance="high" Text="IsNet7MacCatalyst: '$(IsNet7MacCatalyst)' "/>
<Message Importance="high" Text="IsNet8MacCatalyst: '$(IsNet8MacCatalyst)' "/>
<Message Importance="high" Text="IsNetXAndroid: '$(IsNetXAndroid)' "/>
<Message Importance="high" Text="IsNetXMacCatalyst: '$(IsNetXMacCatalyst)' "/>

Expand Down Expand Up @@ -146,21 +146,21 @@

<!-- ANDROID -->
<ItemGroup Condition=" '$(IsAndroid)' == 'true' ">
<PackageReference Include="Laerdal.McuMgr.Bindings.Android" Version="1.0.1008.0"/>
<PackageReference Include="Laerdal.McuMgr.Bindings.Android" Version="1.0.1009.0"/>
</ItemGroup>

<!-- IOS/MacCatalyst -->
<ItemGroup Condition=" '$(IsIOS)' == 'true' ">
<PackageReference Include="Laerdal.McuMgr.Bindings.iOS" Version="1.0.1008.0"/>
<PackageReference Include="Laerdal.McuMgr.Bindings.iOS" Version="1.0.1009.0"/>
</ItemGroup>

<ItemGroup Condition=" '$(IsNetXMacCatalyst)' == 'true' ">
<PackageReference Include="Laerdal.McuMgr.Bindings.MacCatalyst" Version="1.0.1008.0"/>
<PackageReference Include="Laerdal.McuMgr.Bindings.MacCatalyst" Version="1.0.1009.0"/>
</ItemGroup>

<!-- NETSTANDARD -->
<ItemGroup Condition=" '$(IsNetStandard)' == 'true' ">
<PackageReference Include="Laerdal.McuMgr.Bindings.NetStandard" Version="1.0.1008.0"/>
<PackageReference Include="Laerdal.McuMgr.Bindings.NetStandard" Version="1.0.1009.0"/>
</ItemGroup>

</Project>
Loading

0 comments on commit 6816eda

Please sign in to comment.