Wednesday, August 26, 2009

Accessing system properties from Ant build file

I need to do some tasks via shell scripts. Among those tasks are also ant scripts. Sometimes I need to pass some arguments to ant script from shell scripts. I've found that this can be done through java system properties. Those properties are easily accessed from ant build file - just like properties declared in build file itself: ${property.name}
Here is a brief example. The build file cool-build.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project name="FunProject" default="work" basedir=".">
<target name="work">
<echo message="my.cool.property=${my.cool.property}">
</target>
</project>

We, run it with passed system property my.cool.property:
ant -f cool-build.xml -Dmy.cool.property=1
And the result is:
[echo] my.cool.property=1
Just as expected :)

Java browser

NetBeans 6.8 M1 was released a few days ago. And it came with its own embedded browser! The browser looks good. Really good. Of cause there are some problems: crashes, hangs, no flash support. I also did not managed to login to my gmail account with it :) But hey, it's just the initial release, so we can't be very demanding.
It's worth notion that the browser is based on Mozilla XULRunner. Which means that it is not related with mysterious JWebPane (based on WebKit). So, it looks like Sun is forging two java browsers. Wow!