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

Permit explicit target opt-in #318

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

CorvusPrudens
Copy link

This PR supersedes #212 with a more general solution. The utility is explained there.

Rather than providing a single --bin-skip flag, the build command now has two additional flags --bin and --lib. These provide explicit opt-ins for their respective targets.

The default behavior is to build both. If an explicit opt-in is provided for one target, the other target will be excluded unless it also receives an opt-in.

This behavior might be a bit confusing. If there's a better and simpler approach, for example simply providing a boolean value for each, that should be an easy change.

If additional testing is required, please let me know! I simply adjusted the tests assuming no flags were provided.

@benwis
Copy link
Contributor

benwis commented Oct 23, 2024

@CorvusPrudens Sorry about the delayed review, if you can fix the conflicts I'd be happy to merge this!

@CorvusPrudens
Copy link
Author

Looking at the CLI flags again, I think it may make more sense to take a boolean value.

For example:

cargo leptos build --bin false

There are already precedents for boolean options right in the build subcommand, and it makes the functionality more clear.

I should be able to implement this very soon. It's really not much different from how it works already.

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.

2 participants