"Building tool" community feedback

2006-10-16 Thread Gilles Scokart

Everywhere i go, i see that there is a lot of people (like me) thinking that
the existing build tools are extremely useful (ant in first;-) ). But still,
a lot of people think that something else should be possible.

I have thus started a forum in order to collect info from the "builder
community": http://phoebus.tigris.org/servlets/ProjectForumView

If you want to share expertise, lesson learned or ideas, please join this
forum.

I hope the result of this discussion will be a better knowledge of the build
problems, and some ideas on how to solve them (with good practices,
enhancement of the existing tools or with some new tools).

Thanks,

Gilles Scokart


Re: Ant 1.7.0Beta3 released

2006-10-16 Thread Steve Loughran

Hans Schwaebli wrote:

Why does it take so long to finish the next version of Ant?


1. we go through a rigorous beta test phase as it is the best way of 
making sure you havent broken anything. Even so, we know that lots of 
people will not touch it until version 1.7.0 ships, and there will be a 
flurry of bugreps, usually related to odd system configurations



Because of the delay of the next Ant version, the next version of Cruise 
Control is delayed too.


2. That's a shame. I've been using Luntbuild and it binds quite nicely 
to Ant1.7



At least you should have released quickly a Ant version with built in support 
for JUnit 4.


Alternatively, "Junit4 should have been backwards compatilbe with the 
previous version. See point (1)



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Ant 1.7.0Beta3 released

2006-10-16 Thread James Abley

Steve Loughran wrote:

Hans Schwaebli wrote:

At least you should have released quickly a Ant version with built in 
support for JUnit 4.


Alternatively, "Junit4 should have been backwards compatilbe with the 
previous version. See point (1)




+1

To add another thing to consider, perhaps the  task should be an 
externally owned task, similarly to , rather than something 
that is part of ANT, even as an optional task. Then the JUnit4 guys, or 
whoever owns the accompanying task, would be responsible for providing 
an updated version.




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



James

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ant and classloading

2006-10-16 Thread Peter Reilly

On 10/16/06, Jacob Kjome <[EMAIL PROTECTED]> wrote:


I'm not sure this is 100% an Ant question, but it is within the context of Ant.

In my Ant task, I'm loading up a class using Class.forName() and pass
in a classloader that I would have expected to be assigned as the
classloader for the class.  That doesn't seem to be the case.  Here's
what I'm doing..


AntClassLoader customLoader = new
AntClassLoader(getClass().getClassLoader(), true);
customLoader.setClassPath(getResourcePath());

Class clazz = Class.forName(clazzName, true, customLoader);

System.out.println(customLoader.getResource("org/myorganization/resources/my.dtd"));
System.out.println(clazz.getClassLoader().getResource("org/myorganization/resources/my.dtd"));


The DTD resource is found in the first case using the custom
classloader where the user configured the resourcePath attribute of
the task, but in the second case when I use the classloader of the
class that I just loaded by passing in the custom classloader I just
get "null".  The point of this is that the class I am loading needs
to look up user-defined resources on the classpath.  With the
System.out lines, I am just testing what my loaded class needs to do
further down the line.

Shouldn't the classloader of the class I just loaded be a reference
to that which I passed into Class.forName()?


No, Java uses a delegated classloader model. Normally, classloaders
search up the hierarchy, starting at the base classloader to load
a  class. The reason for this is that classes are not the same unless
they are loaded from the same classloader. To take a simple case
one would want java.lang.Object to be the same no matter how
it is loaded.



This is probably more
of a general classloading question than an Ant question, but I'm
guessing others have had to deal with that here.  I must be making a
bad assumption, but it seems like something like this should be possible.

My only workaround right now is to add the extra classpath
information to the Task definition classpath.  However, that is not
intuitive for task users and a pretty ugly hack.  Is there any way to
do this?  I've run into and solved many classloading issues in the
past, but I've never had to deal with this specifically.  I have to
imagine someone has solved this problem already.  Care to share the solution?


Jake


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Ant 1.7.0Beta3 released

2006-10-16 Thread Steve Loughran

James Abley wrote:

Steve Loughran wrote:

Hans Schwaebli wrote:

At least you should have released quickly a Ant version with built in 
support for JUnit 4.


Alternatively, "Junit4 should have been backwards compatilbe with the 
previous version. See point (1)




+1

To add another thing to consider, perhaps the  task should be an 
externally owned task, similarly to , rather than something 
that is part of ANT, even as an optional task. Then the JUnit4 guys, or 
whoever owns the accompanying task, would be responsible for providing 
an updated version.




we had a skype teleconf with them on this topic a while back, and that's 
effectively what is going to happen. ant's  is constrained to be 
backwards compatible and run on Java1.2, 1.3+, whereas junit's own task 
would be able to be java5 only, and in perfect sync with junit releases. 
They would of course have to deal with changes across ant's versions.


However, the junit team lack the time and skills to do ant tasks. So it 
will come to us -ant users and developers to write (and possibly 
maintain) the task. We need to not only give it to them, we need to show 
them how to maintain it.


FYI, I have been doing some stuff with hosting junit tests under 
smartfrog, our deployment framework:


http://video.google.co.uk/videosearch?q=smartfrog
http://smartfrog.org/presentations/distributed_testing_with_smartfrog_slides.pdf

There we can run tests in one process, and feed the results to another 
by way of java RMI; I have a serialized representation of test results 
that I can feed to another process. Having something like that inside 
 would let us run the logging inside Ant, while the tests would 
be in their own process. I also have a different format for test 
results, one that streams out instead of buffers until the end.


