package: add target to swift package #122
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Draft: see Thoughts/Issues/Feedback/Before-Merging
tl;dr this removes warnings in
ldk-swift
, but just some feedback needed.Describe The Feature
In PR #121 we removed
swiftSettings: [.unsafeFlags(["-suppress-warnings"])]
due to Issue #120.This PR adds a
.target
that can now handle thatswiftSettings: [.unsafeFlags(["-suppress-warnings"])]
line of code back intoldk-swift
without re-creating the Issue #120.Why Add This Feature
We probably want the
swiftSettings: [.unsafeFlags(["-suppress-warnings"])]
line somewhere because an end consumer ofldk-swift
will show no warnings in their IDE instead of 1000+ withoutswiftSettings: [.unsafeFlags(["-suppress-warnings"])]
How This Feature Was Added
Instead of including
swiftSettings: [.unsafeFlags(["-suppress-warnings"])]
in.binaryTarget
it is included in.target
.For this a
.target
had to be added in thePackage.swift
file in the same.targets
section that.binaryTarget
is in.Thinking Around This Feature
ldk-node + bdk-ffi + bdk-swift
Package.swift
's all include a.target
that theswiftSettings: [.unsafeFlags(["-suppress-warnings"])]
is used in, and testing this change inldk-swift
does what is expected by removing the warnings and not causing any errors.Thoughts/Issues/Feedback Before Merging
ldk-swift
but not something that technically impedes the use ofldk-swift
ldk-swift
might only have included a.binaryTarget
and no.target
for good reasonpath
I put for the new.target
is correct but let me know if not.target
we just have to figure out a differentname
in the.target
than what I temporarily put ("LightningDevKitTarget").XyzFFI
for thename
of their.binaryTarget
and thenXyz
for thename
of their.target
ldk-swift
currently usesXyz
for the name of the.binaryTarget
. I'm not sure if we'd want to change the name of.binaryTarget
or not to add "FFI" to the end of it if it could cause problems for current consumers of the SDK, and I wasn't sure what we would want for the.target
name ifLightningDevKit
was already taken by the.binaryTarget
swiftSettings: [.unsafeFlags(["-suppress-warnings"])]
but it only shows up if you are importing a local packageldk-swift
other than if they were trying to make modifications toldk-swift
locally or something;ldk-swift
they will not see that error/bug/etc.ldk-swift
as a local swift package imo If they did they would just need to comment outswiftSettings: [.unsafeFlags(["-suppress-warnings"])]
in their local swift package