Skip to content

Commit

Permalink
refa: split up the single .csproj we had into 4 distinct projects so …
Browse files Browse the repository at this point in the history
…that we will now generate separate nugets for iOS, iOSSimulator.Arm64, iOSSimulator.x64 and MacCatalyst (wip)
  • Loading branch information
ksidirop-laerdal committed Jan 15, 2025
1 parent 09fe9e0 commit 5d75867
Show file tree
Hide file tree
Showing 17 changed files with 2,059 additions and 326 deletions.
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -405,13 +405,16 @@ ASALocalRun/
.localhistory/

Output/
Laerdal.Dfu.Bindings.iOS/Carthage/
Laerdal.Dfu.Bindings.iOS/Sharpie/
Laerdal.Dfu.Bindings.iOS/Frameworks/
Laerdal.Dfu.Native/
Laerdal.Dfu.Bindings.*/Carthage/
Laerdal.Dfu.Bindings.*/Sharpie/
Laerdal.Dfu.Bindings.*/Frameworks/


*.binlog
*.csproj.xml

# we dont want to allow any local nuget.configs to be checked in as they can cause issues with the build and/or contain hardcoded API keys with write access to the
# nuget feed and this is something we definitely want to avoid at all costs for obvious reasons such nuget.config files should be remain local to each dev machine
[Nn][Uu][Gg][Ee][Tt].[Cc][Oo][Nn][Ff][Ii][Gg]

414 changes: 414 additions & 0 deletions Laerdal.Dfu.Bindings.MacCatalyst/ApiDefinition.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectRootPath>$(MSBuildThisFileDirectory)</ProjectRootPath>

<Laerdal_Package_Name>Laerdal.Dfu.Bindings.MacCatalyst</Laerdal_Package_Name>
</PropertyGroup>

<PropertyGroup>
<TargetFramework>net8.0-maccatalyst</TargetFramework>
</PropertyGroup>

<PropertyGroup>
<_CompileAndGenerateFatLibs_Config>$(_CompileAndGenerateFatLibs_Config) SUPPORTS_MACCATALYST='YES'</_CompileAndGenerateFatLibs_Config>
<_CompileAndGenerateFatLibs_Config>$(_CompileAndGenerateFatLibs_Config) XCODEBUILD_TARGET_SDK='macosx'</_CompileAndGenerateFatLibs_Config>
<_CompileAndGenerateFatLibs_Config>$(_CompileAndGenerateFatLibs_Config) XCODEBUILD_TARGET_ARCH='arm64'</_CompileAndGenerateFatLibs_Config>

<_CompileAndGenerateFatLibs_Config>$(_CompileAndGenerateFatLibs_Config) XCODE_IDE_DEV_PATH='$(Laerdal_Bindings_MacCatalyst___Xcode_Ide_Dev_Path)'</_CompileAndGenerateFatLibs_Config>
<_CompileAndGenerateFatLibs_Config>$(_CompileAndGenerateFatLibs_Config) XCODEBUILD_TARGET_SDK_VERSION='$(Laerdal_Bindings_MacCatalyst___Sdk_Version)'</_CompileAndGenerateFatLibs_Config>
</PropertyGroup>

<Import Project="../Laerdal.Scripts/Laerdal.targets"/>
</Project>
112 changes: 112 additions & 0 deletions Laerdal.Dfu.Bindings.MacCatalyst/StructsAndEnums.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
using ObjCRuntime;

