Building subprojects (Re: envy for "Writing Go Packages")

Graham Fawcett fawcett at uwindsor.ca
Sat May 15 21:13:34 PDT 2010


Hi Philippe,

On Sat, 15 May 2010 23:03:54 +0200, Philippe Sigaud wrote:

> On Sat, May 15, 2010 at 18:27, Graham Fawcett <fawcett at uwindsor.ca>
> wrote:
> 
>> On a side note, I've found that dranges, dstats and dcrypt (all from
>> dsource.org) all work with a little bit of shoehorning (though I had to
>> patch dcrypt to get it to compile under the latest D2: see
>> http://github.com/gmfawcett/d-build/blob/dcrypt-play/DEPS). I would
>> really like to hear of any other online D2 libraries that appear to
>> work (and as importantly, ones that you'd like to work but don't).
>>
> Out of cursiosity, what kind of shoehorning for dranges? I see that you
> move the trunk inside a dranges directory. 

Yes, that was all I had to do for dranges.

> I admit putting the modules in trunk as that's what many other
> projects do. Would you prefer the files to be in .trunk/dranges/ or
> even directly in ./dranges/ ?

'trunk/dranges' would be fine -- keeping 'trunk' makes good sense for
a Subversion project. For my purposes, any depth is okay, e.g.
'trunk/src/lang/d2/dranges' would also work. The key is that modules
which belong to the 'dranges' package should exist in a 'dranges'
directory.

What I'm doing is adding the parent of the 'dranges' directory to
dmd's include-path. Then I just let DMD look up the module files using
its own conventions (e.g. DMD expects that a module named foo.bar.baz
will be defined in a file named foo/bar/baz.d). That's why I renamed
trunk to dranges: it was the easiest way to honour the DMD naming
convention.

Best,
Graham


More information about the Digitalmars-d mailing list