[quote]If you want an “all” function that builds 3 jar files you can to it this way (I skipped definition of file?.jar functions):
file1.jar: …
file2.jar: …
file3.jar: …
all: [ file1.jar, file2.jar, file3.jar ];
running “smooth build all” will create result that is a dir with all 3 files inside. This way script describes exactly your intentions: You want function (“all”) that builds 3 files, each file is built by specified function.
[/quote]
Hmm, Okay it sort of works with using the array, making a folder, although I’m not sure I like that way. I want a build all so it just builds everything, but this way it wont update the same files as running each individually, instead it makes the “all” directory with the outputs. All the outputs are also just numbers, a directory with 0, 1, 2, etc., I’m assuming its their index in the array.
A similar issue with the “build all” though, if I want to have instead a “build release.zip”, which compiles everything, creates the jars, and packages everything into the zip, it wouldn’t work, as everything inside would be named numbers, and I’m not so sure I could make directories inside. Here’s an example of what I would like to do:
all:
game.jar & util.jar ;
release.zip:
[ bin, file("levels"), file("config.cfg") ] | zip ;
bin:
[ game.jar, util.jar ] | concatenateFiles(with=files("game/lib")) ;
game.jar:
game.classes | concatenateFiles(with=files("game/res")) | jar ;
game.classes:
files("game/src") | javac(libs=files("game/lib") ;
util.jar:
util.classes | concatenateFiles(with=files("util/res")) | jar ;
util.classes:
files("util/src") | javac(libs=files("util/lib")) ;
This would, ideally, make a zip file with 2 directories(“bin” and “levels”), and the default “config.cfg”. The “&” idea was just that it would create both of them in the results directory, kind of a break for the builder I guess, drop what’s before it into results, and move on.
Also, random small suggestion, is there anyway you can make the functions smarter, so they don’t need the parameter name to work? Maybe have the pipe always be the first argument of its type?