I'd like the same stuff in a  task, ideally. In fact, ideally, 
I'd like the classes representing junit-results-on-the-wire to be in 
junit.jar, rather than my code.


-Steve

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



creating javadoc

2006-10-16 Thread RAMADOSS Padhmapriya
Hi,

 

I want to create a javadoc for 6 to 7 project.

Am able to create separately. I want these to be in the same index file.

 

Can any one give me solution for this.

 

Regards,

PriyaRamadoss.
Confidentiality Statement:

This message is intended only for the individual or entity to which it is 
addressed. It may contain privileged, confidential information which is exempt 
from disclosure under applicable laws. If you are not the intended recipient, 
please note that you are strictly prohibited from disseminating or distributing 
this information (other than to the intended recipient) or copying this 
information. If you have received this communication in error, please notify us 
immediately by return email.


AW: creating javadoc

2006-10-16 Thread Jan.Materne
mmmh   with multiple s pointing to their dirs?

Jan 

>-Ursprüngliche Nachricht-
>Von: RAMADOSS Padhmapriya [mailto:[EMAIL PROTECTED] 
>Gesendet: Montag, 16. Oktober 2006 11:01
>An: user@ant.apache.org
>Betreff: creating javadoc
>
>Hi,
>
> 
>
>I want to create a javadoc for 6 to 7 project.
>
>Am able to create separately. I want these to be in the same 
>index file.
>
> 
>
>Can any one give me solution for this.
>
> 
>
>Regards,
>
>PriyaRamadoss.
>Confidentiality Statement:
>
>This message is intended only for the individual or entity to 
>which it is addressed. It may contain privileged, confidential 
>information which is exempt from disclosure under applicable 
>laws. If you are not the intended recipient, please note that 
>you are strictly prohibited from disseminating or distributing 
>this information (other than to the intended recipient) or 
>copying this information. If you have received this 
>communication in error, please notify us immediately by return email.
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Ant 1.7.0Beta3 released

2006-10-16 Thread Steve Loughran

Prashant wrote:
Is there any reason why ANT 1.7 still distributes Xerces 2.6.2 in its 
lib [1] ? While the current release version of Xerces is 2.8 with 
support for DOM Level 3, Schema Validation, Not to mention the bug fixes.


As of 30 seconds ago, it distributes v 2.8.1. Version 2.6.2 does do XSD 
validation BTW, which is why Ant1.7 has a  task.




Last time i tried to compile code that uses the DOM Level 3 API, the 
xml-apis.jar in ant/lib got in the way and i had to use 
java.endorsed.dirs mechanism in ANT_OPTS.


Ah, joy, the java endorsed dirs mechanism. If that is causing a problem 
for you, then the version of xml-apis in ant/lib is moot; you need to 
get a better version into an endorsed directory.





-Prashant
[1]:http://svn.apache.org/viewvc/ant/core/trunk/lib/
PS: I have not downloaded the 1.7, i am not sure if the ANT downloads 
later versions of Xerces from repositories at build time.


Cant do that, because in the Maven repositories

-xml-apis is at 2.6.0
-xerces is at 2.8.1, and has a dependency on xml-apis 1.3.03.

We keep it under SCM, as it is the only thing needed at boot time. 
Historically it was also there because there was no bundled Java parser, 
and when one did come, it was only Crimson. But for the 1.5+ world, we 
could think about doing a no-parser distro. Not for 1.7, there will be 
too many surprises related to manifests. Something to think of.


-Steve

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Ant 1.7.0Beta3 released

2006-10-16 Thread Prashant


Steve Loughran wrote:

Prashant wrote:
Is there any reason why ANT 1.7 still distributes Xerces 2.6.2 in its 
lib [1] ? While the current release version of Xerces is 2.8 with 
support for DOM Level 3, Schema Validation, Not to mention the bug 
fixes.


As of 30 seconds ago, it distributes v 2.8.1. Version 2.6.2 does do 
XSD validation BTW, which is why Ant1.7 has a  task.


Ah, yes. I should have said JAXP 1.3 Schema Validation API. The thing 
thats returned by SchemaFactory.newSchema()[1]


But whats the reason to sticking to Xerces 2.6.2 ? Anything more than 
"Don't fix what not broken" ?


-Prashant
[1]:jaxp: Fast and Easy XML Processing 





Last time i tried to compile code that uses the DOM Level 3 API, the 
xml-apis.jar in ant/lib got in the way and i had to use 
java.endorsed.dirs mechanism in ANT_OPTS.


Ah, joy, the java endorsed dirs mechanism. If that is causing a 
problem for you, then the version of xml-apis in ant/lib is moot; you 
need to get a better version into an endorsed directory.





-Prashant
[1]:http://svn.apache.org/viewvc/ant/core/trunk/lib/
PS: I have not downloaded the 1.7, i am not sure if the ANT downloads 
later versions of Xerces from repositories at build time.


Cant do that, because in the Maven repositories

-xml-apis is at 2.6.0
-xerces is at 2.8.1, and has a dependency on xml-apis 1.3.03.

We keep it under SCM, as it is the only thing needed at boot time. 
Historically it was also there because there was no bundled Java 
parser, and when one did come, it was only Crimson. But for the 1.5+ 
world, we could think about doing a no-parser distro. Not for 1.7, 
there will be too many surprises related to manifests. Something to 
think of.


-Steve

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Ant 1.7.0Beta3 released

2006-10-16 Thread Steve Loughran

Prashant wrote:


Steve Loughran wrote:

Prashant wrote:
Is there any reason why ANT 1.7 still distributes Xerces 2.6.2 in its 
lib [1] ? While the current release version of Xerces is 2.8 with 
support for DOM Level 3, Schema Validation, Not to mention the bug 
fixes.


As of 30 seconds ago, it distributes v 2.8.1. Version 2.6.2 does do 
XSD validation BTW, which is why Ant1.7 has a  task.


Ah, yes. I should have said JAXP 1.3 Schema Validation API. The thing 
thats returned by SchemaFactory.newSchema()[1]


But whats the reason to sticking to Xerces 2.6.2 ? 



Like I said: its just been upgraded.

> Anything more than  "Don't fix what not broken" ?

Its just laziness. We have an implicit trust in the quality of other 
open source products, or, more to the point, know that SVN_HEAD is where 
bug fixes go. Its just Ant's use of XML is limited to DTD-free, 
schema-free, namespace aware XML. We dont see the main problems that you 
may if you go near the PVSI, and dont use bleeding edge APIs that dont 
work in older JVM versions. We also suspect that people running Ant in 
IDEs or embedded use may not even use Xerces, so try not to hard-code 
dependence on Xerces, either.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to resolve a NullPointerException

2006-10-16 Thread tharanga wijethilake
Hi all,
I am tring to run this Ant file using a java program. 
When I run this using "Ant run" option provided in eclipse it runs with out any 
trouble. 




 









 





 












but when I try to run prgrammtically it gives a null pointer. Please Could 
someone tell me how am i supose to find from where the exception throws.
submit_a_bundle:

BUILD FAILED

C:\Documents and Settings\tharanga\My 
Documents\IBM\wssitedev51\workspace\AntRunner\build.xml:12: 
java.lang.NullPointerException

Total time: 2 seconds


 It is line 12 but is it the "bundlepath" or is it because of the related class 
file for smfbd task is missing. Thank you very much.



Tharanga Wijethilake



AW: How to resolve a NullPointerException

2006-10-16 Thread Jan.Materne
Dont know that task, but I have doubts using the leading "/" on the bundlepath 
value ...

Jan

>-Ursprüngliche Nachricht-
>Von: tharanga wijethilake [mailto:[EMAIL PROTECTED] 
>Gesendet: Montag, 16. Oktober 2006 16:41
>An: Ant Users List
>Betreff: How to resolve a NullPointerException
>
>Hi all,
>I am tring to run this Ant file using a java program. 
>When I run this using "Ant run" option provided in eclipse it 
>runs with out any trouble. 
>
>
>
>
>classname="com.ibm.ive.eccomm.bde.ui.tooling.ant.SubmitJarBundle"> 
>
>
>
>
>
>
>
>
>
> 
>
>
>
>
>
> 
>
>
>
>port="8080" webapp="/smf"/>
>
>
>
>
>
>
>
>
>but when I try to run prgrammtically it gives a null pointer. 
>Please Could someone tell me how am i supose to find from 
>where the exception throws.
>submit_a_bundle:
>
>BUILD FAILED
>
>C:\Documents and Settings\tharanga\My 
>Documents\IBM\wssitedev51\workspace\AntRunner\build.xml:12: 
>java.lang.NullPointerException
>
>Total time: 2 seconds
>
>
> It is line 12 but is it the "bundlepath" or is it because of 
>the related class file for smfbd task is missing. Thank you very much.
>
>
>
>Tharanga Wijethilake
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Ant 1.7.0Beta3 released

2006-10-16 Thread Dominique Devienne

> But whats the reason to sticking to Xerces 2.6.2 ?

Like I said: its just been upgraded.



I think you forgot to update WHATSNEW steve. Thanks, --DD

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to resolve a NullPointerException

2006-10-16 Thread Antoine Levy-Lambert
Hello,

how do you run this programatically ?

one common source of null pointer exceptions in Ant API use is to forget to set 
a project reference on task objects or datatypes. The null pointer exception 
happens then as soon as the task or the datatype tries to log something.

if you have a NPE when using command line Ant, run 

ant -verbose

(-verbose is a command line argument)

this will give you a stack trace.

Regards,

Antoine
 Original-Nachricht 
Datum: Mon, 16 Oct 2006 17:41:07 +0300
Von: "tharanga wijethilake" <[EMAIL PROTECTED]>
An: "Ant Users List" 
Betreff: How to resolve a NullPointerException

> Hi all,
> I am tring to run this Ant file using a java program. 
> When I run this using "Ant run" option provided in eclipse it runs with
> out any trouble. 
> 
> 
> 
> 
>  classname="com.ibm.ive.eccomm.bde.ui.tooling.ant.SubmitJarBundle"> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>  
> 
> 
> 
> 
> 
>  
> 
> 
> 
>  webapp="/smf"/>
> 
> 
> 
> 
> 
> 
> 
> 
> but when I try to run prgrammtically it gives a null pointer. Please Could
> someone tell me how am i supose to find from where the exception throws.
> submit_a_bundle:
> 
> BUILD FAILED
> 
> C:\Documents and Settings\tharanga\My
> Documents\IBM\wssitedev51\workspace\AntRunner\build.xml:12: 
> java.lang.NullPointerException
> 
> Total time: 2 seconds
> 
> 
>  It is line 12 but is it the "bundlepath" or is it because of the related
> class file for smfbd task is missing. Thank you very much.
> 
> 
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to preserve a property assigned via antcall on main build process?

2006-10-16 Thread David
Dear members,
   
  I am figthing for avoiding to use  from ant contrib lib, but I guess for 
solving this problem there is no other solution.
   
  I have the following targets:
   
  
  ...
  
   
  Note: From working properly this target I need to compute the property 
target.var.value (and this property could be assigned previoulsy if some target 
needed such property before)
   
  Now 
   
  


  
   
  This is the best solution, but the problem comes from the fact that the 
property computed on target compute-target1.var (property target.var) is not 
assigned after antcall invokation, so it doesn't work.
   
  but If I use instead of antcall, just dependences I get the value of 
target.var properly
   
  

  
   
  what I don't like about this solution is that the dependences targets are 
ALWAYS execute even if the property target.var was defined or not. This is a 
simple case, but on my case the computation of target.var is a complex task, so 
I have to run it always.
   
  Using ant contrib it is inmidiatly using  task, but I don't want to add 
more library dependence to my project.
   
  Do you have any idea about how to solve this problem?
   
  Thanks,
   
  David


-
Do you Yahoo!?
 Get on board. You're invited to try the new Yahoo! Mail.

Re: How to preserve a property assigned via antcall on main build process?

2006-10-16 Thread Vishal Vishnoi
I used to be in the same boat sometime back, where I thought using 
ant-contrib is building too many external dependency.


Over time I've realized that Ant-contrib is very stable and complements 
Ant very well. If you need to use 'if', then use 'if'. Don't fight it, 
otherwise you will end up with horrible hard to understand code.


--Vishal

David wrote:


Dear members,
  
 I am figthing for avoiding to use  from ant contrib lib, but I guess for solving this problem there is no other solution.
  
 I have the following targets:
  
 
  unless ="target.skip">
 ...
 
  
 Note: From working properly this target I need to compute the property target.var.value (and this property could be assigned previoulsy if some target needed such property before)
  
 Now 
  
 

   
   
 
  
 This is the best solution, but the problem comes from the fact that the property computed on target compute-target1.var (property target.var) is not assigned after antcall invokation, so it doesn't work.
  
 but If I use instead of antcall, just dependences I get the value of target.var properly
  
 
  depends="compute-target.var">
   
 
  
 what I don't like about this solution is that the dependences targets are ALWAYS execute even if the property target.var was defined or not. This is a simple case, but on my case the computation of target.var is a complex task, so I have to run it always.
  
 Using ant contrib it is inmidiatly using  task, but I don't want to add more library dependence to my project.
  
 Do you have any idea about how to solve this problem?
  
 Thanks,
  
 David



-
Do you Yahoo!?
Get on board. You're invited to try the new Yahoo! Mail.
 




___
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to preserve a property assigned via antcall on main build process?

2006-10-16 Thread Scot P. Floess
I completely agree.  I too fought the urge to use ant contrib for the 
same reasons (I was bent on stock ant).  But, if you use ant like you 
might use a shell script, ant contrib makes perfect sense.  Its a 
"small" dependency andmake your build.xml much cleaner and easier to 
understand.


Vishal Vishnoi wrote:
I used to be in the same boat sometime back, where I thought using 
ant-contrib is building too many external dependency.


Over time I've realized that Ant-contrib is very stable and 
complements Ant very well. If you need to use 'if', then use 'if'. 
Don't fight it, otherwise you will end up with horrible hard to 
understand code.


--Vishal

David wrote:


Dear members,
   I am figthing for avoiding to use  from ant contrib lib, but I 
guess for solving this problem there is no other solution.

   I have the following targets:
   
 ...
 
   Note: From working properly this target I need to compute the 
property target.var.value (and this property could be assigned 
previoulsy if some target needed such property before)

   Now
   
   

 
   This is the best solution, but the problem comes from the fact 
that the property computed on target compute-target1.var (property 
target.var) is not assigned after antcall invokation, so it doesn't 
work.
   but If I use instead of antcall, just dependences I get the value 
of target.var properly

   
   

 
   what I don't like about this solution is that the dependences 
targets are ALWAYS execute even if the property target.var was 
defined or not. This is a simple case, but on my case the computation 
of target.var is a complex task, so I have to run it always.
   Using ant contrib it is inmidiatly using  task, but I don't 
want to add more library dependence to my project.

   Do you have any idea about how to solve this problem?
   Thanks,
   David

   
-

Do you Yahoo!?
Get on board. You're invited to try the new Yahoo! Mail.
 




___
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-754-4592 (Work)

Chief Architect JPlate  http://sourceforge.net/projects/jplate
Chief Architect JavaPIM http://sourceforge.net/projects/javapim


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to preserve a property assigned via antcall on main build process?

2006-10-16 Thread Dominique Devienne

On 10/16/06, David <[EMAIL PROTECTED]> wrote:

Dear members,

 I am figthing for avoiding to use  from ant contrib lib, but I guess for 
solving this problem there is no other solution.

 I have the following targets:

 
 ...
 

 Note: From working properly this target I need to compute the property 
target.var.value (and this property could be assigned previoulsy if some target 
needed such property before)

 Now

 
   
   
 

 This is the best solution, but the problem comes from the fact that the 
property computed on target compute-target1.var (property target.var) is not 
assigned after antcall invokation, so it doesn't work.

 but If I use instead of antcall, just dependences I get the value of 
target.var properly

 
   
 

 what I don't like about this solution is that the dependences targets are 
ALWAYS execute even if the property target.var was defined or not. This is a 
simple case, but on my case the computation of target.var is a complex task, so 
I have to run it always.

 Using ant contrib it is inmidiatly using  task, but I don't want to add 
more library dependence to my project.

 Do you have any idea about how to solve this problem?

 Thanks,

 David


-
Do you Yahoo!?
 Get on board. You're invited to try the new Yahoo! Mail.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to preserve a property assigned via antcall on main build process?

2006-10-16 Thread Dominique Devienne

 Do you have any idea about how to solve this problem?


1) Simply add the unless ="target.var" directly to compute-target.var,
if the latter doesn't have any dependencies (or copy the content of
compute-target.var to target.pre).

