/*globals desc, task, taskSync, file, directory, fileSync, FileList, CLOBBER, CLEAN, write, read, log */
var Path = require("path"),
    authorInfo,
    buildStart,
    buildComplete
;

desc("Keep the LICENSE file up-to-date.");
taskSync("LICENSE", ["read-authors"], function (t) {
    var year = new Date().getFullYear(),
        license = read(t.name, "utf8").split("\n")
    ;
    
    license[0] = "Copyright (c) " + year + " " + authorInfo;
    
    write(t.name, license.join("\n"), "utf8");
    log(t.name + " updated");
});

taskSync("read-authors", ["AUTHORS"], function (t) {
    authorInfo = read(t.prerequisites[0], "utf8").split("\n")[0];
    log("Read author info");
});

taskSync("pre-build", function (t) {
    buildStart = Date.now();
    log("Starting build...");
});

taskSync("build", ["pre-build", "LICENSE"], function (t) {
    var delta;
    
    buildComplete = Date.now();
    delta = buildComplete - buildStart;
    
    log("Build complete");
    log(delta + " ms");
});

taskSync("default", ["build"]);
@@ -107,16 +107,23 @@
 ar Path 
+       
 = requir
@@ -141,54 +141,256 @@
     
-authorInfo,%0A    buildStart,%0A    buildComplete%0A
+buildStart  = new Date(),%0A    authorInfo  = read(%22AUTHORS%22, %22utf8%22).split(%22%5Cn%22)%5B0%5D,%0A    readMeFiles = new FileList(),%0A    buildComplete%0A;%0A%0A/**%0A * Defines the CLEAN file-list and the 'clean' task%0A */%0Arequire(%22sake/clean%22);%0ACLEAN.include(%22README.md%22)
 ;%0A%0Ad
@@ -431,20 +431,20 @@
 ate.%22);%0A
-task
+file
 Sync(%22LI
@@ -453,28 +453,23 @@
 NSE%22, %5B%22
-read-authors
+AUTHORS
 %22%5D, func
@@ -744,244 +744,76 @@
 nc(%22
+p
 re
-ad-authors%22, %5B%22AUTHORS%22%5D, function (t) %7B%0A    authorInfo = read(t.prerequisites%5B0%5D, %22utf8%22).split(%22%5Cn%22)%5B0%5D;%0A    log(%22Read author info%22);%0A%7D);%0A%0AtaskSync(%22pre-build%22, function (t) %7B%0A    buildStart = Date.now();%0A    log(%22Starting build...%22
+-build%22, function (t) %7B%0A    log(%22Starting build at %22 + buildStart
 );%0A%7D
@@ -850,19 +850,8 @@
 ild%22
-, %22LICENSE%22
 %5D, f
@@ -908,16 +908,16 @@
 e = 
+new 
 Date
-.now
 ();%0A
@@ -941,16 +941,26 @@
 Complete
+.getTime()
  - build
@@ -964,16 +964,26 @@
 ildStart
+.getTime()
 ;%0A    %0A 
@@ -1004,17 +1004,37 @@
 complete
-%22
+ at %22 + buildComplete
 );%0A    l
@@ -1057,24 +1057,280 @@
 );%0A%7D);%0A%0A
+readMeFiles.include(%0A    %22README.tmpl%22, %22package.json%22, %22lib/node_modules/sake/options.js%22,%0A    %22LICENSE%22, %22AUTHORS%22, %22Sakefile.*%22%0A);%0A%0AfileSync(%22README.md%22, readMeFiles, function (t) %7B%0A    log(%22Update %22 + t.name);%0A%7D);%0A%0Atask(%22build%22, %5B%22LICENSE%22, %22README.md%22%5D);%0A
 task
-Sync
 (%22defaul

Update build.