www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - I just want a dub subpackage to refer to the parent package

reply Pillager86 <ismail.ax.2011 gmail.com> writes:
I did add-local on the main package yet the subpackage can't find 
the import paths even though it compiled before. Why is this so 
difficult? It has to be structured like this. If you have a game 
engine, the logical thing to do is make a subpackage that 
implements the main function that tests it. Dub needs help.
May 01 2020
next sibling parent reply Pillager86 <ismail.ax.2011 gmail.com> writes:
On Friday, 1 May 2020 at 17:00:56 UTC, Pillager86 wrote:
 I did add-local on the main package yet the subpackage can't 
 find the import paths even though it compiled before. Why is 
 this so difficult? It has to be structured like this. If you 
 have a game engine, the logical thing to do is make a 
 subpackage that implements the main function that tests it. Dub 
 needs help.
Nevermind I fixed it. Still dub needs help.
May 01 2020
parent Dennis <dkorpel gmail.com> writes:
On Friday, 1 May 2020 at 17:13:37 UTC, Pillager86 wrote:
 Nevermind I fixed it.
What was the fix?
 Still dub needs help.
Yeah :(
May 01 2020
prev sibling parent reply Steven Schveighoffer <schveiguy gmail.com> writes:
On 5/1/20 1:00 PM, Pillager86 wrote:
 I did add-local on the main package yet the subpackage can't find the 
 import paths even though it compiled before. Why is this so difficult? 
 It has to be structured like this. If you have a game engine, the 
 logical thing to do is make a subpackage that implements the main 
 function that tests it. Dub needs help.
I went through something similar to this recently. I used vibe.d's dub recipes as a guide. What you want to do is this in your main package file: "subPackages" : [ "package1", "package2", ... ] Then in e.g. package1 recipe file: "dependencies" : { "mainPackage" : { "path" : ".." }, "mainPackage:package2" : { "path" : ".." } } That second one is what really threw me for a loop. You use the path to the main package, but then name the subpackage you are depending on. -Steve
May 01 2020
parent Luis <luis.panadero gmail.com> writes:
On Friday, 1 May 2020 at 17:32:31 UTC, Steven Schveighoffer wrote:
 On 5/1/20 1:00 PM, Pillager86 wrote:
 I did add-local on the main package yet the subpackage can't 
 find the import paths even though it compiled before. Why is 
 this so difficult? It has to be structured like this. If you 
 have a game engine, the logical thing to do is make a 
 subpackage that implements the main function that tests it. 
 Dub needs help.
I went through something similar to this recently. I used vibe.d's dub recipes as a guide. What you want to do is this in your main package file: "subPackages" : [ "package1", "package2", ... ] Then in e.g. package1 recipe file: "dependencies" : { "mainPackage" : { "path" : ".." }, "mainPackage:package2" : { "path" : ".." } } That second one is what really threw me for a loop. You use the path to the main package, but then name the subpackage you are depending on. -Steve
Umm.... It's like what I did on Pegged to subpackage some examples. In particular, the grammar composition example have a dependency to the main package (Pegged) and to two other examples : "dependencies": { "pegged": { "version": "*", "path": "../.." }, "pegged:strings": { "version": "*", "path": "../.." }, "pegged:numbers": { "version": "*", "path": "../.." } }
May 01 2020