Replies: 5 comments 6 replies
-
Dependencies can already inject into the build lifecycle (preBuild, postBuild, preGenerate, postGenerate) of your package by being a sourceLibrary, however you can't really configure them too much. @Geod24 should we allow custom configuration sections in dub recipes for dependencies to read? (e.g. We could also move out things like the integrated ddox generator into packages. |
Beta Was this translation helpful? Give feedback.
-
another common pattern that we have been discussing for a while is custom sub-commands, e.g. through the registry via some future namespacing or just allowing all packages that start with I think having extensible dub.json/dub.sdl sections like the one with From #252: This is just a thought and might not be a good idea. Dub has quite some special knowledge, like My thought is to forward these to special binaries; |
Beta Was this translation helpful? Give feedback.
-
from #304: I've started writing toD compilers (e.g. .asn1 to .d) to facilitate the development process of certain projects. This involves sending arguments to a compiler executable depending on the build environment. It can also be useful for compiling *.dt to *.d on a per-file basis rather than increasing the compile-time of an entire project/library (also making it possible to have 100s of diet template pages). I've thought of making a fork of dub to add the json arguments and additional compilation steps but this brought to mind the possibility of having these as plugin features in dub.
Ideally, the way the plugins are compiled into dub would serve the purpose of facilitating an otherwise complex build process. They would have access to several template function calls on several occasions:
This is a minimal feature set that would truly empower dub and allow "sub-compilers" to be added to D projects seamlessly. Here is a more complete description of the whole process, and an outline of a possible implementation. I will be using master, slave and forked to describe the 3 different dub instances involved. The master dub is the one invoked during normal compilation of a project, and the slave dub is the dub source code modified at runtime by the master dub when a To be more specific, when the master dub reads the
|
Beta Was this translation helpful? Give feedback.
-
From #743: Hello! I'd like to run some platform-specific scripts on clean (such as make clean) when running dub clean but can't find a way to hook this into dub.sdl. For the moment I have make call dub for the clean target, but it's complicated for nothing :) |
Beta Was this translation helpful? Give feedback.
-
When working with dub, often common solutions are discovered for common problems, e.g. setting up integration tests, detecting and building protocol buffer files, etc. As of right now, the only way to share knowledge and usage of such solutions is to copy snippets of dub files into your own project.
As dub configuration solutions get more complex or receive updates, it becomes harder and harder to keep all projects up to date with the latest state of knowledge.
One possible solution would be to introduce a "dub plugin", which allows common configuration to be built and maintained, in a manner similar to maven plugins from Java. These dub plugins would have their own repository that could be downloaded from during build time, and they would have the ability to latch onto the build process.
For example, the Maven Failsafe Plugin takes configurations such as the file naming pattern of integration tests in a project, and during a built, when the
verify
phase of the build comes, the plugin adds logic to find those test files and run them.This is possible because Maven exposes a build lifecycle that plugins can attach to and execute code for.
Beta Was this translation helpful? Give feedback.
All reactions