reading content from a jar from inside an Ant Javascript script task
Here's another handy little snippet for reading the content from a jar file while inside a javascript Ant <script> tag (in this example, reading the property file that is inside the ant-contrib jar@/net/sf/antcontrib/antcontrib.properties):
<![CDATA[
importPackage(Packages.java.io);
var antprops = project.getClass().getResource('/net/sf/antcontrib/antcontrib.properties');
var inis = antprops.openStream();
var br = new BufferedReader(new InputStreamReader(inis));
while (null != (line = br.readLine())) {
print(line);
}
]]>
</script>
