Re: build a subpackage in dub?

2016-07-18 Thread drug via Digitalmars-d-learn

16.07.2016 20:26, cy пишет:

Say I have a package called "main" and a sub-package in a
"complicatedexample" directory, and my dub.json in "main" looks sort of
like:

"subPackages": [
  "./complicatedexample/"
],

Let's say I do *not* have ":complicatedexample" in my dependencies for
"main", but "complicatedexample" itself imports from /other/
sub-packages in main, like I dunno, "support" "coolstuff" "thingies" or
whatever.

I can't chdir to complicatedexample and dub -v build, because it says
"Unknown dependency: complicatedexample:support" since it can't know
that it's in a subpackage. But I also can't build ":complicatedexample"
from in the main directory, because "dub build -v :complicatedexample"
gives me "Failed to find a package named main:complicatedexample".

I swear I figured out how to do this before, but I honestly cannot
remember. The example imports a huge C library and compiles stubs and
does all sorts of stupid stuff that the rest of the program doesn't have
anything to do with at all, just to demonstrate the algorithm. But I
don't know how to isolate it. Any ideas?

Just... create a totally separate package, and remember to copy and
paste all the other sub-packages to it, and add all the other
subpackages to every dub.json manually?
If you could list example of your package dub.json it would be better. I 
use subpackages intensively, subpackages depends on other subpackages 
and it works, but I'm not sure I understand your case.


build a subpackage in dub?

2016-07-16 Thread cy via Digitalmars-d-learn
Say I have a package called "main" and a sub-package in a 
"complicatedexample" directory, and my dub.json in "main" looks 
sort of like:


"subPackages": [
  "./complicatedexample/"
],

Let's say I do *not* have ":complicatedexample" in my 
dependencies for "main", but "complicatedexample" itself imports 
from /other/ sub-packages in main, like I dunno, "support" 
"coolstuff" "thingies" or whatever.


I can't chdir to complicatedexample and dub -v build, because it 
says "Unknown dependency: complicatedexample:support" since it 
can't know that it's in a subpackage. But I also can't build 
":complicatedexample" from in the main directory, because "dub 
build -v :complicatedexample" gives me "Failed to find a package 
named main:complicatedexample".


I swear I figured out how to do this before, but I honestly 
cannot remember. The example imports a huge C library and 
compiles stubs and does all sorts of stupid stuff that the rest 
of the program doesn't have anything to do with at all, just to 
demonstrate the algorithm. But I don't know how to isolate it. 
Any ideas?


Just... create a totally separate package, and remember to copy 
and paste all the other sub-packages to it, and add all the other 
subpackages to every dub.json manually?