Open AndrejMitrovic opened 1 year ago
That is odd, but try creating the lib directory manually and don't let the generator own it.
Yeah I think the best thing to do is just commit the auto-generated code, and only update when necessary. Using preBuildCommands
for these tricks is probably abusing what it's supposed to be used for.
No, that's fine, I just think dub is doing some analysis a bit too soon and you're giving the generator the control to create a directory in which it's doing analysis on.
I see what you mean, make the dir and commit it empty first. Yeah, that can do the trick.
yeah this is not great right now, generated sources or things like modifying dub.json/dub.sdl of subpackages is not currently working yet.
I have what is essentially:
Where the script runs the protobuf compiler and generates some D code within
lib/generated
.But on the first invocation dub will emit a warning (plus a build error):
Is there a better way to do this?
Because the current behavior is very unstable, essentially the build will fail the first time around if any of the project's code imports the generated code, but it will then succeed on the next dub rebuild as the
preBuildCommands
will have been executed by then and the import warnings will no longer exist.Moved from https://github.com/vibe-d/vibe.d/issues/2733, filed there by accident.