2) Convert compute-target.var to a macro, which share the Project (and
thus properties) with the calling target.

3) Use Ant-Contrib's .

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: creating javadoc

2006-10-16 Thread Dominique Devienne

I want to create a javadoc for 6 to 7 project.
Am able to create separately. I want these to be in the same index file.


AFAIK, you cannot "merge" independent Javadoc runs. No one has created
a tool for this that I'm aware of.  You must run a single Javadoc run,
with all sources (even from different dir hierarchies.), as Jan
pointed out.

I used to javadoc each project individually, with  tags,
so that they were properly cross-referenced, and created my own entry
page with links to each individuals javadoc-generated index page.

Javadocs is resource hungry, so Javadocing too many sources at once
will eventually exhaust the memory. --DD

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Create a dir. named with the current system date

2006-10-16 Thread Marcelo de Moraes Serpa

Hi List,

I'm developing a backup routing with ant, and I need to create the backup
folder based on the current date.

The question is:
* How could I possibly retrieve the system current date and use it to make a
new directory?

Thanks in advance,

Marcelo.


Re: Create a dir. named with the current system date

2006-10-16 Thread Joel Klein

Marcelo de Moraes Serpa wrote:

The question is:
* How could I possibly retrieve the system current date and use it to 
make a

new directory?
The tstamp task with the format nested element does this.  Read its 
documentation for more help, but here's an example :


   
   
   

