kOS/compile.ks

35 lines
743 B
Plaintext
Raw Normal View History

2021-07-23 21:50:11 +00:00
// Intended to be run from volume 0 for checking compiled sizes.
2021-08-01 05:23:39 +00:00
switch to 0.
compileHere().
function compileDir {
parameter dir.
print "Entering '" + dir + "'.".
cd(dir).
2021-08-01 05:23:39 +00:00
compileHere().
cd("..").
print "Leaving '" + dir + "'.".
2021-08-01 05:23:39 +00:00
}
function compileHere {
local fileList is list().
list files in fileList.
for f in fileList {
2021-08-02 01:31:39 +00:00
if f:ISFILE {
if f:EXTENSION = "ks" {
print "Compiling '" + f:NAME + "'.".
compile f.
}
} else if f:NAME[0] <> "." {
2021-08-01 05:23:39 +00:00
compileDir(f).
}
2021-07-23 21:50:11 +00:00
}
2021-08-01 05:23:39 +00:00
}
2021-07-23 21:50:11 +00:00
// 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.