digitalmars.D.learn - using dub to compile plugins
- Codifies (17/17) Dec 19 2018 I am currently using this dub.sdl
- Codifies (2/2) Dec 19 2018 oh forgot to add just for extra pain.... while the main
- Andre Pany (6/23) Dec 19 2018 You can use dub sub packages. Each plugin will be a dub package
- Codifies (3/10) Dec 19 2018 how could I have multiple dub files in the same directory for
- Andre Pany (8/21) Dec 19 2018 You have sub folders in which you create the dub.sdl files. In
- Codifies (4/27) Dec 19 2018 I was planning to have all the plugin sources in one directory
- Neia Neutuladh (4/6) Dec 19 2018 If you need dub, you can create a wrapper script that generates the dub
- Atila Neves (9/29) Dec 21 2018 Unless the plugins have dub dependencies, don't use dub for it.
- Neia Neutuladh (4/8) Dec 21 2018 Or you could have it depend on dub.sdl, dub.selections.json, your D sour...
I am currently using this dub.sdl name "runz80" targetType "executable" lflags "libz80/libz80.a" however I will be creating a number of plugins, each plugin will consist of a single source file, I'd like the plugin source directory to be separate from main source directory and compile the plugins (.so) to a (binary) plugins directory (the plugins will be dynamically loaded at runtime - I've previously done this in C so I don't anticipate any particular issues - famous last words!) I could do this with a few simple rules in a Makefile, but I have no clue how to achieve this using dub. can someone show me a concrete example of doing this ? Ideally just dropping a new source file into the plugins source folder should produce a new .so the next time dub is run, without having to explicitly add each plugin to the dub file...
Dec 19 2018
oh forgot to add just for extra pain.... while the main application won't need gtk, most of the plugins will...
Dec 19 2018
On Wednesday, 19 December 2018 at 12:57:14 UTC, Codifies wrote:I am currently using this dub.sdl name "runz80" targetType "executable" lflags "libz80/libz80.a" however I will be creating a number of plugins, each plugin will consist of a single source file, I'd like the plugin source directory to be separate from main source directory and compile the plugins (.so) to a (binary) plugins directory (the plugins will be dynamically loaded at runtime - I've previously done this in C so I don't anticipate any particular issues - famous last words!) I could do this with a few simple rules in a Makefile, but I have no clue how to achieve this using dub. can someone show me a concrete example of doing this ? Ideally just dropping a new source file into the plugins source folder should produce a new .so the next time dub is run, without having to explicitly add each plugin to the dub file...You can use dub sub packages. Each plugin will be a dub package with its own dub descriptor (sdl) file. For your main dub sdl you set targetType to None. Kind regards Andre
Dec 19 2018
On Wednesday, 19 December 2018 at 13:14:20 UTC, Andre Pany wrote:On Wednesday, 19 December 2018 at 12:57:14 UTC, Codifies wrote:how could I have multiple dub files in the same directory for each plugin ???[...]You can use dub sub packages. Each plugin will be a dub package with its own dub descriptor (sdl) file. For your main dub sdl you set targetType to None. Kind regards Andre
Dec 19 2018
On Wednesday, 19 December 2018 at 14:08:10 UTC, Codifies wrote:On Wednesday, 19 December 2018 at 13:14:20 UTC, Andre Pany wrote:You have sub folders in which you create the dub.sdl files. In your main dub.sdl you include these folders as sub packages. Regarding the automatic logic you ideally want to have: there is the plan to add dub extension plugins. Unfortunately a hero is needed to implement it. Kind regards AndreOn Wednesday, 19 December 2018 at 12:57:14 UTC, Codifies wrote:how could I have multiple dub files in the same directory for each plugin ???[...]You can use dub sub packages. Each plugin will be a dub package with its own dub descriptor (sdl) file. For your main dub sdl you set targetType to None. Kind regards Andre
Dec 19 2018
On Wednesday, 19 December 2018 at 16:31:57 UTC, Andre Pany wrote:On Wednesday, 19 December 2018 at 14:08:10 UTC, Codifies wrote:I was planning to have all the plugin sources in one directory otherwise I'd have loads of folders all over the place... I think Make is the way forward!On Wednesday, 19 December 2018 at 13:14:20 UTC, Andre Pany wrote:You have sub folders in which you create the dub.sdl files. In your main dub.sdl you include these folders as sub packages. Regarding the automatic logic you ideally want to have: there is the plan to add dub extension plugins. Unfortunately a hero is needed to implement it. Kind regards AndreOn Wednesday, 19 December 2018 at 12:57:14 UTC, Codifies wrote:how could I have multiple dub files in the same directory for each plugin ???[...]You can use dub sub packages. Each plugin will be a dub package with its own dub descriptor (sdl) file. For your main dub sdl you set targetType to None. Kind regards Andre
Dec 19 2018
On Wed, 19 Dec 2018 12:57:14 +0000, Codifies wrote:I could do this with a few simple rules in a Makefile, but I have no clue how to achieve this using dub.If you need dub, you can create a wrapper script that generates the dub file for the plugins directory. Make is a lot better for this kind of thing.
Dec 19 2018
On Wednesday, 19 December 2018 at 12:57:14 UTC, Codifies wrote:I am currently using this dub.sdl name "runz80" targetType "executable" lflags "libz80/libz80.a" however I will be creating a number of plugins, each plugin will consist of a single source file, I'd like the plugin source directory to be separate from main source directory and compile the plugins (.so) to a (binary) plugins directory (the plugins will be dynamically loaded at runtime - I've previously done this in C so I don't anticipate any particular issues - famous last words!) I could do this with a few simple rules in a Makefile, but I have no clue how to achieve this using dub. can someone show me a concrete example of doing this ? Ideally just dropping a new source file into the plugins source folder should produce a new .so the next time dub is run, without having to explicitly add each plugin to the dub file...Unless the plugins have dub dependencies, don't use dub for it. Plugins that do can have their own dub.sdl/json with targetType "dynamicLibrary".Ideally just dropping a new source file into the plugins source folder should produce a new .so the next time dub is run, without having to explicitly add each plugin to the dub file...I don't see how you can do this with dub, and I wouldn't attempt it either. Just use make, and have make call dub for the main project (and potentially any plugins that need it). Remember to make the dub targets `.PHONY` since you don't want to be managing the D dependencies by hand.
Dec 21 2018
On Fri, 21 Dec 2018 10:56:39 +0000, Atila Neves wrote:I don't see how you can do this with dub, and I wouldn't attempt it either. Just use make, and have make call dub for the main project (and potentially any plugins that need it). Remember to make the dub targets `.PHONY` since you don't want to be managing the D dependencies by hand.Or you could have it depend on dub.sdl, dub.selections.json, your D source files, and your string import files. Which is a bit more work but will result in a little less recompilation.
Dec 21 2018