-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Introduce SwiftBundler library target #66
Introduce SwiftBundler library target #66
Conversation
# Conflicts: # Sources/SwiftBundler/SwiftBundler.swift # Sources/swift-bundler/Main.swift
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this 🙏 I replied to your comments and I agree that things should be changed to avoid polluting the global namespace.
I believe that the renaming of SwiftBundler
to SwiftBundlerDocumentation will break the
update-docsworkflow (which will only run once this is merged so you won't see it in the PR CI results). DocC has been able to generate docs for executable targets for a while now (I think?), so we can probably just move the docs to the CLI target and update the CI action accordingly. The alternative is leaving them in
SwiftBundlerDocumentationand updating the action to reflect that, but then the documentation title will be
SwiftBundlerDocumentationrather than
SwiftBundleror
swift-bundler`, unless DocC has introduced finer control over that since I set up these docs.
I've recreated what happens on CI locally and as far as I can tell it does not break anything. I've therefore updated the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now, just the docs issue which I'll finish my comment on.
The documentation is meant to contain a bunch of usage articles rather than code documentation. Here's what it looks like at the moment; https://swiftbundler.dev/documentation/swiftbundler/ The documentation is currently located at Might be worth trying to move the docc archive to |
#65 should be merged as basis for this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to merge this once the Windows CI gets fixed (looks like one of the Signal
changes didn't propagate to the #if os(Windows)
-gated implementation)
The current Windows CI build failure is swift version dependent as it seems. Running this on my local machine everything is fine: PS C:\Users\ctref\Developer\swift-bundler> swift build --product swift-bundler
Building for debugging...
[1/1] Write auxiliary file C:\Users\ctref\Developer\swift-bundler\.build\x86_64-unknown-windows-msvc\debug\swift-version--4DE95AB4C5047989.txt
Build of product 'swift-bundler' complete! (63.45s)
PS C:\Users\ctref\Developer\swift-bundler> swift --version
Swift version 6.0.2 (swift-6.0.2-RELEASE)
Target: x86_64-unknown-windows-msvc
PS C:\Users\ctref\Developer\swift-bundler> Have to look into it more in-depth |
Yeah I've run into that issue before (in SwiftCrossUI's CI), it's such a frustrating bug, no clue why it happens. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm! I'll merge this into a new branch, figure out docs stuff, then merge into main.
Motivation
While swift-bundler being an executable is nice and useful, some use-cases require the core functionality of swift-bundler to be available as a library. This allows for example other ArgumentParser based executables to incorporate swift-bundler commands and execute them as part of their CLI.
This PR enables that through introducing a
SwiftBundler
library target.All
swift-bundler
files where moved to that target, exceptMain.swift
which remains the sole file in theswift-bundler
executable.Nothing changes in regards to functionality only the essential types like
SwiftBundler
where made public.Library usage
For now we don't expose every type in the public interface, but provide the main entry point to library users.
A library user can then just call
to invoke swift-bundler as usual.
This ensures no deviation between CLI interface and library functionality while allowing swift-bundler being used inside other CLI code.
CHANGES