This PR implements Swift Package Manager support for the version 1.X.
Change Notes
Added new class Package.swift to implement the Swift Package manifest.
Since SPM doesn't support Objective-C/Swift code on the same target, a new internal target for all the Obj-C classes was created in the Package manifest: HLSObjectiveC.
Target mamba is the only target exposed to be implemented. [Please note that HLSObjectiveC target is an internal target for Swift Package Manager support, which is not open to the implementors.]
There was a small re-structure in the folders containing Obj-C classes:
Now they are contained in the mambaSharedFramework/HLS ObjectiveC folder.
Folder HLS ObjectiveC contains an include folder for the publicly exposed headers.
Mamba.xcodeproj was modified to reflect the new folder structure.
mamba.podspec was modified to exclude SPM support files.
New class Exports.swift was created. This class exposes Objective-C public headers for Swift use. More information about this in here. In the section EXPOSING YOUR OBJC TO SWIFT USERS
Due the "folder structure" nature of SPM, some imports were added to reflect SWIFT_PACKAGE usage.
This new PR points to develop_1.X, instead of release version 1.5.0.
No more Symlinks. Now the public headers are present in the include folder.
Exports.swift and Package.swift are inside the Mamba.xcodeproj for ease of access. (But please note that in order to build and compile the Swift package, opening the file Package.swift is required. Mamba.xcodeproj cannot build/compile the Swift Package).
Instead of multiple internal headers, only two were required this time:
HLSObjectiveC - Target for ObjC code. [This is needed because we can't mix languages in SPM].
HLSParserError. [This is needed because HLSParserError shares error codes to both ObjC and Swift classes, therefore, in order to make it available for Swift and ObjC targets, it needed to be extracted from both to have its own target.]
Added Copyright notices in new classes. (Exports.swift and Package.swift)
Testing Sample Apps
In order to test these changes, I have created these sample apps that implements mamba as:
Description
This PR implements Swift Package Manager support for the version 1.X.
Change Notes
Added new class
Package.swift
to implement the Swift Package manifest.Since SPM doesn't support Objective-C/Swift code on the same target, a new internal target for all the Obj-C classes was created in the Package manifest:
HLSObjectiveC
.Target
mamba
is the only target exposed to be implemented. [Please note thatHLSObjectiveC
target is an internal target for Swift Package Manager support, which is not open to the implementors.]There was a small re-structure in the folders containing Obj-C classes:
mambaSharedFramework/HLS ObjectiveC
folder.HLS ObjectiveC
contains aninclude
folder for the publicly exposed headers.Mamba.xcodeproj
was modified to reflect the new folder structure.mamba.podspec
was modified to exclude SPM support files.New class
Exports.swift
was created. This class exposes Objective-C public headers for Swift use. More information about this in here. In the sectionEXPOSING YOUR OBJC TO SWIFT USERS
Due the "folder structure" nature of SPM, some imports were added to reflect SWIFT_PACKAGE usage.
What is different from previous PR?
develop_1.X
, instead of release version 1.5.0.include
folder.Exports.swift
andPackage.swift
are inside theMamba.xcodeproj
for ease of access. (But please note that in order to build and compile the Swift package, opening the filePackage.swift
is required.Mamba.xcodeproj
cannot build/compile the Swift Package).HLSObjectiveC
- Target for ObjC code. [This is needed because we can't mix languages in SPM].HLSParserError
. [This is needed because HLSParserError shares error codes to both ObjC and Swift classes, therefore, in order to make it available for Swift and ObjC targets, it needed to be extracted from both to have its own target.]Exports.swift
andPackage.swift
)Testing Sample Apps In order to test these changes, I have created these sample apps that implements mamba as:
MambaSamples-develop_1.x.zip
Pre-submission Checklist