You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dub supports generation of sources using preGenerateCommands (disregarding issue #1474). However, the advertised way causes sources to always be (re)generated, causing unnecessary recompilation. This will of course escalate if there are sources that depend on the generated source, and/or other projects that depend on this project. It is possible to prevent this, but it requires jumping through additional hoops and boiler plate code.
This could be made possible with an interface like this:
I have tried integrating d code directly into the recipe file, but this is currently limited to one-liners like
"preBuildCommands": [
"rdmd --eval=\"writeln(`Started $BUILD_TYPE build at `, Clock.currTime, ` for $PACKAGE_DIR on $PLATFORM`)\""
]
I have tried hijacking Dub. Although interestingly possible:
// build.d in the package root dir, to be called like// dub build.d <command>
#!/usr/bin/env dub
/+ dub.json: { "name": "build", "dependencies": { "dub": "~>1.19.0" }}+/import dub.commandline;
intmain(string[] args)
{
returnrunDubCommandLine(args); // Or do something special instead!
}
... this is unlikely to be a good idea because
Special actions don't turn up in dub describe, like preGenerateCommands do.
Special actions may not be forward compatible with future dub versions.
Can break building package dependencies.
Breaking into the code flow of dub is not easy at all.
Actually invoking the hijacked version when the package is compiled as a dependency is an unsolved problem.
The text was updated successfully, but these errors were encountered:
Dub supports generation of sources using
preGenerateCommands
(disregarding issue #1474). However, the advertised way causes sources to always be (re)generated, causing unnecessary recompilation. This will of course escalate if there are sources that depend on the generated source, and/or other projects that depend on this project. It is possible to prevent this, but it requires jumping through additional hoops and boiler plate code.This could be made possible with an interface like this:
The way to do this currently:
Dead ends
I have tried integrating d code directly into the recipe file, but this is currently limited to one-liners like
I have tried hijacking Dub. Although interestingly possible:
... this is unlikely to be a good idea because
dub describe
, likepreGenerateCommands
do.The text was updated successfully, but these errors were encountered: