On Thu, 29 May 2014 22:08:37 GMT, ponce wrote:

But inverse way was also one of the ideas - DUB would search for import statements and query the registry for matching packages. Additional comments or pragmas could be used for fine tuning (selecting specific version ranges).

A minor issue would be that import module name might not be the same with registered dub package name, adding another indirection.

But overall i think this approach is better.

  1. Is it sane to include a D parser into DUB?
  2. I don't really want all my source files to be parsed each time I build. With which parser?

No, I wouldn't want to include a full parser and it also wouldn't scan all files on each build, just a single file in case of script-like single file projects. Depending on the approach, it would simply search for a pattern like "/**DUB\n" and the following "*/", or it would invoke DMD with the -ignore -v switches to let it output any pragmas.