Skip to content

Commit

Permalink
[MAN-420] Fix build error concerning mac catalyst sdk version
Browse files Browse the repository at this point in the history
  • Loading branch information
ksidirop-laerdal authored Oct 2, 2024
2 parents 01381d2 + 1370faf commit c4a9776
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
<!-- 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=" '$(IsNetX)' == 'true' ">true</ShouldBuildNativeLibraries>

<!-- net8 supports android13 and it corresponds to android-api level 34.0 -->
<TargetPlatformVersion Condition=" '$(IsNetX)' == 'true' and '$(TargetPlatformVersion)' == '' ">34</TargetPlatformVersion>
<SupportedOSPlatformVersion Condition=" '$(IsNetX)' == 'true' ">21</SupportedOSPlatformVersion>
<!-- net8 supports android13 and it corresponds to android-api level 34.0 notice that the ordering of the following evaluations is important! -->
<TargetPlatformVersion Condition=" '$(IsNetX)' == 'true' and '$(Laerdal_Bindings_Android___DotnetTargetPlatformVersion)' != '' ">$(Laerdal_Bindings_Android___DotnetTargetPlatformVersion)</TargetPlatformVersion>
<TargetPlatformVersion Condition=" '$(IsNetX)' == 'true' and '$(TargetPlatformVersion)' == '' ">34</TargetPlatformVersion>
<SupportedOSPlatformVersion Condition=" '$(IsNetX)' == 'true' ">21</SupportedOSPlatformVersion>

<DebugType>pdbonly</DebugType>
<DefineConstants>$(DefineConstants);TRACE</DefineConstants>
Expand Down Expand Up @@ -61,10 +62,10 @@
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>

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

<Title>$(PackageId)</Title>
<Owners>$(Authors)</Owners>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@

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

<!-- this should must be kept in sync between this file and laerdal.mcumgr.csproj -->
<TargetPlatformVersion Condition=" '$(IsNetXMacCatalyst)' == 'true' and '$(TargetPlatformVersion)' == '' ">17.0</TargetPlatformVersion>
<SupportedOSPlatformVersion Condition=" '$(IsNetXMacCatalyst)' == 'true' ">14.5</SupportedOSPlatformVersion>
<!-- this should must be kept in sync between this file and laerdal.mcumgr.csproj notice that the ordering of the following evaluations is important! -->
<TargetPlatformVersion Condition=" '$(IsNetXMacCatalyst)' == 'true' and '$(Laerdal_Bindings_MacCatalyst___DotnetTargetPlatformVersion)' != '' ">$(Laerdal_Bindings_MacCatalyst___DotnetTargetPlatformVersion)</TargetPlatformVersion>
<TargetPlatformVersion Condition=" '$(IsNetXMacCatalyst)' == 'true' and '$(TargetPlatformVersion)' == '' ">17.0</TargetPlatformVersion>
<SupportedOSPlatformVersion Condition=" '$(IsNetXMacCatalyst)' == 'true' ">13.1</SupportedOSPlatformVersion>

<OutputPath>bin\</OutputPath>
<OutputType>Library</OutputType>
Expand Down Expand Up @@ -72,10 +73,10 @@
<AllowedReferenceRelatedFileExtensions>$(AllowedReferenceRelatedFileExtensions);.pdb</AllowedReferenceRelatedFileExtensions>

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

<Title>$(PackageId)</Title>
<Summary>McuMgr Bindings for MacCatalyst - MAUI ready</Summary>
Expand Down Expand Up @@ -169,6 +170,7 @@
<Exec WorkingDirectory="../Laerdal.McuMgr.Bindings.MacCatalystAndIos.Native" Command=" bash -c &quot; chmod +x ./Laerdal.Mac.CompileAndGenerateFatLibs.sh &quot; "/>

<PropertyGroup>
<_CliCommand>$(_CliCommand) SUPPORTS_MACCATALYST='YES' </_CliCommand>
<_CliCommand>$(_CliCommand) SWIFT_OUTPUT_PATH='$(NativeFrameworkParentFolderpath)' </_CliCommand>
<_CliCommand>$(_CliCommand) XCODE_IDE_DEV_PATH='$(Laerdal_Bindings_MacCatalyst___Xcode_Ide_Dev_Path)' </_CliCommand>
<_CliCommand>$(_CliCommand) XCODEBUILD_TARGET_SDK='macosx' </_CliCommand>
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.1166.0</Version>
<FileVersion>1.0.1166.0</FileVersion>
<PackageVersion>1.0.1166.0</PackageVersion>
<AssemblyVersion>1.0.1166.0</AssemblyVersion>
<Version>1.0.1167.0</Version>
<FileVersion>1.0.1167.0</FileVersion>
<PackageVersion>1.0.1167.0</PackageVersion>
<AssemblyVersion>1.0.1167.0</AssemblyVersion>

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

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

