dlang / dub

Package and build management system for D
MIT License
678 stars 227 forks source link

Need to exclude dependencies when building docs #2599

Open WebFreak001 opened 1 year ago

WebFreak001 commented 1 year ago

Discussed in https://github.com/dlang/dub/discussions/2491

Originally posted by **torhus** September 24, 2022 When I use DUB to build documentation for my project, it also builds docs for DWT. Is there a way to prevent it from doing this? I tried using `excludeSourceFiles`, but no luck.
MikeShah commented 1 year ago

Can also confirm I cannot get this working (builds all documentation for my project and gtk-d)

I've tried explicitly preventing files and also a glob, for example:

"excludedSourceFiles": ["/home/mike/.dub/packages/gtk-d-3.10.0/*/"]

I would even settle for ignoring directories if possible.

s-ludwig commented 1 year ago

In the case of -b ddox, there is an extended directive to pass custom arguments (SDL: x:ddoxFilterArgs, JSON: "-ddoxFilterArgs"). Adding "--ex" "dwt." arguments would then filter out all modules prefixed by "dwt.". I'm using that to generate all vibe.d related documentation on https://vibed.org/api/ by building with --combined and then excluding everything that is not vibe.d related (as well as "internal" modules). This way, things like eventcore and diet-ng are also part of the documentation and fully cross-linked.

For -b docs builds, there is no special mechanism like that, but the usual methods like compiling specific packages and using excludedSourceFiles should work.