Sooner or later the question of licenses of dependencies comes up. This package helps keeping an overview. See forum.dlang.org/Learn for discussion of this.
Please add the following to your artifact (after dub fetch packageinfo
).
preGenerateCommands "$DUB run packageinfo"
sourcePaths "source" "out/generated/packageinfo"
importPaths "source" "out/generated/packageinfo"
This will create a module in out/generated/packageinfo/packageinfo.d that contains all dependencies with selected informatiosn (name, version and license).
The information is provided as an enum, so it is possible to access it at compile time
import packageinfo;
static foreach (p; packageinfo.packages)
{
pragma(msg, p);
}
or runtime
import std.stdio : writeln;
import packageinfo;
writeln(packageinfo.packages);
To select one configuration of your dub project, pass
--config=CONFIGNAME
to packageinfo.
See the dogfood configuration in packageinfo itself as an example.