<!-- this should must be kept in sync between this file and laerdal.mcumgr.csproj -->
<TargetPlatformVersion Condition=" '$(IsNetXIos)' == 'true' and '$(TargetPlatformVersion)' == '' ">17.0</TargetPlatformVersion>
<SupportedOSPlatformVersion Condition=" '$(IsNetXIos)' == 'true' ">11.0</SupportedOSPlatformVersion>
<!-- this should must be kept in sync between this file and laerdal.mcumgr.csproj notice that the ordering of the following evaluations is important! -->
<TargetPlatformVersion Condition=" '$(IsNetXIos)' == 'true' and '$(Laerdal_Bindings_iOS___DotnetTargetPlatformVersion)' != '' ">$(Laerdal_Bindings_iOS___DotnetTargetPlatformVersion)</TargetPlatformVersion>
<TargetPlatformVersion Condition=" '$(IsNetXIos)' == 'true' and '$(TargetPlatformVersion)' == '' ">17.0</TargetPlatformVersion>
<SupportedOSPlatformVersion Condition=" '$(IsNetXIos)' == 'true' ">11.0</SupportedOSPlatformVersion>

<OutputPath>bin\</OutputPath>
<OutputType>Library</OutputType>
Expand Down Expand Up @@ -72,10 +73,10 @@
<AllowedReferenceRelatedFileExtensions>$(AllowedReferenceRelatedFileExtensions);.pdb</AllowedReferenceRelatedFileExtensions>

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

<Title>$(PackageId)</Title>
<Summary>McuMgr Bindings for iOS - MAUI ready</Summary>
Expand Down Expand Up @@ -169,6 +170,7 @@
<Exec WorkingDirectory="../Laerdal.McuMgr.Bindings.MacCatalystAndIos.Native" Command=" chmod +x ./Laerdal.Mac.CompileAndGenerateFatLibs.sh "/>

<PropertyGroup>
<_CliCommand>$(_CliCommand) SUPPORTS_MACCATALYST='NO' </_CliCommand>
<_CliCommand>$(_CliCommand) SWIFT_OUTPUT_PATH='$(NativeFrameworkParentFolderpath)' </_CliCommand>
<_CliCommand>$(_CliCommand) XCODE_IDE_DEV_PATH='$(Laerdal_Bindings_iOS___Xcode_Ide_Dev_Path)' </_CliCommand>
<_CliCommand>$(_CliCommand) XCODEBUILD_TARGET_SDK='iphoneos' </_CliCommand>
Expand Down
16 changes: 8 additions & 8 deletions Laerdal.McuMgr/Laerdal.McuMgr.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>

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

<Title>$(PackageId)</Title>
<Owners>$(Authors)</Owners>
Expand Down Expand Up @@ -168,21 +168,21 @@

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

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

<ItemGroup Condition=" '$(IsNetXMacCatalyst)' == 'true' and '$(Should_Skip_MacCatalyst)' != 'true' ">
<PackageReference Include="Laerdal.McuMgr.Bindings.MacCatalyst" Version="1.0.1166.0"/>
<PackageReference Include="Laerdal.McuMgr.Bindings.MacCatalyst" Version="1.0.1167.0"/>
</ItemGroup>

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

</Project>
6 changes: 3 additions & 3 deletions Laerdal.Scripts/Laerdal.Builder.targets
Original file line number Diff line number Diff line change
Expand Up @@ -242,20 +242,20 @@
<MSBuild Projects="$(Laerdal_McuMgrBindings_ProjectFile_Android)" Properties="$(_Laerdal_Build_Parameters)" Targets="Restore"/>
<MSBuild Projects="$(Laerdal_McuMgrBindings_ProjectFile_Android)" Properties="$(_Laerdal_Build_Parameters);BuildingProject=true;" Targets="TackleJarDependencies"/>
<MSBuild Projects="$(Laerdal_McuMgrBindings_ProjectFile_Android)"
Properties="$(_Laerdal_Build_Parameters);TargetPlatformVersion=$(Laerdal_Bindings_Android___DotnetTargetPlatformVersion);BuildingProject=true;SourceRoot=$(Laerdal_RootDirectory_Folderpath)/Laerdal.McuMgr.Bindings.Android/;" Targets="Build"/>
Properties="$(_Laerdal_Build_Parameters);Laerdal_Bindings_Android___DotnetTargetPlatformVersion=$(Laerdal_Bindings_Android___DotnetTargetPlatformVersion);BuildingProject=true;SourceRoot=$(Laerdal_RootDirectory_Folderpath)/Laerdal.McuMgr.Bindings.Android/;" Targets="Build"/>

