kOS/compile.ks

35 lines
743 B
Plaintext

// Intended to be run from volume 0 for checking compiled sizes.
switch to 0.
compileHere().
function compileDir {
parameter dir.
print "Entering '" + dir + "'.".
cd(dir).
compileHere().
cd("..").
print "Leaving '" + dir + "'.".
}
function compileHere {
local fileList is list().
list files in fileList.
for f in fileList {
if f:ISFILE {
if f:EXTENSION = "ks" {
print "Compiling '" + f:NAME + "'.".
compile f.
}
} else if f:NAME[0] <> "." {
compileDir(f).
}
}
}
// TODO: might be neat to actually do a filesize comparison and print a report or something,
// specifically iterating files NOT to compile.
// TODO: We could hypothetically even integrate this with the bootstrapper.