I’ve been meaning to make my Java build system stuff available for other to use for a long time. This plus a recent forum discussion plus my trying to re-sign/pack/LZMA LWJGL applet stuff led me to finally clean it up. I have tentatively named it “Scar”, which is not only bad ass sounding, but reminds me of what ant/maven/etc has done to my soul. I’ve documented the project, but not yet written complete javadocs. I don’t yet have hosting (waiting on Google Code to let me use the name), but here is the documentation and a download link:
http://n4te.com/temp/scar.html
I’d love to hear what you guys think! Don’t hold back.
There isn’t a whole lot to it, but if you are going to write your build system in Java anyway, Scar should minimize the amount of work you need to do. Writing the build in Java has a lot of advantages, such as simplicity, developer familiarity, and the ability to fully debug the build in an IDE. If writing your build in Java doesn’t appeal to you, it should be easy to leverage Scar using a different JVM language. Scar pretty much replaces ant completely. It doesn’t have artifact repositories or plenty of other stuff I’m sure is out there, but it seems like maybe that stuff could be tacked on, resulting in a simpler overall system.
Here’s one of the utility methods, showing off how much functionality is available without a whole lot of typing:
static public void signLwjglApplet (String dir, String keystoreFile, String alias, String password) throws IOException {
for (String jarFile : new Paths(dir, "*.jar")) {
sign(normalize(unsign(jarFile)), keystoreFile, alias, password);
if (fileExists(jarFile + ".lzma")) lzma(jarFile, jarFile + ".lzma");
}
for (String jarLzmaFile : new Paths(dir, "*.jar.lzma")) {
if (fileExists(substring(jarLzmaFile, 0, -5))) continue;
String jarFile = sign(normalize(unsign(unlzma(jarLzmaFile))), keystoreFile, alias, password);
lzma(jarFile, jarFile + ".lzma");
lzma(pack200(jarFile));
}
}
I need native launchers, so you can add the Scar directory to your path and run it by typing “scar”. Does anyone have a basic template for this? I should use BAT for Windows and SH for everything else?