dub - Add dependency for only "dub test"

Ben Goodwyn bengoodwyn at me.com
Wed Jun 27 16:53:49 UTC 2018


I like to use fluent-asserts 
(https://github.com/gedaiu/fluent-asserts), but I seem to be 
missing something in how to only add that as a dependency for the 
unittest builds.

The documentation encourages overwriting the unittest 
configuration, but when I do this it changes a large number of 
things including removing the normal release and debug builds and 
trying to build as a shared library instead of an application.

I believe I have a dub.json configuration question that boils 
down to:
* How do I add a dependency when running "dub test" without 
changing all of the default configurations?
* Do I have to completely define all of the configurations that 
dub provides by default once I decide to make a custom 
configuration?
* If so, how can I see what the boilerplate would be for all of 
those configurations to have a sane starting point?

What fluent asserts recommends with I believe a lot of necessary 
stuff omitted in the "..."'s:
     ...
     "configurations": [
         ...
         {
             "name": "unittest",
             "dependencies": {
                 "fluent-asserts": "~>0.9.0",
                 ...
             }
         },
         ...
     ]
     ...

Using the dlanguage/ldc:1.9.0 Docker image.


More information about the Digitalmars-d mailing list