<!-- its absolute vital to call this targets first explicitly and separately from the main build otherwise the -->
<!-- resulting nugets will be poisoned and will not work in maui apps at all due to missing native symbols -->
<MSBuild Projects="$(Laerdal_McuMgrBindings_ProjectFile_iOS)" Targets="EnsureFrameworkFolderIsCreated"/>
<MSBuild Projects="$(Laerdal_McuMgrBindings_ProjectFile_iOS)"
Properties="$(_Laerdal_Build_Parameters);TargetPlatformVersion=$(Laerdal_Bindings_iOS___DotnetTargetPlatformVersion);Laerdal_Bindings_iOS___Xcode_Ide_Dev_Path=$(Laerdal_Bindings_iOS___Xcode_Ide_Dev_Path);Laerdal_Bindings_iOS___Sdk_Version=$(Laerdal_Bindings_iOS___Sdk_Version);SourceRoot=$(Laerdal_RootDirectory_Folderpath)/Laerdal.McuMgr.Bindings.iOS/;" Targets="Restore;Rebuild"/>
Properties="$(_Laerdal_Build_Parameters);Laerdal_Bindings_iOS___DotnetTargetPlatformVersion=$(Laerdal_Bindings_iOS___DotnetTargetPlatformVersion);Laerdal_Bindings_iOS___Xcode_Ide_Dev_Path=$(Laerdal_Bindings_iOS___Xcode_Ide_Dev_Path);Laerdal_Bindings_iOS___Sdk_Version=$(Laerdal_Bindings_iOS___Sdk_Version);SourceRoot=$(Laerdal_RootDirectory_Folderpath)/Laerdal.McuMgr.Bindings.iOS/;" Targets="Restore;Rebuild"/>

<!-- its absolute vital to call this targets first explicitly and separately from the main build otherwise the -->
<!-- resulting nugets will be poisoned and will not work in maui apps at all due to missing native symbols -->
<MSBuild Projects="$(Laerdal_McuMgrBindings_ProjectFile_MacCatalyst)" Targets="EnsureFrameworkFolderIsCreated" Condition=" '$(Should_Skip_MacCatalyst)' != 'true' "/>
<MSBuild Targets="Restore;Rebuild" Condition=" '$(Should_Skip_MacCatalyst)' != 'true' "
Projects="$(Laerdal_McuMgrBindings_ProjectFile_MacCatalyst)"
Properties="$(_Laerdal_Build_Parameters);TargetPlatformVersion=$(Laerdal_Bindings_MacCatalyst___DotnetTargetPlatformVersion);Laerdal_Bindings_MacCatalyst___Xcode_Ide_Dev_Path=$(Laerdal_Bindings_MacCatalyst___Xcode_Ide_Dev_Path);Laerdal_Bindings_MacCatalyst___Sdk_Version=$(Laerdal_Bindings_MacCatalyst___Sdk_Version);SourceRoot=$(Laerdal_RootDirectory_Folderpath)/Laerdal.McuMgr.Bindings.MacCatalyst/;" />
Properties="$(_Laerdal_Build_Parameters);Laerdal_Bindings_MacCatalyst___DotnetTargetPlatformVersion=$(Laerdal_Bindings_MacCatalyst___DotnetTargetPlatformVersion);Laerdal_Bindings_MacCatalyst___Xcode_Ide_Dev_Path=$(Laerdal_Bindings_MacCatalyst___Xcode_Ide_Dev_Path);Laerdal_Bindings_MacCatalyst___Sdk_Version=$(Laerdal_Bindings_MacCatalyst___Sdk_Version);SourceRoot=$(Laerdal_RootDirectory_Folderpath)/Laerdal.McuMgr.Bindings.MacCatalyst/;" />

<!-- notice that we are actually rebuilding mcumgr merely building the project doesnt really cut it -->
<MSBuild Projects="$(Laerdal_McuMgr_ProjectFile)"
Expand Down

0 comments on commit c4a9776

Please sign in to comment.