-
Notifications
You must be signed in to change notification settings - Fork 8
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
Generalize to Buck/Pants/etc #8
Comments
I'd definitely love to see PRs for generalizing.... though I'm not sure what that might involve. I'm extremely interested in hearing what needs folks have as well. I've been playing with things like dependency replacement, build script support, and metadeps support, but I've been having a hard time prioritizing the work since I don't have many real world use cases. |
Excellent! This would be the rough plan I would do if it were up to me... Generalize
A project that has similar structure to what I am thinking is https://github.com/swagger-api/swagger-codegen/tree/master/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages (though not the code style and such). The logic that aggregates all the input information is shared and then it is passed to domain-specific generators to do their thing. Add
[raze]
# Always used by raze core and passed to every tool.
regenerate_vendor_directory = true
[raze.buck]
# Only passed to Buck's generator.
include_builddefs = "./path/to/BUILD"
[raze.bazel]
# Only passed to Bazel's generator.
skylard_rule_location = "https://blah"
[raze.override]
# These could be used instead of the generated files.
"//my/target/1" = "./foo/BUILD"
"//my/target/2" = "./foo2/BUILD"
[raze.include]
# These could be included in the generated files by the tool.
"//my/target/3" = "./foo3/BUILD"
"//my/target/4" = "./foo4/BUILD"
|
Nice, I see you are thinking about a lot of the same stuff in #6 |
I'm going to spike generalizing these changes tonight, with a focus on getting sensible but extendable traits. I'm going to get #6 merged as well, just so that the state of the world is consistent. Thanks! |
One clarification: That said, I think embedding build tool metadata into the workspace toml isn't a bad idea at all. The initial stab at what you wanted starts as follows (from #6):
Immediately on my todo list is to get more test coverage so that people can actually contribute. EDIT: Added reference to cargo2bazel. |
Sounds good! I see you landed your branch. |
This repo has since moved to https://github.com/google/cargo-raze. I'm unlikely to drive this particular forward on my own (as I don't use Buck), so I haven't reopened this in that repo. That said, I did extract the rendering into a separate struct that implements a "Renderer". Unfortunately though, the whole integration is pretty leaky as an abstraction and I think it heavily relies on Bazel-specific features. It would really be an uphill battle to be tool-agnostic, though I'd definitely be open to accepting contributions that worked toward that, provided that they didn't increase the maintenance overhead and didn't block the way toward further functionality using Bazel-specific features. |
I was planning to build something similar and see you have already done a good chunk of the work!
Any plans to make the output tool and format pluggable? I think having clearly defined interfaces could also help the project's structure.
Would you take PRs to support such a thing? If not and you prefer to just focus on Bazel for now, no worries--I will work in my own repo and maybe we can merge projects in the future.
The text was updated successfully, but these errors were encountered: