Thread overview
dub is building docs of dependencies
Dec 05, 2018
Jedzia
Dec 05, 2018
Andre Pany
Dec 06, 2018
Jedzia
Dec 06, 2018
Jedzia
Dec 06, 2018
Andre Pany
December 05, 2018
dmd2-2.083.0, win
minimal dub init
with dub.json:
{
	"description": "A minimal D application.",
	"dependencies": {
		"iz": "~>0.6.23"
	},
	"authors": [
		"Jedzia"
	],
	"copyright": "Copyright © 2018, Jedzia",
	"license": "MIT",
	"name": "testdoc"
}

and `dub build -b docs`

Is it normal that dub builds the docs of dependencies (iz library in that case).
And if, how to build only the docs of my own project?


December 05, 2018
On Wednesday, 5 December 2018 at 02:08:13 UTC, Jedzia wrote:
> dmd2-2.083.0, win
> minimal dub init
> with dub.json:
> {
> 	"description": "A minimal D application.",
> 	"dependencies": {
> 		"iz": "~>0.6.23"
> 	},
> 	"authors": [
> 		"Jedzia"
> 	],
> 	"copyright": "Copyright © 2018, Jedzia",
> 	"license": "MIT",
> 	"name": "testdoc"
> }
>
> and `dub build -b docs`
>
> Is it normal that dub builds the docs of dependencies (iz library in that case).
> And if, how to build only the docs of my own project?

To your dub.json you can add following line to exclude e.g. arsd.cgi:
"-ddoxFilterArgs": ["--ex", "arsd.cgi", "--min-protection", "Public"],

Kind regards
André
December 06, 2018
On Wednesday, 5 December 2018 at 12:00:45 UTC, Andre Pany wrote:
> On Wednesday, 5 December 2018 at 02:08:13 UTC, Jedzia wrote:
>> dmd2-2.083.0, win
>> minimal dub init
>> with dub.json:
>> {
>> 	"description": "A minimal D application.",
>> 	"dependencies": {
>> 		"iz": "~>0.6.23"
>> 	},
>> 	"authors": [
>> 		"Jedzia"
>> 	],
>> 	"copyright": "Copyright © 2018, Jedzia",
>> 	"license": "MIT",
>> 	"name": "testdoc"
>> }
>>
>> and `dub build -b docs`
>>
>> Is it normal that dub builds the docs of dependencies (iz library in that case).
>> And if, how to build only the docs of my own project?
>
> To your dub.json you can add following line to exclude e.g. arsd.cgi:
> "-ddoxFilterArgs": ["--ex", "arsd.cgi", "--min-protection", "Public"],
>
> Kind regards
> André

Thank you Andre, but that refers to ddox which is badly applicable under windows, thanks to the "Unexpected OPTLINK Termination at EIP=....." problem.
A solution to this is building ddox from the repository with `dub build --arch=x86_64`.
With ´dub build --arch=x86_64 -b ddox´ in the minimal app above and your filter added(and without), the ddox build fails with the above error. For reasons I don't know it seems that ddox is build as 32bit app and OPTILINK fails.
The solution for this is to point dub to my successful built 64bit ddox ... which I don't know how to do. If someone can clarify this? Thanks.

But all of that has nothing to do with the simple and essential task of building documentation for your project. Not for the dependencies, not for something else. Your project.
Don't get me wrong. I am not pissed, only lost as newbie. The solution or at least a hint to this problem should be stated in the documentation right under http://code.dlang.org/docs/commandline#build and should not turn into a research project:)

So lets dig into https://github.com/dlang/dub/blob/master/source/dub/commandline.d GeneratorSettings.m_buildType == "docs"

December 06, 2018
Okay, what i am trying to achieve is simply not there.

BuildOption._docs is a enum, that is passed recursively to the dependencies and switches doc building on and object building off for the different generators (I missed to say that i am using dmd -> "-o-", "-Dddocs").

What i was looking for is a dub command-target like "build", "run", "test".

Oh .... "add docs command" -> https://github.com/dlang/dub/issues/501

Not a solution, but a warm feeling of knowledge:)


December 06, 2018
On Thursday, 6 December 2018 at 14:09:34 UTC, Jedzia wrote:
> On Wednesday, 5 December 2018 at 12:00:45 UTC, Andre Pany wrote:
>> [...]
>
> Thank you Andre, but that refers to ddox which is badly applicable under windows, thanks to the "Unexpected OPTLINK Termination at EIP=....." problem.
> A solution to this is building ddox from the repository with `dub build --arch=x86_64`.
> With ´dub build --arch=x86_64 -b ddox´ in the minimal app above and your filter added(and without), the ddox build fails with the above error. For reasons I don't know it seems that ddox is build as 32bit app and OPTILINK fails.
> The solution for this is to point dub to my successful built 64bit ddox ... which I don't know how to do. If someone can clarify this? Thanks.
>
> [...]

With next version of dub, also ddox respects the architecture.
https://github.com/dlang/dub/pull/1588

Yes, we should adapt the documentation and add a dub docs command.

Kind regards
Andre