namespace Laerdal.Dfu.Bindings.iOS
{
[Native]
public enum DFUError : long
{
RemoteLegacyDFUSuccess = 1,
RemoteLegacyDFUInvalidState = 2,
RemoteLegacyDFUNotSupported = 3,
RemoteLegacyDFUDataExceedsLimit = 4,
RemoteLegacyDFUCrcError = 5,
RemoteLegacyDFUOperationFailed = 6,
RemoteSecureDFUSuccess = 11,
RemoteSecureDFUOpCodeNotSupported = 12,
RemoteSecureDFUInvalidParameter = 13,
RemoteSecureDFUInsufficientResources = 14,
RemoteSecureDFUInvalidObject = 15,
RemoteSecureDFUSignatureMismatch = 16,
RemoteSecureDFUUnsupportedType = 17,
RemoteSecureDFUOperationNotPermitted = 18,
RemoteSecureDFUOperationFailed = 20,
RemoteSecureDFUExtendedError = 21,
RemoteExtendedErrorWrongCommandFormat = 22,
RemoteExtendedErrorUnknownCommand = 23,
RemoteExtendedErrorInitCommandInvalid = 24,
RemoteExtendedErrorFwVersionFailure = 25,
RemoteExtendedErrorHwVersionFailure = 26,
RemoteExtendedErrorSdVersionFailure = 27,
RemoteExtendedErrorSignatureMissing = 28,
RemoteExtendedErrorWrongHashType = 29,
RemoteExtendedErrorHashFailed = 30,
RemoteExtendedErrorWrongSignatureType = 31,
RemoteExtendedErrorVerificationFailed = 32,
RemoteExtendedErrorInsufficientSpace = 33,
RemoteExperimentalButtonlessDFUSuccess = 9001,
RemoteExperimentalButtonlessDFUOpCodeNotSupported = 9002,
RemoteExperimentalButtonlessDFUOperationFailed = 9004,
RemoteButtonlessDFUSuccess = 91,
RemoteButtonlessDFUOpCodeNotSupported = 92,
RemoteButtonlessDFUOperationFailed = 94,
RemoteButtonlessDFUInvalidAdvertisementName = 95,
RemoteButtonlessDFUBusy = 96,
RemoteButtonlessDFUNotBonded = 97,
FileNotSpecified = 101,
FileInvalid = 102,
ExtendedInitPacketRequired = 103,
InitPacketRequired = 104,
FailedToConnect = 201,
DeviceDisconnected = 202,
BluetoothDisabled = 203,
ServiceDiscoveryFailed = 301,
DeviceNotSupported = 302,
ReadingVersionFailed = 303,
EnablingControlPointFailed = 304,
WritingCharacteristicFailed = 305,
ReceivingNotificationFailed = 306,
UnsupportedResponse = 307,
BytesLost = 308,
CrcError = 309,
InvalidInternalState = 500
}

public enum DFUFirmwareType : byte
{
Softdevice = 1,
Bootloader = 2,
Application = 4,
SoftdeviceBootloader = 3,
SoftdeviceBootloaderApplication = 7
}

[Native]
public enum DFUState : long
{
Connecting = 0,
Starting = 1,
EnablingDfuMode = 2,
Uploading = 3,
Validating = 4,
Disconnecting = 5,
Completed = 6,
Aborted = 7
}

[Native]
public enum DFUUuidType : long
{
LegacyService = 0,
LegacyControlPoint = 1,
LegacyPacket = 2,
LegacyVersion = 3,
SecureService = 4,
SecureControl = 5,
SecurePacket = 6,
ButtonlessService = 7,
ButtonlessCharacteristic = 8,
ButtonlessWithoutBondSharing = 9,
ButtonlessWithBondSharing = 10
}

[Native]
public enum LogLevel : long
{
Debug = 0,
Verbose = 1,
Info = 5,
Application = 10,
Warning = 15,
Error = 20
}
}
16 changes: 16 additions & 0 deletions Laerdal.Dfu.Bindings.iOS.sln
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,31 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Misc", "_Misc", "{DB8D9BFF
Laerdal.Scripts\Laerdal.Builder.targets = Laerdal.Scripts\Laerdal.Builder.targets
.gitignore = .gitignore
Laerdal.Scripts\Laerdal.GenerateSignAndUploadSbom.sh = Laerdal.Scripts\Laerdal.GenerateSignAndUploadSbom.sh
Laerdal.Scripts\Laerdal.Mac.CompileAndGenerateFatLibs.sh = Laerdal.Scripts\Laerdal.Mac.CompileAndGenerateFatLibs.sh
Laerdal.Scripts\Laerdal.targets = Laerdal.Scripts\Laerdal.targets
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Laerdal.Dfu.Bindings.MacCatalyst", "Laerdal.Dfu.Bindings.MacCatalyst\Laerdal.Dfu.Bindings.MacCatalyst.csproj", "{5B622943-B0B5-4076-A01A-90B35085783C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Laerdal.Dfu.Bindings.iOSSimulator.Arm64", "Laerdal.Dfu.Bindings.iOSSimulator.Arm64\Laerdal.Dfu.Bindings.iOSSimulator.Arm64.csproj", "{BF8CFFF3-F461-4E71-A52F-DFD90CAD7E3C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Laerdal.Dfu.Bindings.iOSSimulator.x64", "Laerdal.Dfu.Bindings.iOSSimulator.x64\Laerdal.Dfu.Bindings.iOSSimulator.x64.csproj", "{E017DE68-51C5-4982-8C7C-DEF7ACF04094}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A9FE8625-F74F-431E-BED5-A50AAD22FB88}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A9FE8625-F74F-431E-BED5-A50AAD22FB88}.Release|Any CPU.Build.0 = Release|Any CPU
{5B622943-B0B5-4076-A01A-90B35085783C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5B622943-B0B5-4076-A01A-90B35085783C}.Release|Any CPU.Build.0 = Release|Any CPU
{A2283FE2-CF20-4824-AFD5-357F30D1FE4B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A2283FE2-CF20-4824-AFD5-357F30D1FE4B}.Release|Any CPU.Build.0 = Release|Any CPU
{BF8CFFF3-F461-4E71-A52F-DFD90CAD7E3C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BF8CFFF3-F461-4E71-A52F-DFD90CAD7E3C}.Release|Any CPU.Build.0 = Release|Any CPU
{E017DE68-51C5-4982-8C7C-DEF7ACF04094}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E017DE68-51C5-4982-8C7C-DEF7ACF04094}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Loading

0 comments on commit 5d75867

Please sign in to comment.