digitalmars.D.learn - dub run subPackage by default
- ParticlePeter (11/11) Sep 01 2020 Hello,
- Andre Pany (11/23) Sep 01 2020 I have a enhancement for dub in my mind, which would also solve
- ParticlePeter (9/21) Sep 01 2020 So, I take it that such a feature does not exist already.
- Andre Pany (6/31) Sep 01 2020 The idea is, you add the folder containing the bash / batch files
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
Sep 01 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. - PPI 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
Sep 01 2020
On Tuesday, 1 September 2020 at 14:45:43 UTC, Andre Pany wrote:On Tuesday, 1 September 2020 at 11:45:34 UTC, ParticlePeter wrote:[snip]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 AndreSo, I take it that such a feature does not exist already. Your suggestion sounds nice, but why do you think it would be necessary to go through a batch file or script? I think it should be possible from within dub, to feed the chosen compiler backend with the proper commands to either build or run the appropriate entryPoint. - PP
Sep 01 2020
On Tuesday, 1 September 2020 at 19:38:39 UTC, ParticlePeter wrote:On Tuesday, 1 September 2020 at 14:45:43 UTC, Andre Pany wrote:The idea is, you add the folder containing the bash / batch files to your PATH environment variable. By executing e.g. `dub install dscanner` you can now execute in your shell/terminal `dscanner`. Kind regards AndreOn Tuesday, 1 September 2020 at 11:45:34 UTC, ParticlePeter wrote:[snip]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 AndreSo, I take it that such a feature does not exist already. Your suggestion sounds nice, but why do you think it would be necessary to go through a batch file or script? I think it should be possible from within dub, to feed the chosen compiler backend with the proper commands to either build or run the appropriate entryPoint. - PP
Sep 01 2020