D-Scanner
D-Scanner copied to clipboard
preGenerateCommands should not run when used as a library
The preGenerateCommands in dub.json cause dscanner to be rebuilt every time even if there was no change in the application. When using dscanner as a library it's rare (but not completely out of question) to use DSCANNER_VERSION so I think it would be a better idea leaving that blank for library builds.
I solved a similar issue by having a debug config and a deploy config in dub.json. The preGenerateCommands creating the version file is only in the deploy config. Maybe s.th. similar can help here too.
You can add a config for that too if needed. As long as the default stuff that's built is the application then it is okay, meaning that dub build continues to build the application and that the pregenerate command is run.