ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "M. Z." <communitysubscript...@yahoo.com>
Subject Problem with parsing ant script from URL
Date Fri, 19 Aug 2005 10:31:55 GMT
Hi all,

Does anybody know how to parse ant script from URL
instead of File?

What I need to do is as below:

1. I have a .jar file which contains my class file,
the ant script, and some other dirs/files.

2. As I need to call ant tasks in the java class, I'll
have to parse the ant script. However, as the script
is in .jar, I think I'll have to specify the URL
instead of File object. (Please correct me if it isn't
necessary.)

My jar contains something like this:
...
MyTest.class
Test/
Test/build.xml
Test/file
...

My MyTest.java has these lines:
...
Project project = new Project();
project.init();
URL
url=this.getClass().getClassLoader().getResource("Test/build.xml");
ProjectHelper.getProjectHelper().parse(project,url);
...

Before I packaged files in jar,everything was fine if
I use File object. But now, exception occurs at
parse().

Can anybody give any advice?

Thanks,
Amy


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message