I have an Ant task that creates an HTML report. Is it possible to load that report automatically in a browser from the Ant task? If so, is it possible to do so in a user-independent way or would it require the use of custom user properties?
Thanks,
Paul
How I did it:
In my build.properties
In my build.xml
Basing this on Gabor's answer I had to do a few more things to get it to work. Here's my code:
I had to append the project name to the directory and replace the spaces with "%20". After that it worked fine.
I used
<script>
with javascript:I need a solution that is platform independent, so based upon "1.21 gigawatts" answer:
This can be called in ant with:
This opens the given HTML file in the system-default browser using only pure Ant.
There is an independent way, like we do in java:
I see no exit without ant optional tasks. From all the scripts beanshell looks most lightweight and does not require any new knowledge. So I did it this way:
And this is an answer about getting
script
task running. Howeverjavascript
language is indeed a better option, as it needs noclasspath
(and nomanager
) in JDK 6. And the code inside remains the same.