cli: Add keys include/exclude in programs section#546
cli: Add keys include/exclude in programs section#546armaniferrante merged 6 commits intosolana-foundation:masterfrom
Conversation
|
Let's add this to one of the examples/tests so that we don't regress the feature. You can use |
|
@armaniferrante I added |
| cluster = "localnet" | ||
| wallet = "~/.config/solana/id.json" | ||
|
|
||
| [programs] |
There was a problem hiding this comment.
What do you think of renaming this to [workspace], similar to Cargo?
I'm a little hesitant to use the [programs] name because in the future we may want to combine the [[test.genesis]] and [clusters.<network>] sections into one named [programs], since they both allow customizing various features of programs in the workspace and feels a little more appropriate.
There was a problem hiding this comment.
I think it's will be better, thanks for the suggestion! Changed. But now I think, should [workspace] have members & exclude as Cargo (with members default to programs/* for example)?
There was a problem hiding this comment.
Sounds good to me! members may be better since it's consistent with Cargo but I'm happy with either choice.
There was a problem hiding this comment.
Went ahead and did the rename.
There was a problem hiding this comment.
Thanks. I thought to add regex support but was busy yesterday.
There was a problem hiding this comment.
Would be cool to see in a subsequent PR.
There was a problem hiding this comment.
Sure. Should we use default value for members as["programs/*"]?
There was a problem hiding this comment.
Let's hold off on the regex support. I'm making some changes that will conflict with this.
There was a problem hiding this comment.
To support package publishing, I've changed the members and exclude arrays to take paths relative to the workspace root (instead of relative to the programs/ dir, as is done in this PR), which is consistent with how Cargo handles this.
The next version will this PR in it. But the immediate release following will contain the breaking change (PR here #570).
Not sure that this is correct but I think it would be good if
programsdirectory would be able to contain shared code (crate) between programs. Right nowanchorcli consider all directories in inprogramsas program and trying to compile / generate IDL. This PR allows to include / exclude directories.