Install multiple executables with DUB
drug2004 at bk.ru
Fri Sep 4 07:55:30 UTC 2020
On 9/4/20 10:27 AM, glis-glis wrote:
> On Thursday, 3 September 2020 at 14:34:48 UTC, Jacob Carlborg wrote:
>> Oh, multiple binaries, I missed that. You can try to add multiple
>> configurations . Or if you have executables depending on only one
>> source file, you can use single-file packages .
> Thanks, but this still means I would have to write an install-script
> `dub build --single`
> on each script, right?
> I looked at tsv-utils  which seems to be a similar use-case as mine,
> and they declare each tool as a subpackage. The main package runs a
> d-file called `dub_build.d` which compiles all subpackages. Fells like
> an overkill to me, I'll probably just stick to a makefile.
I don't know is it suitable for your use case but I do the following:
1. add a recipe in every tool files like:
drug at drug: ~/utils$ cat ./tools/count.d
dependency "abcdLibrary" version="*" path="path/to/abcdLibrary"
2. place all tool files into one directory `tools`
3. build them using `dub build --single tools/count.d`
4. Now I have all binary in `bin` directory, all sources in `tools`
directory and have no subpackages at all
More information about the Digitalmars-d-learn