Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move backends (and examples) into separate subpackages #73

Closed
wants to merge 2 commits into from

Conversation

stackotter
Copy link
Owner

This will be a huge improvement once I set up a custom Swift Package Registry (to enable consumers to depend on packages within subdirectories of the repo). It means that consumers of SwiftCrossUI can have fine-grained control over exactly which backends are built as part of their project. This should also speed up package resolution.

Currently, there are a bunch of janky system-library availability checks to conditionally include as many backends as possible (because there's no way for a consumer of a Swift package to selectively enable/disable specific products of a dependency). With these changes, only the Gtk backend has any kind of janky availability check (because it needs to know whether the Gtk version is >=4.10 or not - thanks Gtk).

Having the Examples separate is also quite nice.

A side effect of all this is that SwiftCrossUI itself is now dependency-less, making it easy to bring to new platforms without needing to introduce even more availability checks.

…ers more control and remove need for janky availability checks

Everything is way simpler now, I just need to set up the custom registry to make it all usable outside
of the package. As a bonus, you can now change the backend used by the examples very quickly. The backends
don't need any of those janky system library availability checks anymore which also gives consumers of the
library more flexibility to install the system libraries in unexpected ways (as long as the Swift compiler
can find them everything will work as expected).
@stackotter stackotter closed this Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant