dlang / dub

Package and build management system for D
MIT License
678 stars 227 forks source link

dub generate bazel #1889

Open Panke opened 4 years ago

Panke commented 4 years ago

Bazel [1] already has rudimentary D support, but an easy way to use third party packages is missing.

I want to improve the situation in a way that allows easy integration of dub packages into a bazel workspace. I currently have two ideas. First is something along the lines of dub describe | dub2bazel to automatically create the project files needed by bazel and the second is dub generate bazel.

My hope would be that one could just dub generate bazel and check the resulting files in (preferably upstream) to build and use the package with bazel.

Anyhow I am neither proficient in dub nor bazel and wanted to ask what you think is the best way to integrate the two?

s-ludwig commented 4 years ago

Unfortunately I'm not familiar with Bazel, but judging by the first impression, the dub generate route sounds like a good fit. Writing a generator is pretty straight forward, the one in dub/generators/cmake.d could be used as a starting point, although it doesn't handle all possible build settings right now.