Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ksidirop-laerdal committed Feb 26, 2025
2 parents 2801aa0 + eaff1cb commit debbfb6
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 22 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@ env:
LAERDAL_REPOSITORY_PATH: ${{ github.repository }}

# note that its vital that we use our own token here instead of GITHUB_TOKEN that is because access the
# nuget repos of Laerdal.Dfu.Bindings.iOS and Laerdal.Dfu.Bindings.Android which are inaccessible to the GITHUB_TOKEN
SCL_GITHUB_ACCESS_TOKEN: ${{ secrets.SCL_GITHUB_ACCESS_TOKEN }}
# nuget repos of Laerdal.Dfu.Bindings.iOS and Laerdal.Dfu.Bindings.Android which are inaccessible to the GITHUB_TOKEN
SCL_NUGET_ORG_FEED_API_KEY: ${{ secrets.NUGET_ORG_FEED_API_KEY }}

SCL_GITHUB_ACCESS_TOKEN: ${{ secrets.SCL_GITHUB_ACCESS_TOKEN }}
SCL_GITHUB_NUGET_FEED_USERNAME: ${{ secrets.SCL_GITHUB_NUGET_FEED_USERNAME }}

SCL_DEPENDENCY_TRACKER_API_KEY: ${{ secrets.SCL_DEPENDENCY_TRACKER_API_KEY }}
SCL_DEPENDENCY_TRACKER_SERVER_URL: ${{ secrets.SCL_DEPENDENCY_TRACKER_SERVER_URL }}
SCL_DEPENDENCY_TRACKER_SIGNING_PRIVATE_KEY: ${{ secrets.SCL_DEPENDENCY_TRACKER_SIGNING_PRIVATE_KEY }}

DOTNET_TARGET_WORKLOAD_VERSION: "8.0.402" # dont upgrade this lightheartedly the workload snapshot implicitly defines which versions of Android/iOS/MacCatalyst SDKs are supported
DOTNET_TARGET_WORKLOAD_VERSION: "8.0.405" # dont upgrade this lightheartedly the workload snapshot implicitly defines which versions of Android/iOS/MacCatalyst SDKs are supported


on:
Expand Down Expand Up @@ -55,7 +56,9 @@ jobs:
with:
fetch-tags: true # https://github.com/actions/checkout/issues/1471#issuecomment-1771231294
fetch-depth: 0


# "${{ github.actor }}"
# "${{ github.token }}"
- name: '🛠 Setup Build Environment'
shell: 'bash'
run: |
Expand All @@ -64,8 +67,8 @@ jobs:
"${{env.BUILD_REPOSITORY_FOLDERPATH}}/Laerdal.Scripts/Laerdal.SetupBuildEnvironment.sh" \
"${{env.DOTNET_TARGET_WORKLOAD_VERSION}}" \
"https://nuget.pkg.github.com/Laerdal/index.json" \
"${{ github.actor }}" \
"${{ github.token }}" \
"${{ env.SCL_GITHUB_NUGET_FEED_USERNAME }}" \
"${{ env.SCL_GITHUB_ACCESS_TOKEN }}" \
"${{ env.BUILD_REPOSITORY_FOLDERPATH }}/Artifacts"
# we need to manually install java11 because it is needed by the latest windows vm-images that run on
Expand Down
25 changes: 16 additions & 9 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 All @@ -38,13 +45,13 @@
<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>
<!-- ios you will need specific workloads though dotnet workload install maui -/-version 8.0.405 -->
<TargetPlatformVersion Condition=" '$(IsForIOS)' == 'true' ">18.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>
<!-- maccatalyst you will need specific workloads though dotnet workload install maui -/-version 8.0.405 -->
<TargetPlatformVersion Condition=" '$(IsForMacCatalyst)' == 'true' ">18.0</TargetPlatformVersion>
<TargetPlatformMinVersion Condition=" '$(IsForMacCatalyst)' == 'true' ">13.1</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition=" '$(IsForMacCatalyst)' == 'true' ">13.1</SupportedOSPlatformVersion>
</PropertyGroup>
Expand Down Expand Up @@ -101,11 +108,11 @@
</ItemGroup>
<!-- iOS -->
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-ios'">
<PackageReference Include="Laerdal.Dfu.Bindings.iOS" Version="4.15.3.43980" />
<PackageReference Include="Laerdal.Dfu.Bindings.iOS" Version="4.15.3.43995" />
</ItemGroup>
<!-- MacCatalyst -->
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-maccatalyst'">
<PackageReference Include="Laerdal.Dfu.Bindings.iOS" Version="4.15.3.43980" />
<PackageReference Include="Laerdal.Dfu.Bindings.MacCatalyst" Version="4.15.3.43995" />
</ItemGroup>
<!-- =========================== PACKAGES ============================ -->