Now there's a property init.ymd which holds a string like "2006-10-16".  
Tstamp itself also creates other properties by default, but as shown you 
can make your own with the format nested element.


--
Joel Klein
Online at http://jfkbits.blogspot.com



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Create a dir. named with the current system date

2006-10-16 Thread Marcelo de Moraes Serpa

Ok, sorry! I should have read the documentation before...

Thanks for the info ;)

Marcelo.

On 10/16/06, Joel Klein <[EMAIL PROTECTED]> wrote:


Marcelo de Moraes Serpa wrote:
> The question is:
> * How could I possibly retrieve the system current date and use it to
> make a
> new directory?
The tstamp task with the format nested element does this.  Read its
documentation for more help, but here's an example :





Now there's a property init.ymd which holds a string like "2006-10-16".
Tstamp itself also creates other properties by default, but as shown you
can make your own with the format nested element.

--
Joel Klein
Online at http://jfkbits.blogspot.com



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Set enviroment variable with ant

2006-10-16 Thread Marcelo de Moraes Serpa

I need to set the PGPASSWORD enviroment variable in a ant project, however I
don't know how could I do it... should I use the exec task?


Re: Set enviroment variable with ant

2006-10-16 Thread Antoine Levy-Lambert
Hello Marcelo,

setting an environment variable from ant is possible using the exec task. Using 
a nested element (see the doc). The new environment variable is only visible 
for the one particular program started by the exec task.

