Skip to content

Commit

Permalink
feat (Laerdal.McuMgr.Bindings.Android.csproj): switch the project ove…
Browse files Browse the repository at this point in the history
…r to net8.0 [warning: this is generating poisoned nugets for the time being]
  • Loading branch information
dsidirop committed May 21, 2024
1 parent 0670432 commit 530310e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,9 @@
<PropertyGroup>
<LangVersion>10.0</LangVersion>

<!-- net6 supports android12 and it corresponds to android-api levels 31.0 and 32.0 -->
<!-- <TargetPlatformVersion>21.0</TargetPlatformVersion> -->
<!-- <SupportedOSPlatformVersion Condition=" '$(TargetFramework.ToLower().StartsWith(net6.0))' == 'true' ">21</SupportedOSPlatformVersion> -->

<!-- net7 supports android13 and it corresponds to android-api level 33.0 -->
<TargetPlatformVersion Condition=" '$(TargetFramework.ToLower().StartsWith(net7.0))' == 'true' ">33.0</TargetPlatformVersion>
<SupportedOSPlatformVersion Condition=" '$(TargetFramework.ToLower().StartsWith(net7.0))' == 'true' ">33</SupportedOSPlatformVersion>

<!-- net8 supports android13 and it corresponds to android-api level 34.0 -->
<!-- <TargetPlatformVersion Condition=" '$(TargetFramework.ToLower().StartsWith(net8.0))' == 'true' ">34.0</TargetPlatformVersion> -->
<!-- <SupportedOSPlatformVersion Condition=" '$(TargetFramework.ToLower().StartsWith(net8.0))' == 'true' ">34</SupportedOSPlatformVersion> -->
<TargetPlatformVersion Condition=" '$(TargetFramework.ToLower().StartsWith(net8.0))' == 'true' ">34.0</TargetPlatformVersion>
<SupportedOSPlatformVersion Condition=" '$(TargetFramework.ToLower().StartsWith(net8.0))' == 'true' ">34</SupportedOSPlatformVersion>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -44,7 +36,8 @@
<TransformFile Include="Transforms/*.xml"/>

<AndroidLibrary Include="$(CoreAarLibrary)" Bind="true" />

<!-- <AndroidLibrary Include="$(DependenciesAarLibrary)" Bind="false" /> -->

<AndroidLibrary Include="$(AndroidLibsFolder)/Dependencies/slf4j-api.jar" Bind="false" />
<AndroidLibrary Include="$(AndroidLibsFolder)/Dependencies/jackson-core.jar" Bind="false" />
<AndroidLibrary Include="$(AndroidLibsFolder)/Dependencies/jackson-databind.jar" Bind="false" />
Expand All @@ -68,7 +61,7 @@

<Error Text="No transform files found on disk! This looks fishy ... erroring out ..."
Condition=" @(TransformFile->Count()) == 0 "/>

<ItemGroup>
<MissingTransformFiles Include="@(TransformFile)" Condition=" ! Exists(%(FullPath)) " />
<MissingAndroidLibraries Include="@(AndroidLibrary)" Condition=" ! Exists(%(FullPath)) " />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
<IsWindows Condition=" '$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true' ">true</IsWindows>
<IsUnix Condition=" '$(IsOSX)' == 'true' OR '$(IsLinux)' == 'true' ">true</IsUnix>

<!-- to future maintainers we stick with net7 for now in android because as it turned out the net8 toolchain generates broken -->
<!-- to future maintainers we stick with net8 for now in android because as it turned out the net8 toolchain generates broken -->
<!-- to future maintainers android dlls that cause missing-symbols-errors in runtime what a freakshow net8 turned out to be man -->
<!-- -->
<!-- https://github.com/dotnet/maui/issues/21102 -->
<!-- -->
<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>
Expand All @@ -42,7 +42,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 @@ -55,15 +55,15 @@
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>

<!-- these versions are getting replaced by the build script in one swift pass -->
<Version>1.0.1039.0</Version>
<FileVersion>1.0.1039.0</FileVersion>
<PackageVersion>1.0.1039.0</PackageVersion>
<AssemblyVersion>1.0.1039.0</AssemblyVersion>
<Version>1.0.1071.0</Version>
<FileVersion>1.0.1071.0</FileVersion>
<PackageVersion>1.0.1071.0</PackageVersion>
<AssemblyVersion>1.0.1071.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 All @@ -80,6 +80,7 @@
<AndroidLibsDependenciesFolder>$(AndroidLibsFolder)/Dependencies</AndroidLibsDependenciesFolder>

<CoreAarLibrary>$(AndroidLibsFolder)/mcumgr-laerdal-wrapper.aar</CoreAarLibrary>
<!-- <DependenciesAarLibrary>mcumgr-laerdal-wrapper-dependencies.aar</DependenciesAarLibrary> -->
</PropertyGroup>

<ItemGroup>
Expand All @@ -100,15 +101,15 @@
<Message Importance="high" Text="BuildingProject: '$(BuildingProject)' "/>
<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

0 comments on commit 530310e

Please sign in to comment.