DS3

David B. Held dheld at codelogicconsulting.com
Mon Aug 27 09:13:01 PDT 2007


torhu wrote:
> [...]
> If you just want to build an app, you can just do 'rebuild myapp', 
> rebuild works the same way as bud does.  It will then parse a file 
> called myapp.d, and compile and link everything by looking at the import 
> statements to find the other files needed.  The output will be 
> 'myapp.exe'.  Can't get much easier.  Additional compiler arguments, 
> libs, etc. can be added to rebuild's command line unaltered.
> [...]

Well, I haven't used rebuild or bud either. ;)  This still doesn't work 
for my app, because I'm not actually building an app...I'm building a 
library with unit tests.  So I have a main(), but it doesn't do anything 
interesting, and I don't need to import any modules from the library, 
because I normally just add those in by hand.  Since unit tests are 
global functions that get called magically, you can have a disjoint 
import lattice that might be confusing rebuild.  Here is a sample that 
will confuse dsss:

main.d:
module main;
void main() { }

lib.d:
module lib;
import std.stdio;
unittest
{
     writefln("Hello, world!");
}

Now, tell me what you expect to happen when you do 'dsss build 
-unittest', and tell me what does happen.

Dave

P.S.  Normally, I would just do 'dmd main lib -unittest', and it would 
just work (well, it *does* work).  I was hoping dsss was this easy, but 
I think I found a corner case.



More information about the Digitalmars-d mailing list