similarly, the  task can set env vars, this only when you fork java apps.

If you need an env var to be visible to all the  and  invocations 
started by an ant build, you need to set this env var before starting ant, for 
instance in a wrapper script.

Regards,

Antoine
 Original-Nachricht 
Datum: Mon, 16 Oct 2006 18:05:48 -0200
Von: "Marcelo de Moraes Serpa" <[EMAIL PROTECTED]>
An: "Ant Users List" 
Betreff: Set enviroment variable with ant

> I need to set the PGPASSWORD enviroment variable in a ant project, however
> I
> don't know how could I do it... should I use the exec task?

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ant and classloading

2006-10-16 Thread Jacob Kjome
Quoting Peter Reilly <[EMAIL PROTECTED]>:

> On 10/16/06, Jacob Kjome <[EMAIL PROTECTED]> wrote:
> >
> > I'm not sure this is 100% an Ant question, but it is within the context of
> Ant.
> >
> > In my Ant task, I'm loading up a class using Class.forName() and pass
> > in a classloader that I would have expected to be assigned as the
> > classloader for the class.  That doesn't seem to be the case.  Here's
> > what I'm doing..
> >
> >
> > AntClassLoader customLoader = new
> > AntClassLoader(getClass().getClassLoader(), true);
> > customLoader.setClassPath(getResourcePath());
> >
> > Class clazz = Class.forName(clazzName, true, customLoader);
> >
> >
>
System.out.println(customLoader.getResource("org/myorganization/resources/my.dtd"));
> >
>
System.out.println(clazz.getClassLoader().getResource("org/myorganization/resources/my.dtd"));
> >
> >
> > The DTD resource is found in the first case using the custom
> > classloader where the user configured the resourcePath attribute of
> > the task, but in the second case when I use the classloader of the
> > class that I just loaded by passing in the custom classloader I just
> > get "null".  The point of this is that the class I am loading needs
> > to look up user-defined resources on the classpath.  With the
> > System.out lines, I am just testing what my loaded class needs to do
> > further down the line.
> >
> > Shouldn't the classloader of the class I just loaded be a reference
> > to that which I passed into Class.forName()?
>
> No, Java uses a delegated classloader model. Normally, classloaders
> search up the hierarchy, starting at the base classloader to load
> a  class. The reason for this is that classes are not the same unless
> they are loaded from the same classloader. To take a simple case
> one would want java.lang.Object to be the same no matter how
> it is loaded.
>

