<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 13, 2016 at 3:41 AM, Puming via Digitalmars-d-announce <span dir="ltr"><<a href="mailto:digitalmars-d-announce@puremagic.com" target="_blank">digitalmars-d-announce@puremagic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><div class="h5">On Tuesday, 12 April 2016 at 07:17:05 UTC, Jon D wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
On Tuesday, 12 April 2016 at 06:22:55 UTC, Puming wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
On Tuesday, 12 April 2016 at 00:50:24 UTC, Jon D wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Hi all,<br>
<br>
I've open sourced a set of command line utilities for manipulating tab-separated value files. They are complementary to traditional unix tools like cut, grep, etc. They're useful for manipulating large data files. I use them when prepping files for R and similar tools. These tools were part of my 'explore D' programming exercises.<br>
<br>
[...]<br>
</blockquote>
<br>
Interesting, I have large csv files, and this lib will be useful.<br>
Can you put it onto <a href="http://code.dlang.org" rel="noreferrer" target="_blank">code.dlang.org</a> so that we could use it with dub?<br>
</blockquote>
<br>
I'd certainly like to make it available via dub, but I wasn't sure how to set it up. There are two issues. One is that the package builds multiple executables, which dub doesn't seem to support easily. More problematic is that quite a bit of the test suite is run against the executables, which I could automate using make, but didn't see how to do it with dub.<br>
<br>
If there are suggestions for setting this up in dub that'd be great. An example project doing something similar would be really helpful.<br>
<br>
--Jon<br>
</blockquote>
<br></div></div>
Here is what I know of it, using subPackages:<br>
<br>
Say you have a project named myapp, and you need three executables, app1, app2, app3, they all depend on a common code base, which you name it common.<br>
<br>
Using dub, you can have a parent project myapp, that does nothing but is a container of the three apps and their common code.<br>
<br>
dub.sdl in myapp dir:<br>
<br>
```<br>
name "myapp"<br>
<br>
dependency ":common" version="*"<br>
subPackage "./common/"<br>
<br>
dependency ":app1" version="*"<br>
subPackage "./app1/"<br>
<br>
dependency ":app2" version="*"<br>
subPackage "./app2/"<br>
<br>
dependency ":app3" version="*"<br>
subPackage "./app3/"<br>
```<br>
<br>
the comma in dependency name ":common" is equal to "myapp:common"<br>
<br>
now use `dub init common` and the like to create subdirectories.<br>
<br>
change dub.sdl in the subdirectory common so that it becomes a library type:<br>
<br>
```<br>
name "common"<br>
<br>
targetType "library"<br>
<br>
```<br>
<br>
change dub.sdl in myapp* subdirectories to depend on common:<br>
<br>
```<br>
name "app1"<br>
targetType "executable"<br>
<br>
dependency "myapp:common" version="*"<br>
```<br>
<br>
note here you need to add root project name "myapp:common".<br>
<br>
Then you should register your whole project into the local dub repo, so that subpackages can find its dependencies when building:<br>
<br>
in the project root directory:<br>
<br>
dub add-local .<br>
<br>
Now you can build each executable with:<br>
<br>
dub build :app1<br>
dub build :app2<br>
dub build :app3<br>
<br>
Unfortunately dub does not build all sub packages at once when you dub in the root directory.<br>
<br>
But I think there might be a better way to handle multiple executables?<br>
<br>
<br>
</blockquote></div><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Just tried your suggestion and it works. I just added the below to the parent project to get the apps build:</div><div class="gmail_extra"><div class="gmail_extra"><div class="gmail_extra">void main() {</div><div class="gmail_extra"><span class="" style="white-space:pre">     </span>import std.process : executeShell;</div><div class="gmail_extra"><span class="" style="white-space:pre">   </span>executeShell(`dub build :app1`);</div><div class="gmail_extra"><span class="" style="white-space:pre">     </span>executeShell(`dub build :app2`);</div><div class="gmail_extra"><span class="" style="white-space:pre">     </span>executeShell(`dub build :app3`);</div><div class="gmail_extra">}</div><div><br></div><div><br></div><div><br></div></div></div><div class="gmail_extra"><br></div></div>