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

Support single contract repos #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pacmanifold
Copy link

@pacmanifold pacmanifold commented Mar 16, 2023

@mandrean I found this today and it has already improved my life quality significantly. Thank you 🙏

But I ran into some issues when trying to compile "single contract repos" since they usually don't contain a contracts folder. Currently when running cargo cw-optimizoor in a single contract repo it results in

Error: No CW contracts found. Exiting.

To reproduce run:

cargo generate --git https://github.com/CosmWasm/cw-template.git --name cw-test-project
cd cw-test-project
cargo cw-optimizoor

This PR solves this problem by only filtering the workspace members if the workspace is virtual. Does this seem like a reasonable to you?

@pacmanifold
Copy link
Author

pacmanifold commented Mar 17, 2023

I guess two other ideas (maybe more solid?) could be:

  1. To check for usage of cosmwasm_std::entry_point in the workspace members to determine which are CosmWasm contracts
  2. Or to require a setting in the Cargo.toml file specifying which members should be optimized

@mandrean
Copy link
Owner

Hey @pacmanifold! Always happy to hear user-stories like that 😄

Thanks for the contribution. I think it makes sense, with the caveat that there surely exists many projects that aren't virtual but still have a contracts/ folder. So we need to make sure we're not introducing a breaking change for existing users

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