Expand Down
14 changes: 8 additions & 6 deletions Laerdal.Dfu/Laerdal.targets
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<PropertyGroup>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>

<Deterministic>true</Deterministic>
<IncludeSource>true</IncludeSource>
<ImplicitUsings>true</ImplicitUsings>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<Deterministic>true</Deterministic>
<ImplicitUsings>true</ImplicitUsings>
</PropertyGroup>

<!-- ==================== DEFAULT CI CONFIGURATION ==================== -->
Expand All @@ -25,14 +25,15 @@
<!-- ==================== PACKAGING ==================== -->
<PropertyGroup>
<!-- Laerdal_Package_Name -->
<Title>$(Laerdal_Package_Name)</Title>
<PackageId>$(Laerdal_Package_Name)</PackageId>

<Title>$(Laerdal_Package_Name)</Title>
<AssemblyName>$(Laerdal_Package_Name)</AssemblyName>
<RootNamespace>$(Laerdal_Package_Name)</RootNamespace>

<!-- Laerdal_Package_Copyright -->
<Authors>$(Laerdal_Package_Copyright)</Authors>
<Owners>$(Laerdal_Package_Copyright)</Owners>
<Authors>$(Laerdal_Package_Copyright)</Authors>
<Copyright>$(Laerdal_Package_Copyright)</Copyright>

<!-- Laerdal_Package_Description -->
Expand All @@ -56,8 +57,8 @@

<ItemGroup>
<None Include="$(PackageIconPath)" Pack="true" PackagePath="\" Condition="Exists('$(PackageIconPath)')" />
<None Include="$(PackageLicencePath)" Pack="true" PackagePath="\" Condition="Exists('$(PackageLicencePath)')" />
<None Include="$(PackageReadMePath)" Pack="true" PackagePath="\" Condition="Exists('$(PackageReadMePath)')" />
<None Include="$(PackageLicencePath)" Pack="true" PackagePath="\" Condition="Exists('$(PackageLicencePath)')" />
</ItemGroup>

<!-- ==================== SOURCELINK ==================== -->
Expand Down Expand Up @@ -120,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
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,23 @@ git clone https://github.com/Laerdal/Laerdal.Dfu.git
```bash
dotnet msbuild Laerdal.Scripts/Laerdal.Builder.targets /m:1 /p:Laerdal_Version=9.0.x.0 /p:Laerdal_Github_Access_Token=<place your github access token here - its needed by carthage>
```

## Known issues

- Trying to use the iOS/Android flavours of this library in desktop-simulators for iOS/Android will probably result in compilation errors. If you want to perform general purpose
UI-testing on your desktop using such simulators you need to tweak your nuget references to use the `-force-dud` nuget of `Laerdal.Dfu` like so:

```xml
<PackageReference Include="Laerdal.Dfu" Version="x.y.z-force-dud">
<NoWarn>$(NoWarn);NU1605</NoWarn>
</PackageReference>
```

Alternatively you can achieve the same result by overriding the reference to `Laerdal.Dfu.Bindings.iOS` like so (note: this solution is only applicable for iOS and will work only
for iOS sdk 18.x or below!):

```xml
<PackageReference Include="Laerdal.Dfu.Bindings.iOS" Version="x.y.z-ios-sim-arm64">
<NoWarn>$(NoWarn);NU1605</NoWarn>
</PackageReference>
```

0 comments on commit debbfb6

Please sign in to comment.