Skip to content

Commit

Permalink
refa (Laerdal.targets): the iphone-simulator nugets now have the same…
Browse files Browse the repository at this point in the history
… base name as the iOS nuget (Laerdal.Dfu.Bindings.iOS) and differ only by a certain postfix to the package version

   with this new scheme on each build we generate 4 nugets like so:

     Laerdal.Dfu.Bindings.iOS           version: 1.2.3
     Laerdal.Dfu.Bindings.iOS           version: 1.2.3-ios-sim-x64    (for the legacy iphonesimulator-x86_64)
     Laerdal.Dfu.Bindings.iOS           version: 1.2.3-ios-sim-arm64  (for the new iphonesimulator-arm64)
     Laerdal.Dfu.Bindings.MacCatalyst   version: 1.2.3
  • Loading branch information
ksidirop-laerdal committed Jan 15, 2025
1 parent 7736a65 commit 4de71f2
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
<!-- to future maintainers if you are asking yourself: -->
<!-- to future maintainers -->
<!-- to future maintainers "can't we just use the lipo cli to combine iphonesimulator-arm64 and iphoneos-arm64 into a single native binary and generate a single nuget instead of two?" -->
<!-- to future maintainers -->
<!-- to future maintainers the answer is: -->
<!-- to future maintainers -->
<!-- to future maintainers lipo does not (at the time of this writing and probably in the future) support combining two arm64 binaries into one this is why we need to have two separate -->
<!-- to future maintainers nugets with that differ only in version: the iphonesimulator nuget is marked as prelease with the 'ios-sim-arm64' prefix! both nugets get uploaded to the -->
<!-- to future maintainers nuget server -->
<!-- to future maintainers -->
<!-- to future maintainers Laerdal.Dfu.Bindings.iOS version: 1.2.3 -->
<!-- to future maintainers Laerdal.Dfu.Bindings.iOS version: 1.2.3-ios-sim-x64 -->
<!-- to future maintainers Laerdal.Dfu.Bindings.iOS version: 1.2.3-ios-sim-arm64 -->
<!-- to future maintainers -->

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectRootPath>$(MSBuildThisFileDirectory)</ProjectRootPath>

<Laerdal_Package_Name>Laerdal.Dfu.Bindings.iOSSimulator.Arm64</Laerdal_Package_Name>
<Laerdal_Package_Tags>Simulators</Laerdal_Package_Tags>
<Laerdal_Package_Name>Laerdal.Dfu.Bindings.iOS</Laerdal_Package_Name>

<!-- this is absolutely vital! -->
<Laerdal_Package_Version_Postfix>-ios-sim-arm64</Laerdal_Package_Version_Postfix>
</PropertyGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
<!-- to future maintainers if you are asking yourself: -->
<!-- to future maintainers -->
<!-- to future maintainers "can't we just use the lipo cli to combine iphonesimulator-x64 and iphoneos-arm64 into a single native binary and generate a single nuget instead of two?" -->
<!-- to future maintainers -->
<!-- to future maintainers the answer is: -->
<!-- to future maintainers -->
<!-- to future maintainers lipo does indeed support that sort of thing however it does NOT support the same for the new iphonesimulator-arm64 approach for M1+ apple silicon we chose -->
<!-- to future maintainers to side with the new approach used in iphonesimulator-arm64 in which we generate separate nuget packages differentiated by a phony version-postfix like so: -->
<!-- to future maintainers -->
<!-- to future maintainers Laerdal.Dfu.Bindings.iOS version: 1.2.3 -->
<!-- to future maintainers Laerdal.Dfu.Bindings.iOS version: 1.2.3-ios-sim-x64 -->
<!-- to future maintainers Laerdal.Dfu.Bindings.iOS version: 1.2.3-ios-sim-arm64 -->
<!-- to future maintainers -->

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectRootPath>$(MSBuildThisFileDirectory)</ProjectRootPath>

<Laerdal_Package_Name>Laerdal.Dfu.Bindings.iOSSimulator.x64</Laerdal_Package_Name>
<Laerdal_Package_Tags>Simulators</Laerdal_Package_Tags>
<Laerdal_Package_Name>Laerdal.Dfu.Bindings.iOS</Laerdal_Package_Name>

<!-- this is absolutely vital! -->
<Laerdal_Package_Version_Postfix>-ios-sim-x64</Laerdal_Package_Version_Postfix>
</PropertyGroup>

<PropertyGroup>
Expand Down
11 changes: 7 additions & 4 deletions Laerdal.Scripts/Laerdal.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<PropertyGroup>
<!--<Laerdal_Package_Name>Laerdal.Dfu.Bindings.iOS</Laerdal_Package_Name>-->
<Laerdal_Package_Tags>Ble;Tools;Xamarin;Dfu;Bluetooth;Nordic;Semiconductor</Laerdal_Package_Tags>
<Laerdal_Package_Tags>$(Laerdal_Package_Tags);Ble;Tools;Xamarin;Dfu;Bluetooth;Nordic;Semiconductor</Laerdal_Package_Tags>
<Laerdal_Package_Copyright>Laerdal Medical, Francois Raminosona</Laerdal_Package_Copyright>
<Laerdal_Package_Description>Xamarin wrapper around Nordic.Dfu for iOS.</Laerdal_Package_Description>

Expand Down Expand Up @@ -124,7 +124,7 @@
<PackageOutputPath>$([System.IO.Path]::GetFullPath( '$(PackageOutputPath)' ))</PackageOutputPath>

<!-- Extra files and properties -->
<PackageTags>Laerdal;Internal;$(Laerdal_Package_Tags)</PackageTags>
<PackageTags>$(Laerdal_Package_Tags)</PackageTags>
<PackageIconPath>$([System.IO.Path]::Combine($(MSBuildProjectDirectory), `../icon.png`))</PackageIconPath>
<PackageLicencePath>$([System.IO.Path]::Combine($(MSBuildProjectDirectory), `../LICENSE`))</PackageLicencePath>
<PackageReadMePath>$([System.IO.Path]::Combine($(MSBuildProjectDirectory), `../README.md`))</PackageReadMePath>
Expand Down Expand Up @@ -182,12 +182,15 @@
<!-- ==================== VERSION ==================== -->
<PropertyGroup>
<Laerdal_Version_Full Condition="'$(Laerdal_Version_Full)' == ''">1.0.0-local.0</Laerdal_Version_Full>

<!-- Apply Version parts according to packaging standards -->
<Version>$(Laerdal_Version_Full)</Version>
<AssemblyVersion>$(Laerdal_Version_Full)</AssemblyVersion>
<AssemblyFileVersion>$(Laerdal_Version_Full)</AssemblyFileVersion>
<AssemblyInformationalVersion>$(Laerdal_Version_Full)</AssemblyInformationalVersion>
<Version>$(Laerdal_Version_Full)</Version>
<PackageVersion>$(Laerdal_Version_Full)</PackageVersion>

<!-- note that it is absolutely vital to append $(Laerdal_Package_Version_Postfix) because the iphone-simulator nugets need it! -->
<PackageVersion>$(Laerdal_Version_Full)$(Laerdal_Package_Version_Postfix)</PackageVersion>
</PropertyGroup>

<!-- considering the highly customized nature of the build system we need to ensure that parallelization is turned off otherwise we will end up with -->
Expand Down

0 comments on commit 4de71f2

Please sign in to comment.