So, is there a way to add some more classpath information to the base
classloader that loaded the task?  I have no ability to pass a classloader to
the code that attempts to load configured resources.  The classloader that
loads the class needs to make this user-defined classpath available.

Come to think of it, can I just cast the classloader to an AntClassLoader and
add the path to it using addPathElement(String)?  I guess I didn't try that
yesterday, but I'll try it tonight.

Of course, it seems like that might cause side effects for later calls to the
same task where an added path element from one task use would be available for
another.

What other way is there?  Would I need to fork a new process and define the
classpath from the get-go for each call?  I'd like to use something less
heavyweight, but not have side effects.

Jake

>
> > This is probably more
> > of a general classloading question than an Ant question, but I'm
> > guessing others have had to deal with that here.  I must be making a
> > bad assumption, but it seems like something like this should be possible.
> >
> > My only workaround right now is to add the extra classpath
> > information to the Task definition classpath.  However, that is not
> > intuitive for task users and a pretty ugly hack.  Is there any way to
> > do this?  I've run into and solved many classloading issues in the
> > past, but I've never had to deal with this specifically.  I have to
> > imagine someone has solved this problem already.  Care to share the
> solution?
> >
> >
> > Jake
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Set enviroment variable with ant

2006-10-16 Thread Marcelo de Moraes Serpa

Hi Antoine, thanks a lot for the reply!

I actually solved the problem using the  task! I'll keep those other
possibilities in mind, they might come in handy ;)

Marcelo.

On 10/16/06, Antoine Levy-Lambert <[EMAIL PROTECTED]> wrote:


Hello Marcelo,

setting an environment variable from ant is possible using the exec task.
Using a nested element (see the doc). The new environment variable is only
visible for the one particular program started by the exec task.

similarly, the  task can set env vars, this only when you fork java
apps.

If you need an env var to be visible to all the  and 
invocations started by an ant build, you need to set this env var before
starting ant, for instance in a wrapper script.

Regards,

Antoine
 Original-Nachricht 
Datum: Mon, 16 Oct 2006 18:05:48 -0200
Von: "Marcelo de Moraes Serpa" <[EMAIL PROTECTED]>
An: "Ant Users List" 
Betreff: Set enviroment variable with ant

> I need to set the PGPASSWORD enviroment variable in a ant project,
however
> I
> don't know how could I do it... should I use the exec task?

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




a problem compiling a Java 5 project with generics

2006-10-16 Thread Chavdar Botev

Hi!

I've come accross the following problem trying to compile Java 5
classes with generics using Ant 1.6.5. I've attached project
with sample Java classes and a build.xml file.

