Changeset 845

Show
Ignore:
Timestamp:
12/01/07 00:06:03 (10 months ago)
Author:
Gregor
Message:

sss/build.d, sss/conf.d, docs/README.software_engineers, test/bin/dsss.conf, test/bin/bin.d: Auxiliary builds of binaries are now allowed with names e.g.

[main.d+feature] (see ticket #153).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/docs/ChangeLog

    r844 r845  
    1010        - DSSS will no longer try to build if no config file is specified and 
    1111          no file are specified on the command line. 
     12        - Auxiliary builds of binaries are now allowed with names e.g. 
     13          [main.d+feature] (see ticket #153). 
    1214 
    13150.73 from 0.72: 
  • trunk/docs/README.software_engineers

    r811 r845  
    123123target=example_binary 
    124124 
     125A single source file can be used to build multiple binaries, but they must be 
     126given different section names. To allow this, section names may have a '+' 
     127character, then any descriptive name appended. For example: 
     128[example.d+withfeature] 
     129target=example_binary_withfeature 
     130buildflags=-version=withfeature 
     131 
    125132Windows users: Be careful not to set the target of a binary build to the name of 
    126133a directory. This will work on Windows because it gains the .exe suffix, but 
  • trunk/sss/build.d

    r800 r845  
    326326         
    327327        // basic info 
     328        char[] bfile = build; 
    328329        char[] type = settings["type"]; 
    329330        char[] target = settings["target"]; 
     331        int bfileplus = std.string.find(bfile, '+'); 
     332        if (bfileplus != -1) { 
     333            bfile = bfile[0..bfileplus]; 
     334        } 
    330335         
    331336        if (type == "binary") { 
     
    350355             
    351356            // output what we're building 
    352             writefln("%s => %s", build, target); 
     357            writefln("%s => %s", bfile, target); 
    353358 
    354359            // prepare for documentation 
     
    362367             
    363368            // build a build line 
    364             char[] ext = std.string.tolower(getExt(build)); 
     369            char[] ext = std.string.tolower(getExt(bfile)); 
    365370            if (ext == "d") { 
    366                 bbl ~= build ~ " -of" ~ target ~ " "; 
     371                bbl ~= bfile ~ " -of" ~ target ~ " "; 
    367372            } else if (ext == "brf") { 
    368                 bbl ~= "@" ~ getName(build) ~ " "; 
     373                bbl ~= "@" ~ getName(bfile) ~ " "; 
    369374            } else { 
    370375                writefln("ERROR: I don't know how to build something with extension %s", ext); 
  • trunk/sss/conf.d

    r844 r845  
    588588                conf.settings[section]["type"] = "special"; 
    589589                conf.settings[section]["target"] = section[1..$]; 
     590 
     591            } else if (find(section, '+') != -1) { 
     592                int ploc = find(section, '+'); // FIXME 
     593                // auxiliary section 
     594                conf.sections ~= section; 
     595                conf.settings[section]["type"] = "binary"; 
     596                conf.settings[section]["target"] = section[1..$]; 
    590597                 
    591598            } else if (!exists(section)) { 
  • trunk/test/bin/bin.d

    r801 r845  
     1module bin; 
     2 
    13import lib.foo; 
    24 
    35int main() 
    46{ 
    5     return lib.foo.bar(); 
     7    version (stupid) { 
     8        return 0; 
     9    } else { 
     10        return lib.foo.bar(); 
     11    } 
    612} 
  • trunk/test/bin/dsss.conf

    r801 r845  
    22 
    33[bin.d] 
     4 
     5[bin.d+stupid] 
     6target=stupid 
     7buildflags=-version=stupid