dub run subPackage by default
Andre Pany
andre at s-e-a-p.de
Tue Sep 1 14:45:43 UTC 2020
On Tuesday, 1 September 2020 at 11:45:34 UTC, ParticlePeter wrote:
> Hello,
>
> I have a targetType sourceLibrary and demonstrate its usage
> through a subPackage. For the library itself 'dub run' is
> meaningless, but not for the subPackage.
> Is there a way to tell dub through dub.sdl or dub.json to build
> and run a specific subPackage by default, without having to
> call:
> 'dub run mySourceLib:myPackage' ?
>
> Why do I want this? Because I use Sublime Text build systems to
> execute a dub build/run. As far as I can see I would have to
> set up a build version for any package:subPackeg combination.
>
> - PP
I have a enhancement for dub in my mind, which would also solve
your issue. Similiar to setup.py in python you would be able to
define an entry point in dub.json.
"entryPoints": {"foo":"subPackageName"}
Command `dub install mypackage` would create a batch file/bash
script with name foo containing the command `dub run
mypackage:subPackageName -- %*`.
Unfortunately I do not have any time to work on this.
Kind regards
Andre
More information about the Digitalmars-d-learn
mailing list