NOTE: Please create a src/test subdirectory and save the attached
.java files into it. The mailing list server gave me a hard time
acepting an email with the archived project files. :(

A clean build of the above project works just fine and compiles
without a problem. If after that, I touch the Test3.java file the
build fails with the following error:

[javac] C:\src\appforge\test\src\test\Test3.java:5: incompatible types
[javac] found   : test.Base
[javac] required: test.Sub
[javac] public Sub p() {return this.getV();}
[javac] ^
[javac] 1 error

Initially, I thought that this was a problem with the Java compiler.
After touching Test3.java, I tried running javac manually:

javac -sourcepath src -d bin -g -source 1.5 -target 1.5 src\test\*.java

It turned out that with the above command-line the project compiled
OK. The project also compiles without a problem in Eclipse 3.2.1.

Am I missing anything? It is my understanding that the build file and
the command line should produce the same results.

Upon further experimentation, if I uncomment the method in Test2.java
fixes the problem. Touching Test3.java does not break the build.

Thanks,
Chavdar

	
	
		
		
	
	
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Check if file already exists

2006-10-16 Thread Christian Hauser

Hello

I'd like to check within an Ant target whether a particular file already 
exists on the disk and if not download the file (using the Get Ant task).


How do I best check if the file already exists?

Any help (preferably with a small code snippet) is appreciated.

Thanks in advance,

Christian


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Check if file already exists

2006-10-16 Thread Mathieu Champlon

Christian Hauser a écrit :

Hello

I'd like to check within an Ant target whether a particular file 
already exists on the disk and if not download the file (using the Get 
Ant task).


How do I best check if the file already exists?

Any help (preferably with a small code snippet) is appreciated.

Thanks in advance,

Christian


Hello,

Take a look at the  task : 
http://ant.apache.org/manual/CoreTasks/available.html


MAT.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Check if file already exists

2006-10-16 Thread Christian Hauser

Thank you Mat

That was exactly what I was looking for.

Christian

Mathieu Champlon wrote:

Christian Hauser a écrit :

Hello

I'd like to check within an Ant target whether a particular file 
already exists on the disk and if not download the file (using the Get 
Ant task).


How do I best check if the file already exists?

Any help (preferably with a small code snippet) is appreciated.

Thanks in advance,

Christian


Hello,

Take a look at the  task : 
http://ant.apache.org/manual/CoreTasks/available.html


MAT.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to preserve a property assigned via antcall on main build process?

2006-10-16 Thread Ninju Bohra
David,

You may want to try the  to bring back the value from a 

Later,

Ninju

- Original Message  
From: David <[EMAIL PROTECTED]> 
To: Ant Apache User Group  
Sent: Monday, October 16, 2006 11:30:17 AM 
Subject: How to preserve a property assigned via antcall on main build process? 


Dear members, 

I am figthing for avoiding to use  from ant contrib lib, but I guess for 
solving this problem there is no other solution. 

I have the following targets: 

 
... 
 

Note: From working properly this target I need to compute the property 
target.var.value (and this property could be assigned previoulsy if some target 
needed such property before) 

Now 

 
 
 
 

This is the best solution, but the problem comes from the fact that the 
property computed on target compute-target1.var (property target.var) is not 
assigned after antcall invokation, so it doesn't work. 

but If I use instead of antcall, just dependences I get the value of target.var 
properly 

 
 
 

what I don't like about this solution is that the dependences targets are 
ALWAYS execute even if the property target.var was defined or not. This is a 
simple case, but on my case the computation of target.var is a complex task, so 
I have to run it always. 

Using ant contrib it is inmidiatly using  task, but I don't want to add 
more library dependence to my project. 

Do you have any idea about how to solve this problem? 

Thanks, 

David 


- 
Do you Yahoo!? 
Get on board. You're invited to try the new Yahoo! Mail.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: ant and classloading

2006-10-16 Thread Rainer Noack
maybe  [1] can help you with diagnostics.

rainer

[1] http://enitsys.sourceforge.net/ant-classloadertask/



> -Original Message-
> From: Jacob Kjome [mailto:[EMAIL PROTECTED] 
> Sent: Monday, October 16, 2006 10:24 PM
> To: Ant Users List
> Subject: Re: ant and classloading
> 
> 
> Quoting Peter Reilly <[EMAIL PROTECTED]>:
> 
> > On 10/16/06, Jacob Kjome <[EMAIL PROTECTED]> wrote:
> > >
> > > I'm not sure this is 100% an Ant question, but it is within the 
> > > context of
> > Ant.
> > >
> > > In my Ant task, I'm loading up a class using Class.forName() and 
> > > pass in a classloader that I would have expected to be 
> assigned as 
> > > the classloader for the class.  That doesn't seem to be 
> the case.  
> > > Here's what I'm doing..
> > >
> > >
> > > AntClassLoader customLoader = new 
> > > AntClassLoader(getClass().getClassLoader(), true);
> > > customLoader.setClassPath(getResourcePath());
> > >
> > > Class clazz = Class.forName(clazzName, true, customLoader);
> > >
> > >
> >
> System.out.println(customLoader.getResource("org/myorganizatio
> n/resources/my.dtd"));
> > >
> >
> System.out.println(clazz.getClassLoader().getResource("org/myo
rganization/resources/my.dtd"));
> > >
> > >
> > > The DTD resource is found in the first case using the custom 
> > > classloader where the user configured the resourcePath 
> attribute of 
> > > the task, but in the second case when I use the 
> classloader of the 
> > > class that I just loaded by passing in the custom 
> classloader I just 
> > > get "null".  The point of this is that the class I am 
> loading needs 
> > > to look up user-defined resources on the classpath.  With the 
> > > System.out lines, I am just testing what my loaded class 
> needs to do 
> > > further down the line.
> > >
> > > Shouldn't the classloader of the class I just loaded be a 
> reference 
> > > to that which I passed into Class.forName()?
> >
> > No, Java uses a delegated classloader model. Normally, classloaders 
> > search up the hierarchy, starting at the base classloader 
> to load a  
> > class. The reason for this is that classes are not the same unless 
> > they are loaded from the same classloader. To take a simple 
> case one 
> > would want java.lang.Object to be the same no matter how it 
> is loaded.
> >
> 
> So, is there a way to add some more classpath information to 
> the base classloader that loaded the task?  I have no ability 
> to pass a classloader to the code that attempts to load 
> configured resources.  The classloader that loads the class 
> needs to make this user-defined classpath available.
> 
> Come to think of it, can I just cast the classloader to an 
> AntClassLoader and add the path to it using 
> addPathElement(String)?  I guess I didn't try that yesterday, 
> but I'll try it tonight.
> 
> Of course, it seems like that might cause side effects for 
> later calls to the same task where an added path element from 
> one task use would be available for another.
> 
> What other way is there?  Would I need to fork a new process 
> and define the classpath from the get-go for each call?  I'd 
> like to use something less heavyweight, but not have side effects.
> 
> Jake
> 
> >
> > > This is probably more
> > > of a general classloading question than an Ant question, but I'm 
> > > guessing others have had to deal with that here.  I must 
> be making a 
> > > bad assumption, but it seems like something like this should be 
> > > possible.
> > >
> > > My only workaround right now is to add the extra classpath 
> > > information to the Task definition classpath.  However, 
> that is not 
> > > intuitive for task users and a pretty ugly hack.  Is 
> there any way 
> > > to do this?  I've run into and solved many classloading issues in 
> > > the past, but I've never had to deal with this 
> specifically.  I have 
> > > to imagine someone has solved this problem already.  Care 
> to share 
> > > the
> > solution?
> > >
> > >
> > > Jake
> > >
> > >
> > > 
> 
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> > 
> -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: ant and classloading

2006-10-16 Thread Jacob Kjome


Very interesting stuff.  I will definitely use your tasks for my own 
build files.  It would be very nice if your tasks were added to 
Ant-1.7.  Any luck with that so far?


I actually did come up with a solution to my problem, though.  I need 
to be able to add path elements on the fly via the task to the 
current classloader, but make sure it gets cleaned up immediately 
thereafter so subsequent uses of the same classloader have no 
remnants of any changes.  I wrote the following


AntClassLoader xmlcLoader = null;
String origClasspath = null;
try {
// Add the user-defined resource path to the current 
classloader so

// that XCatalog and DTD resources can be found by XMLC during
// compilation.  Store the original classpath so it can be reset.
// This avoids pollution of the classpath outside of the current
//  task invocation.
xmlcLoader = (AntClassLoader) getClass().getClassLoader();
origClasspath = xmlcLoader.getClasspath();
xmlcLoader.addPathElement(getResourcePath().toString());




Class clazz = Class.forName(xmlcClassName, true, xmlcLoader);




} catch (Exception x) {
throw new BuildException(x);
} finally {
if (xmlcLoader != null && origClasspath != null) {
// Restore the original classpath to avoid leaking 
user-defined

// resource path information outside the current invocation of
// the  task.
xmlcLoader.setClassPath(new Path(getProject(), 
origClasspath));

}
}

Anyone see a problem with this?

Jake

At 03:41 PM 10/16/2006, you wrote:
>maybe  [1] can help you with diagnostics.
>
>rainer
>
>[1] http://enitsys.sourceforge.net/ant-classloadertask/
>
>
>
>> -Original Message-
>> From: Jacob Kjome [mailto:[EMAIL PROTECTED]
>> Sent: Monday, October 16, 2006 10:24 PM
>> To: Ant Users List
>> Subject: Re: ant and classloading
>>
>>
>> Quoting Peter Reilly <[EMAIL PROTECTED]>:
>>
>> > On 10/16/06, Jacob Kjome <[EMAIL PROTECTED]> wrote:
>> > >
>> > > I'm not sure this is 100% an Ant question, but it is within the
>> > > context of
>> > Ant.
>> > >
>> > > In my Ant task, I'm loading up a class using Class.forName() and
>> > > pass in a classloader that I would have expected to be
>> assigned as
>> > > the classloader for the class.  That doesn't seem to be
>> the case.
>> > > Here's what I'm doing..
>> > >
>> > >
>> > > AntClassLoader customLoader = new
>> > > AntClassLoader(getClass().getClassLoader(), true);
>> > > customLoader.setClassPath(getResourcePath());
>> > >
>> > > Class clazz = Class.forName(clazzName, true, customLoader);
>> > >
>> > >
>> >
>> System.out.println(customLoader.getResource("org/myorganizatio
>> n/resources/my.dtd"));
>> > >
>> >
>> System.out.println(clazz.getClassLoader().getResource("org/myo
>rganization/resources/my.dtd"));
>> > >
>> > >
>> > > The DTD resource is found in the first case using the custom
>> > > classloader where the user configured the resourcePath
>> attribute of
>> > > the task, but in the second case when I use the
>> classloader of the
>> > > class that I just loaded by passing in the custom
>> classloader I just
>> > > get "null".  The point of this is that the class I am
>> loading needs
>> > > to look up user-defined resources on the classpath.  With the
>> > > System.out lines, I am just testing what my loaded class
>> needs to do
>> > > further down the line.
>> > >
>> > > Shouldn't the classloader of the class I just loaded be a
>> reference
>> > > to that which I passed into Class.forName()?
>> >
>> > No, Java uses a delegated classloader model. Normally, classloaders
>> > search up the hierarchy, starting at the base classloader
>> to load a
>> > class. The reason for this is that classes are not the same unless
>> > they are loaded from the same classloader. To take a simple
>> case one
>> > would want java.lang.Object to be the same no matter how it
>> is loaded.
>> >
>>
>> So, is there a way to add some more classpath information to
>> the base classloader that loaded the task?  I have no ability
>> to pass a classloader to the code that attempts to load
>> configured resources.  The classloader that loads the class
>> needs to make this user-defined classpath available.
>>
>> Come to think of it, can I just cast the classloader to an
>> AntClassLoader and add the path to it using
>> addPathElement(String)?  I guess I didn't try that yesterday,
>> but I'll try it tonight.
>>
>> Of course, it seems like that might cause side effects for
>> later calls to the same task where an added path element from
>> one task use would be available for another.
>>
>> What other way is there?  Would I need to fork a new process
>> and define the classpath from the get-go for each call?  I'd
>> like to use something less heavywe

Re: a problem compiling a Java 5 project with generics

2006-10-16 Thread Petar Tahchiev

On 17/10/06, Chavdar Botev <[EMAIL PROTECTED]> wrote:


Hi!

I've come accross the following problem trying to compile Java 5
classes with generics using Ant 1.6.5. I've attached project
with sample Java classes and a build.xml file.

NOTE: Please create a src/test subdirectory and save the attached
.java files into it. The mailing list server gave me a hard time
acepting an email with the archived project files. :(

A clean build of the above project works just fine and compiles
without a problem. If after that, I touch the Test3.java file the
build fails with the following error:


[javac] C:\src\appforge\test\src\test\Test3.java:5: incompatible types

[javac] found   : test.Base
[javac] required: test.Sub
[javac] public Sub p() {return this.getV();}
[javac] ^
[javac] 1 error



I must admit that this behaviour is really strange. I am interested in
helping you but the problem is that I didn't receive any .java files. Please
try to prvide them again.


Initially, I thought that this was a problem with the Java compiler.

After touching Test3.java, I tried running javac manually:

javac -sourcepath src -d bin -g -source 1.5 -target 1.5 src\test\*.java

It turned out that with the above command-line the project compiled
OK. The project also compiles without a problem in Eclipse 3.2.1.

Am I missing anything? It is my understanding that the build file and
the command line should produce the same results.

Upon further experimentation, if I uncomment the method in Test2.java
fixes the problem. Touching Test3.java does not break the build.

Thanks,
Chavdar


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






--
Regards, Petar!
Karlovo, Bulgaria.