Skip to content

Commit

Permalink
feat (Laerdal.Dfu.csproj): add side-support for generating a net8-onl…
Browse files Browse the repository at this point in the history
…y dud-build of the Laerdal.Dfu for use in desktop-simulators of iOS/Android

   this pure-net8 nuget is more future-proof that the one we have via Laerdal.Dfu.Bindings.iOS because we don't need to update it for each new version of the iOS sdk (18, 19, ...)
  • Loading branch information
ksidirop-laerdal committed Jan 20, 2025
1 parent 4f7663c commit 90df899
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
13 changes: 10 additions & 3 deletions Laerdal.Dfu/Laerdal.Dfu.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,17 @@

<!-- ==================== TARGET FRAMEWORKS GROUP ===================== -->
<PropertyGroup>

<!-- - note that we build against net8.0 merely as a dud-placeholder for windows in which we are bound to get not-implemented exceptions all over the place -->
<!-- - the dud build for net8 also comes in handy when we want to launch an application inside an ios-simulator in the macos desktop (for UI testing purposes) -->

<PackageVersionPostfix Condition=" '$(BuildOnlyDudNet8)' == 'true' ">-force-dud</PackageVersionPostfix>

<TargetFrameworks>$(TargetFrameworks)net8.0;</TargetFrameworks>
<TargetFrameworks>$(TargetFrameworks)net8.0-ios;</TargetFrameworks>
<TargetFrameworks>$(TargetFrameworks)net8.0-android;</TargetFrameworks>
<TargetFrameworks>$(TargetFrameworks)net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition=" '$(BuildOnlyDudNet8)' != 'true' ">$(TargetFrameworks)net8.0-ios;</TargetFrameworks>
<TargetFrameworks Condition=" '$(BuildOnlyDudNet8)' != 'true' ">$(TargetFrameworks)net8.0-android;</TargetFrameworks>
<TargetFrameworks Condition=" '$(BuildOnlyDudNet8)' != 'true' ">$(TargetFrameworks)net8.0-maccatalyst</TargetFrameworks>

</PropertyGroup>

<!-- =================== TARGET FRAMEWORK DETECTION ===================== -->
Expand Down
3 changes: 2 additions & 1 deletion Laerdal.Dfu/Laerdal.targets
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@

<!-- Apply Version parts according to packaging standards -->
<Version>$(Laerdal_Version_Full)</Version>
<PackageVersion>$(Laerdal_Version_Full)</PackageVersion>
<!-- keep this because it is needed to generate the *-force-dud nuget packages! -->
<PackageVersion>$(Laerdal_Version_Full)$(PackageVersionPostfix)</PackageVersion>

<AssemblyVersion>$(Laerdal_Version_Full)</AssemblyVersion>
<AssemblyFileVersion>$(Laerdal_Version_Full)</AssemblyFileVersion>
Expand Down
10 changes: 9 additions & 1 deletion Laerdal.Scripts/Laerdal.Builder.targets
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
<PackageOutputPath Condition=" '$(PackageOutputPath)' == '' ">$(BUILD_ARTIFACTSTAGINGDIRECTORY)</PackageOutputPath>
<PackageOutputPath Condition=" '$(PackageOutputPath)' == '' ">$([System.IO.Path]::Combine($(MSBuildThisFileDirectory), `..`, `Artifacts/`))</PackageOutputPath>

<Laerdal_Script_FolderPath>$(MSBuildThisFileDirectory)</Laerdal_Script_FolderPath>

<Laerdal_RootDirectory_Folderpath>$([System.IO.Path]::Combine( '$(Laerdal_Script_FolderPath)', '..' ))</Laerdal_RootDirectory_Folderpath>
<Laerdal_RootDirectory_Folderpath>$([System.IO.Path]::GetFullPath( '$(Laerdal_RootDirectory_Folderpath)' ))</Laerdal_RootDirectory_Folderpath>

<Laerdal_Source_Branch Condition=" '$(Laerdal_Source_Branch)' == '' ">$(BUILD_SOURCEBRANCH)</Laerdal_Source_Branch>
<Laerdal_Repository_Path Condition=" '$(Laerdal_Repository_Path)' == '' ">$(BUILD_REPOSITORY_NAME)</Laerdal_Repository_Path>
<Laerdal_Dependency_Tracker_Server_Url Condition=" '$(Laerdal_Dependency_Tracker_Server_Url)' == '' ">https://dep-tracker.laerdal.com/api/api/v1/bom</Laerdal_Dependency_Tracker_Server_Url>
Expand Down Expand Up @@ -85,7 +90,10 @@
</PropertyGroup>

<!-- RUN -->
<MSBuild Projects="$(Laerdal_Project)" Properties="$(_Laerdal_Build_Parameters)" Targets="Restore;Build"/>
<MSBuild Projects="$(Laerdal_Project)" Targets="Restore;Build" Properties="$(_Laerdal_Build_Parameters)" />

<!-- -force-dud build aiming just pure net8 without bindings this is meant for desktop simulators of android and ios for ui testing purposes of apps -->
<MSBuild Projects="$(Laerdal_Project)" Targets="Restore;Rebuild" Properties="$(_Laerdal_Build_Parameters);BuildOnlyDudNet8=true;SourceRoot=$(Laerdal_RootDirectory_Folderpath)/Laerdal.Dfu/;" />
</Target>

<!-- GITHUB RELEASE -->
Expand Down

0 comments on commit 90df899

Please sign in to comment.