Thread overview
I just want a dub subpackage to refer to the parent package
May 01, 2020
Pillager86
May 01, 2020
Pillager86
May 01, 2020
Dennis
May 01, 2020
Luis
May 01, 2020
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
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
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
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
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": "../.."
    }
  }