Am 21.02.2014 09:31, schrieb simendsjo:
I'm having problems understanding how to create multiple packages.
Running dub master.Here I have a project
awhich creates a binary, and I have projectbthat relies on that binary.
When buildingb, it states "no source files". I'm guessing it refers toa. Is this a bug..? Or what is happening here?And if I look at
a,dub buildhas not been run. Doesn't dependencies in dub build the packages?Also.. How can I refer to the location of the package
a? I know it produces a binary (well, hopefully once I sort this out), and I wish to copy this binary to my project. I see thepreBuildCommandsand$PACKAGE_DIR, but how can I get the$PACKAGE_DIRofa? The best thing would be if I could reference thetargetNameofadirectly, so mypreBuildCommandscould copy$(TARGET_NAME a)tobs directory. After all,ais a dependency ofb, andahas atargetTypeto create an executable.Any tips on how this should be structured?
In
b/dub.jsonbelow (thee dub.jsonline), I added"a" : "~master"as a dependency.➜ test dub init a Successfully created an empty project in '/home/simendsjo/code/d/dtutorials/test/a'. ➜ test dub init b Successfully created an empty project in '/home/simendsjo/code/d/dtutorials/test/b'. ➜ test cd b ➜ b e dub.json ➜ b dub add-local ../a "~master" Registered package: a (version: ~master) ➜ b dub build Package a contains no source files. Please add {"targetType": "none"} to it's package description to avoid building it. b: ["b", "a"] Building b configuration "application", build type debug. Compiling... Linking... ➜ b ./b Edit source/app.d to start your project. ➜ b
Executable dependencies are not yet properly supported. It's planned to
allow this by specifying the proper sub configuration (i.e. "subConfigurations": {"a": "application"}, though. The best workaround
for now is to add a "preGenerateCommand" or "preBuildCommand" that
executes dub run a -- <args>.