RE: Deploying application using ANT and WebLogic

2006-02-15 Thread Dinesh Sonsale
For more deployment details 

http://ant.apache.org/manual/OptionalTasks/serverdeploy.html

-Original Message-
From: Steve Loughran [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 15, 2006 1:22 PM
To: Ant Users List
Subject: Re: Deploying application using ANT and WebLogic

Shweta Bodade wrote:
  
 
 Hi:
 
  
 
 I am trying to use ant   to deploy a war file on weblogic 8.1.
 
 Can you please help me with some examples.
 
  
 
 Thanks and Regards,
 
 Shweta
 
  
 
 

first, you should allow more than an hour before resending the message. 
There are not hundreds of people idly waiting for emails and going to 
respond instantly.

I find copy works with most app servers, if not:

-weblogic may provide their own tasks

-cargo, at http://cargo.codehaus.org is a library to deploy to app 
servers, it can even start and stop the server.

-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]



AW: Broken Junit targets

2006-02-15 Thread Jan.Materne
  !-- Suggested by Stephen McConnell --
  target name=setup-path depends=init
path id=project.main.path
  pathelement location=${ant.jar}/
  pathelement location=${build.dir}/classes/
/path
path id=project.test.path
  path refid=project.main.path/
  pathelement location=${ant-junit.jar}/
  pathelement location=${junit.jar}/
/path
  /target

ok, now your test classes should find Ant´s junit task.


  !--  refid changed from test.classpath to setup-path --
  target name=test depends=test-compile
junit printsummary=true

But could Ant find it itself?
While taskdef´ing Ant needs to know
- the implementation class of the task
- all needed external libraries

junit is taskdef´ed during the core initialisation 
(oata/taskdefs/default.properties).
The implementation class in ANT_HOME\lib\ant-junit.jar and the needed archive 
is junit.jar.

So junit.jar has to be in Ant´s classpath during Ant´s start: in ANT_HOME\lib, 
ANT_HOME\lib\optional, USER_HOME\.ant\lib or in the directory provided via -lib.


Or you taskdef´ it a second time with another name

  target name=setup-path depends=init
  ...
  taskdef name=my.junit classname=... 
classpathref=project.test.path/
  /target




Jan

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



Re: Broken Junit targets

2006-02-15 Thread Peter Reilly
Jan,
I do not think that your second option will work. (taskdefing to a different
name)

Peter

On 2/15/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

   !-- Suggested by Stephen McConnell --
   target name=setup-path depends=init
 path id=project.main.path
   pathelement location=${ant.jar}/
   pathelement location=${build.dir}/classes/
 /path
 path id=project.test.path
   path refid=project.main.path/
   pathelement location=${ant-junit.jar}/
   pathelement location=${junit.jar}/
 /path
   /target

 ok, now your test classes should find Ant´s junit task.


   !--  refid changed from test.classpath to setup-path --
   target name=test depends=test-compile
 junit printsummary=true

 But could Ant find it itself?
 While taskdef´ing Ant needs to know
 - the implementation class of the task
 - all needed external libraries

 junit is taskdef´ed during the core initialisation
 (oata/taskdefs/default.properties).
 The implementation class in ANT_HOME\lib\ant-junit.jar and the needed
 archive is junit.jar.

 So junit.jar has to be in Ant´s classpath during Ant´s start: in
 ANT_HOME\lib, ANT_HOME\lib\optional, USER_HOME\.ant\lib or in the directory
 provided via -lib.


 Or you taskdef´ it a second time with another name

   target name=setup-path depends=init
   ...
   taskdef name=my.junit classname=... classpathref=
 project.test.path/
   /target




 Jan

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




AW: Broken Junit targets

2006-02-15 Thread Jan.Materne
I do not think that your second option will work. (taskdefing 
to a different name)

Mmmh, indeed ...
Why? (funny classloader stuff I think...)

BTW: I wouldnt advice reassigning standard tasks  Maybe
presetdefing some


Jan


project

property environment=env/

property name=ant.jar location=${env.ANT_HOME}/lib/ant.jar/
property name=ant-junit.jar
location=${env.ANT_HOME}/lib/ant-junit.jar/

property name=junit.jar
location=${user.home}/.ant/lib/junit.jar/



path id=project.main.path
  pathelement location=${ant.jar}/
/path
path id=project.test.path
  path refid=project.main.path/
  pathelement location=${ant-junit.jar}/
  pathelement location=${junit.jar}/
/path


pathconvert property=p refid=project.test.path/
echo${p}/echo


taskdef name=my.junit 
 
classname=org.apache.tools.ant.taskdefs.optional.junit.JUnitTask
 classpathref=project.test.path/


my.junit/

/project


Buildfile: build.xml
 [echo]
C:\ant\17.3\lib\ant.jar;C:\ant\17.3\lib\ant-junit.jar;C:\Profile\mat\.an
t\lib\junit.jar

BUILD FAILED
C:\tmp\ant-taskdef2nd_junit\build.xml:28: taskdef A class needed by
class org.apache.tools.ant.taskdefs.optional.junit.JUnitTask cannot be
found: junit/framework/Test

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



Re: Property vs. user property - what's the difference?

2006-02-15 Thread Patrick Martin
Hello,
Could you explain the even more immutable part of your mail ?
Thanks,
Patrick M.

On 2/15/06, Stefan Bodewig [EMAIL PROTECTED] wrote:
 On Tue, 14 Feb 2006, Ian Pilcher [EMAIL PROTECTED] wrote:

  Can someone explain the difference between a property and a user
  property (or the difference between Project.setProperty and
  Project.setUserProperty)?

 user properties are the properties defined on the command line or as
 nested property elements in ant tasks.  They are even more
 immutable than plain properties and are passed down to child builds
 accross ant even if inheritall is false.

 Stefan

 -
 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: Property vs. user property - what's the difference?

2006-02-15 Thread Shweta Bodade


Regards
Shweta ArunKumar Bodade,
 
Ness Technologies (India) Ltd,
No 33, 17th H Main Road,
6th Block, Koramangla,
Banglore - 560 095
 
Tel(office) : 51961000
-Original Message-
From: Patrick Martin [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 15, 2006 3:42 PM
To: Ant Users List
Subject: Re: Property vs. user property - what's the difference?

Hello,
Could you explain the even more immutable part of your mail ?
Thanks,
Patrick M.

On 2/15/06, Stefan Bodewig [EMAIL PROTECTED] wrote:
 On Tue, 14 Feb 2006, Ian Pilcher [EMAIL PROTECTED] wrote:

  Can someone explain the difference between a property and a user
  property (or the difference between Project.setProperty and
  Project.setUserProperty)?

 user properties are the properties defined on the command line or as
 nested property elements in ant tasks.  They are even more
 immutable than plain properties and are passed down to child builds
 accross ant even if inheritall is false.

 Stefan

 -
 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]



One more Question regarding deployment in ANT and WebLogic

2006-02-15 Thread Shweta Bodade
Hi,

 

I could deploy my web application using Ant in WebLogic server 

But I get the following description when I deploy it, sorry for so many
questions but am a fresher and want to explore Ant for automation. 

Buildfile: E:\workspace2\Hello\src\build.xml

print message:

 [java] Warning: No targets were specified. Your application will not be
deployed anywhere.

 [java] To specify a target for your component, use the -component
argument

 [java] Done deploying jade with
e:\bea\user_projects\domains\mydomain\.\myserver\upload\jade\jade.war

BUILD SUCCESSFUL

Total time: 22 seconds

 

 

Because of this line that no targets were specified the context root is
missing 

Can u show me an example of specifying a target 

My code is 

 

 

project name=Hello default=print message 

  target name=print message

 serverdeploy action=deploy source=E:\jrt\jade.war

weblogic application=jade

server=http://localhost:7001;

 
classpath=E:\bea\weblogic81\server\lib\weblogic.jar

username=admin

password=administrator   
component=myserver
  

debug=true/

 /serverdeploy

  /target 

/project 




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



RE: One more Question regarding deployment in ANT and WebLogic

2006-02-15 Thread Dinesh Sonsale
Your modified XML here. Assume that file name is build.xml

Hope this helps ..All the best..

?xml version=1.0?
project name=Hello default=all 

  target name=all depends=Deploy-App
echo message=Task of weblogic completed /
  /target

  target name=Deploy-App
 serverdeploy action=deploy source=E:\jrt\jade.war
weblogic application=jade
server=http://localhost:7001;

classpath=E:\bea\weblogic81\server\lib\weblogic.jar
username=admin
password=administrator   
component=myserver
debug=true/
 /serverdeploy
  /target 
/project 



-Original Message-
From: Shweta Bodade [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 15, 2006 4:51 PM
To: 'Ant Users List'
Subject: One more Question regarding deployment in ANT and WebLogic

Hi,

 

I could deploy my web application using Ant in WebLogic server 

But I get the following description when I deploy it, sorry for so many
questions but am a fresher and want to explore Ant for automation. 

Buildfile: E:\workspace2\Hello\src\build.xml

print message:

 [java] Warning: No targets were specified. Your application will not be
deployed anywhere.

 [java] To specify a target for your component, use the -component
argument

 [java] Done deploying jade with
e:\bea\user_projects\domains\mydomain\.\myserver\upload\jade\jade.war

BUILD SUCCESSFUL

Total time: 22 seconds

 

 

Because of this line that no targets were specified the context root is
missing 

Can u show me an example of specifying a target 

My code is 

 

 

project name=Hello default=print message 

  target name=print message

 serverdeploy action=deploy source=E:\jrt\jade.war

weblogic application=jade

server=http://localhost:7001;

 
classpath=E:\bea\weblogic81\server\lib\weblogic.jar

username=admin

password=administrator   
component=myserver
  

debug=true/

 /serverdeploy

  /target 

/project 




-
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: One more Question regarding deployment in ANT and WebLogic with answer

2006-02-15 Thread Shweta Bodade
Hi dinesh thnx 
For answer 
Well the error is resolved and 
Code should be like component=jade:myserver

Where jade is eventually pointing to context root and myserver is the target
on which I want to deploy my application.

Thnx to show interest in the problem.


 
Regards
Shweta 



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



Re: Property vs. user property - what's the difference?

2006-02-15 Thread Ondřej Světlík
 Hello,
 Could you explain the even more immutable part of your mail ?
 Thanks,
 Patrick M.

 On 2/15/06, Stefan Bodewig [EMAIL PROTECTED] wrote:
 On Tue, 14 Feb 2006, Ian Pilcher [EMAIL PROTECTED] wrote:

  Can someone explain the difference between a property and a user
  property (or the difference between Project.setProperty and
  Project.setUserProperty)?

 user properties are the properties defined on the command line or as
 nested property elements in ant tasks.  They are even more
 immutable than plain properties and are passed down to child builds
 accross ant even if inheritall is false.

 Stefan

 -
 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]



I think that even more immutable are only properties defined on
command-line. These properties are passed to ant from jvm, that's why they
can't be reset or unset by any means. The only way to forget them is to
run ant as an external program using apply task.

Best regards

Ondrej Svetlik

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



RE: Deploying an application in WebLogic

2006-02-15 Thread Srikrishna_Parthasarathy
Kindly use this.edocs.bea.com has information.
wldeploy
  action=deploy verbose=true debug=true
  name=OMSQueueEngine
source=c:/cvssource/bosprint/dist/OMSQueueEngine.ear
  userconfigfile=C:\bea815\weblogic81\wls81.mydomain
userkeyfile=C:\bea815\weblogic81\wls.key
  adminurl=t3://10.187.218.183:7001 targets=myserver /

-Original Message-
From: Shweta Bodade [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 14, 2006 11:41 PM
To: Ant Users List
Subject: Deploying an application in WebLogic

Hello GM all of you...

 

Can anyone guide me on how to deploy a simple war file in
weblogic appserver

 

Thanks in advance.

 

 

Regards

Shweta.

 


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



test for directory existence

2006-02-15 Thread Martin Gainty

Good Morning All-

How do you test for the existence of a folder before del or mkdir operation
Has something to with property ???

Thanks!

Martin Gainty

(mobile) 603-438-5053



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



Re: test for directory existence

2006-02-15 Thread Ondřej Světlík
 Good Morning All-

 How do you test for the existence of a folder before del or mkdir
 operation
 Has something to with property ???

 Thanks!

 Martin Gainty

 (mobile) 603-438-5053



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


Hello,

why do you want to check for it's existence? Both tasks (delete and
mkdir) can handle non-existing respectively existing directories. See
this example:


project name=delete default=all

target name=all
mkdir dir=dir/dir2 /
mkdir dir=dir/dir2 /
delete dir=dir /
delete dir=dir /
/target

/project

It will successfully pass. The second mkdir won't do anything with the
original content of the folder.

Best regards

Ondrej Svetlik

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



Re: test for directory existence

2006-02-15 Thread Martin Gainty
*Not sure about delete*
 but I know
mkdir will fail if the folder is already in place
Thus the reason for checking the folder existence before mkdir operation

díky!
Martin-
- Original Message - 
From: Ondřej Světlík [EMAIL PROTECTED]
To: Ant Users List user@ant.apache.org
Sent: Wednesday, February 15, 2006 10:31 AM
Subject: Re: test for directory existence


 Good Morning All-

 How do you test for the existence of a folder before del or mkdir
 operation
 Has something to with property ???

 Thanks!

 Martin Gainty

 (mobile) 603-438-5053



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

 
 Hello,
 
 why do you want to check for it's existence? Both tasks (delete and
 mkdir) can handle non-existing respectively existing directories. See
 this example:
 
 
 project name=delete default=all
 
 target name=all
mkdir dir=dir/dir2 /
mkdir dir=dir/dir2 /
delete dir=dir /
delete dir=dir /
 /target
 
 /project
 
 It will successfully pass. The second mkdir won't do anything with the
 original content of the folder.
 
 Best regards
 
 Ondrej Svetlik
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


custom ant task .....successful or not

2006-02-15 Thread Srikrishna_Parthasarathy
How to check if custom ant task ran successful or not.

 

wldeploy

  action=deploy debug=true

  name=OMSQueueEngine
source=c:/cvssource/bosprint/dist/OMSQueueEngine.ear

  userconfigfile=C:\bea815\weblogic81\wls81.mydomain
userkeyfile=C:\bea815\weblogic81\wls.key

  adminurl=t3://10.187.218.183:7001 targets=myserver /

 

 

Eager to see your replies.

 

srikrishna



Re: test for directory existence

2006-02-15 Thread Ninju Bohra
You can use the available property=direxists file=path to directory 
type=dir to set a property based upon the existance of a directory...then 
create a target whose job is to delete the directory and use a if=direxists 
attribute to control the whether the target really executes (or merely no-ops) 
based upon the property being set.
 
Good luck,
 
Ninju



- Original Message 
From: Martin Gainty [EMAIL PROTECTED]
To: Ant Users List user@ant.apache.org
Sent: Wednesday, February 15, 2006 9:38:45 AM
Subject: Re: test for directory existence


*Not sure about delete*
but I know
mkdir will fail if the folder is already in place
Thus the reason for checking the folder existence before mkdir operation

díky!
Martin-
- Original Message - 
From: Ondřej Světlík [EMAIL PROTECTED]
To: Ant Users List user@ant.apache.org
Sent: Wednesday, February 15, 2006 10:31 AM
Subject: Re: test for directory existence


 Good Morning All-

 How do you test for the existence of a folder before del or mkdir
 operation
 Has something to with property ???

 Thanks!

 Martin Gainty

 (mobile) 603-438-5053



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

 
 Hello,
 
 why do you want to check for it's existence? Both tasks (delete and
 mkdir) can handle non-existing respectively existing directories. See
 this example:
 
 
 project name=delete default=all
 
 target name=all
mkdir dir=dir/dir2 /
mkdir dir=dir/dir2 /
delete dir=dir /
delete dir=dir /
 /target
 
 /project
 
 It will successfully pass. The second mkdir won't do anything with the
 original content of the folder.
 
 Best regards
 
 Ondrej Svetlik
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


Re: test for directory existence

2006-02-15 Thread Rich Wagner
These prompt for a (relative or absolute) path, and conditionally set a 
property based on directory existence, and echo a message that reports 
whether there's a directory at the given path:


   target name=ask_for_path_and_echo_existence
   depends=exists,does_not_exist/

   target name=ask_for_dir
   input message=Enter path: addproperty=PATH/
   property name=ABSOLUTE_PATH location=${PATH}/
   available file=${ABSOLUTE_PATH} type=dir
  property=DIR.present/
   /target

   target name=exists depends=ask_for_dir if=DIR.present
   echo message=Directory exists:  ${ABSOLUTE_PATH}/
   /target

   target name=does_not_exist depends=ask_for_dir 
unless=DIR.present
   echo message=Directory does NOT exist, or not a directory:  
${ABSOLUTE_PATH}/

   /target


Hope this helps,
Rich Wagner



Martin Gainty wrote:


Good Morning All-

How do you test for the existence of a folder before del or mkdir 
operation

Has something to with property ???

Thanks!

Martin Gainty

(mobile) 603-438-5053



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






Re: custom ant task .....successful or not

2006-02-15 Thread Ninju Bohra
Simple way...is a Build Exception thrown?
 
I would assume that if a task (custom or not) is unable to perform the task 
it is designed to do then it is the task's responsibility to communicate that 
back to the callee...outside of a onerror property (on such) the throwing of a 
well-informed BuildException is a totally valid way of informing the callee 
that we were unable to perform the task requested.
 
Getting of my soapbox now...I can also assume that the reason you are asking is 
that you are not satified with your results nor did you get a BuildException.  
You may want to setting verbose=true in the wldeploy task to get more 
information.
 
Sorry not to familiar with wldeploy,
 
Ninju



- Original Message 
From: [EMAIL PROTECTED]
To: user@ant.apache.org
Sent: Wednesday, February 15, 2006 10:01:08 AM
Subject: custom ant task .successful or not


How to check if custom ant task ran successful or not.



wldeploy

  action=deploy debug=true

  name=OMSQueueEngine
source=c:/cvssource/bosprint/dist/OMSQueueEngine.ear

  userconfigfile=C:\bea815\weblogic81\wls81.mydomain
userkeyfile=C:\bea815\weblogic81\wls.key

  adminurl=t3://10.187.218.183:7001 targets=myserver /





Eager to see your replies.



srikrishna

Re: test for directory existence

2006-02-15 Thread Ivan \Rambius\ Ivanov
Hello,

delete dir=.../ and mkdir dir=... tasks take
care of these details:

project
delete dir=i_do_not_exist/

mkdir dir=i_exist/
mkdir dir=i_exist/
/project

Here, we are trying to delete a non-existing
directory. Of course, delete deletes nothing but it
executes successfully. Next, with the second
invokation of mkdir we want to create a directory
that already exists and mkdir creates nothing but it
executes successfully.

Regarding your original question, you can use
available task:
available file=i_do_not_exist type=dir
property=not.exists/
available file=i_exist type=dir
property=exists/
echo$${exists} = ${exists}/echo
echo$${not_exists} = ${not_exists}/echo

Next, you can use if and unless attributes of target
in order to control the build flow based on the
existence of the directories.

Regards
Ivan

--- Martin Gainty [EMAIL PROTECTED] wrote:

 Good Morning All-
 
 How do you test for the existence of a folder before
 del or mkdir operation
 Has something to with property ???
 
 Thanks!
 
 Martin Gainty
 
 (mobile) 603-438-5053
 
 
 

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


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

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



Passing sysproperties from a file

2006-02-15 Thread Laurie . Green
Hi,

I'm trying to include a set of properties, taken from a file, in the
Java task as system properties.

I have been fiddling around with various combinations of property
file=file.props id=jeff /  With sysproperty refid=jeff / in the
Java task, but with no joy.


Anybody know how to achieve this? I'm sure it must be possible.

Thanks,
Laurie

Visit our website at http://www.ubs.com

This message contains confidential information and is intended only
for the individual named.  If you are not the named addressee you
should not disseminate, distribute or copy this e-mail.  Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses.  The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission.  If
verification is required please request a hard-copy version.  This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.


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



Ant war task

2006-02-15 Thread General Email
Hi,
  
  I have a war task and I'm specifing the required libs with:
  
  lib refid=classpath /
  
  Where classpath is a path id specifing the locations of the required library 
files.
  
  However, Ant does not like this and complains that classpath is not a  
fileset (which it isn't) but why would this sort of specification be  allowed 
in the javac task, eg src refid=classpath /  but not in the war task??
  
  Thanks.
  

-
 Yahoo! Mail
 Use Photomail to share photos without annoying attachments.

Re: test for directory existence

2006-02-15 Thread Martin Gainty
available tag works
Thanks Rich!
M-

- Original Message - 
From: Rich Wagner [EMAIL PROTECTED]
To: Ant Users List user@ant.apache.org; [EMAIL PROTECTED]
Sent: Wednesday, February 15, 2006 11:14 AM
Subject: Re: test for directory existence


 These prompt for a (relative or absolute) path, and conditionally set a 
 property based on directory existence, and echo a message that reports 
 whether there's a directory at the given path:
 
target name=ask_for_path_and_echo_existence
depends=exists,does_not_exist/
 
target name=ask_for_dir
input message=Enter path: addproperty=PATH/
property name=ABSOLUTE_PATH location=${PATH}/
available file=${ABSOLUTE_PATH} type=dir
   property=DIR.present/
/target
 
target name=exists depends=ask_for_dir if=DIR.present
echo message=Directory exists:  ${ABSOLUTE_PATH}/
/target
 
target name=does_not_exist depends=ask_for_dir 
 unless=DIR.present
echo message=Directory does NOT exist, or not a directory:  
 ${ABSOLUTE_PATH}/
/target
 
 
 Hope this helps,
 Rich Wagner
 
 
 
 Martin Gainty wrote:
 
 Good Morning All-

 How do you test for the existence of a folder before del or mkdir 
 operation
 Has something to with property ???

 Thanks!

 Martin Gainty

 (mobile) 603-438-5053



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


 


input, but for paths...

2006-02-15 Thread Rich Wagner
I was looking through the online Ant manual recently, looking for 
something like input, but which would display either an open or 
save dialog, i.e. what you typically see if you choose File: Open... 
or File: Save... in an application.  Alas, I found no such task, so I 
instead wrote tasks and targets which would use input and would ask 
the user to type paths: not as user-friendly...


Has this sort of task ever been considered as an addition to Ant?

(I realize Ant can't assume it's running on a machine with a display, 
mouse, etc.; i.e. that it may find itself on a headless computer.  But 
in that case this proposed input variation would resort to a 
stdout/stdout-based prompting...)


Thanks in advance,
Rich Wagner


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



Re: input, but for paths...

2006-02-15 Thread Ivan \Rambius\ Ivanov
Hello,

input task does not read the user input. Instead it
delegates the reading to InputHandlers [1]. In short
you should write an extension of InputHandler and
create the dialog in it. Then pass the fully qualified
name of your input handler to -inputhandler option of
ant launching script. I collected some more
information on ant's input handlers in an article
called Extending Ant Input Abilties, which you can
find at [2].

While it is a good exercise to play with the handlers,
I think that input task spoils the idea of the
automation. I prefer to store the different settings
in  differen properties/xml files and load one of
those files depending on the context/environment of
the build. Of course, if in your case the path is
completely arbitrary, you have less choices.

Regards
Ivan

[1]http://ant.apache.org/manual/inputhandler.html
[2]http://ant.apache.org/resources.html

--- Rich Wagner [EMAIL PROTECTED] wrote:

 I was looking through the online Ant manual
 recently, looking for 
 something like input, but which would display
 either an open or 
 save dialog, i.e. what you typically see if you
 choose File: Open... 
 or File: Save... in an application.  Alas, I found
 no such task, so I 
 instead wrote tasks and targets which would use
 input and would ask 
 the user to type paths: not as user-friendly...
 
 Has this sort of task ever been considered as an
 addition to Ant?
 
 (I realize Ant can't assume it's running on a
 machine with a display, 
 mouse, etc.; i.e. that it may find itself on a
 headless computer.  But 
 in that case this proposed input variation would
 resort to a 
 stdout/stdout-based prompting...)
 
 Thanks in advance,
 Rich Wagner
 
 

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


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

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



Re: input, but for paths...

2006-02-15 Thread Patrick Martin
Hello,

You may want to have a look to antform:
http://antforms.sourceforge.net/

Regards,

Patrick M.

On 2/15/06, Rich Wagner [EMAIL PROTECTED] wrote:
 I was looking through the online Ant manual recently, looking for
 something like input, but which would display either an open or
 save dialog, i.e. what you typically see if you choose File: Open...
 or File: Save... in an application.  Alas, I found no such task, so I
 instead wrote tasks and targets which would use input and would ask
 the user to type paths: not as user-friendly...

 Has this sort of task ever been considered as an addition to Ant?

 (I realize Ant can't assume it's running on a machine with a display,
 mouse, etc.; i.e. that it may find itself on a headless computer.  But
 in that case this proposed input variation would resort to a
 stdout/stdout-based prompting...)

 Thanks in advance,
 Rich Wagner


 -
 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: input, but for paths...

2006-02-15 Thread Ivan \Rambius\ Ivanov
Hello Matt,

--- Matt Benson [EMAIL PROTECTED] wrote:
 Ivan,
 I had never read your entire article 
Oh, you have missed one of the most important
knowledge in the world :)

 as my own tests
 with Thread-based input obscuration yielded
 less-than-satisfactory results some years ago;
Hm, I made it work easily so it should not be
problematic. I originally found this idea at [1] and
later I found it at java.sun.com [2] as well.

 wanted to make sure you had seen the configurable IH
 support in
 svn HEAD though (like your section 5 according to
 the
 overview).  :)
This is great!!! I just take a look at both the code
in svn HEAD and in the docs and I saw it. Well, this
means  that I have to revise the article for 1.7.

May the source be with you
Ivan

[1]http://www.sap-img.com/java/hide-password-from-command-line.htm
[2]http://java.sun.com/developer/technicalArticles/Security/pwordmask/index.html

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

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



RE: AW: Broken Junit targets

2006-02-15 Thread Taemin Cim

Hi All,

Thanks so much for your help so far!  But the saga continues...
I tried Jans approach, as well as some others.
Steve suggested the -v option, so I'm going to lay it all out here.
There is four parts to this e-mail:
 Ant's output,
 build.xml
 properties.xml
 build.properties

I do feel a little awkward exposing my ineptitudes to the world like this.  
As although I use Ant, Junit and Java on Linux, I don't really understand 
everything about taskdefs, classloaders and bash, because when things work, 
I stick to the programming.


 One more thing:  When I type export $CLASSPATH, I get
bash: export: 
':/home/timmy/junit3.8.1/junit.jar:/home/timmy/packages/hibernate-extensions-2.1.3/tools:/home/timmy/packages/hibernate-3.0/lib:/home/timmy/packages/mysql-connector-java-3.0.17-ga': 
not a valid identifier


Should I be worried about the not a valid identifier' part?


Ant#347; output:

Apache Ant version 1.6.5 compiled on June 2 2005
Buildfile: build.xml
Detected Java version: 1.4 in: /usr/java/j2sdk1.4.2_08/jre
Detected OS: Linux
parsing buildfile /home/timmy/projects/applabsuser/build.xml with URI = 
file:///home/timmy/projects/applabsuser/build.xml

Project base dir set to: /home/timmy/projects/applabsuser
resolving systemId: file:///home/timmy/projects/applabsuser/properties.xml
Property ${dist.dir} has not been set
[property] Loading Environment env.
Override ignored for property ant.home
[property] Loading /home/timmy/projects/build.properties
[property] Unable to find property file: 
/home/timmy/projects/build.properties

[property] Loading /home/timmy/projects/lib/lib.properties
[property] Unable to find property file: 
/home/timmy/projects/lib/lib.properties

Property ${checkstyle.version} has not been set
Property ${checkstyle.version} has not been set
Build sequence for target(s) `test-batch' is [init, resources, 
test-resources, compile, test-init, test-compile, test-batch]
Complete build sequence is [init, resources, test-resources, compile, 
test-init, test-compile, test-batch, test-summary, setup-path, test-brief, 
javadoc, test, clean, dist, junit-commandline, test-xml, ]


init:
[echo] Building AppLabsUser
[echo] /

resources:
[echo] Copying Resources
[copy] AppLabsUser.hbm.xml omitted as AppLabsUser.hbm.xml is up to 
date.

[copy] build.properties omitted as build.properties is up to date.
[copy] build.xml omitted as build.xml is up to date.
[copy] hibernate-mapping.xml omitted as hibernate-mapping.xml is up to 
date.

[copy] hibernate.cfg.xml omitted as hibernate.cfg.xml is up to date.
[copy] hibernate.properties omitted as hibernate.properties is up to 
date.

[copy] properties.xml omitted as properties.xml is up to date.

test-resources:
[echo] Copying Test Resources

compile:
   [javac] org/applabs/hibernate/quickstart/AppLabsUser.java omitted as 
org/applabs/hibernate/quickstart/AppLabsUser.class is up to date.


test-init:
[copy]  omitted as  is up to date.
[copy] org omitted as org is up to date.
[copy] org/applabs omitted as org/applabs is up to date.
[copy] org/applabs/hibernate omitted as org/applabs/hibernate is up to 
date.
[copy] org/applabs/hibernate/quickstart omitted as 
org/applabs/hibernate/quickstart is up to date.
  [delete] Deleting directory 
/home/timmy/projects/applabsuser/build/test/data
  [delete] Deleting directory 
/home/timmy/projects/applabsuser/build/test/data
  [delete] Deleting directory 
/home/timmy/projects/applabsuser/build/test/reports
  [delete] Deleting directory 
/home/timmy/projects/applabsuser/build/test/reports

   [mkdir] Created dir: /home/timmy/projects/applabsuser/build/test/data
   [mkdir] Created dir: /home/timmy/projects/applabsuser/build/test/reports

test-compile:
   [javac] org/applabs/hibernate/quickstart/AppLabsUserTest.java omitted as 
org/applabs/hibernate/quickstart/AppLabsUserTest.class is up to date.


test-batch:

build.xml
-
?xml version=1.0?
!DOCTYPE project [
   !ENTITY properties SYSTEM ../applabsuser/properties.xml
]

project name=AppLabsUser
default=test-batch basedir=.

!-- Project settings --
property name=project.name value=${ant.project.name}/
property name=project.distname value=applabs/
property name=project.version value=0.3/
property name=project.version.jar value=0-3/
	property name=jarfile.name 
value=${project.distname}-${project.version}.jar/

property name=jarfile.path location=${dist.dir}/${jarfile.name}/
	property name=resource.path 
location=/home/timmy/projects/applabsuser/


 property name=junit.fork value=true/
 properties;

 path id=compile.classpath
   pathelement path =lib/hibernate3.jar/
   pathelement path =lib/commons-lang-1.0.1.jar/
   pathelement path =lib/commons-logging-1.0.4.jar/
 /path

 path id=test.classpath
   path refid=compile.classpath/
   pathelement location=${junit.jar}/
   pathelement 

Re: Property vs. user property - what's the difference?

2006-02-15 Thread Stefan Bodewig
On Wed, 15 Feb 2006, Patrick Martin [EMAIL PROTECTED] wrote:

 Could you explain the even more immutable part of your mail ?

Sure.

Properties are not immutable at all if you use Ant's Java API.  It's
just that (almost[1]) all of the built-in Ant tasks refuse to change
the value of an existing property.  But it is trivial to write a task
that changes the value of a property and in fact a lot of people and
projects have done so.

There are five property setting methods in Ant's Project class:

setNewProperty- sets a property, will never override an
existing one - user property or not.
Used by almost all built-in Ant tasks.
setProperty   - sets or overrides a property, will never override
a user property.  Used by available.
setPropertyInternal   - same as setProperty but without any warning if
it overrides a property.
setUserProperty   - sets or overrides a user property.  Used when
parsing the command line.
setInheritedProperty  - sets or overrides a user property.  Used for
property nested in Ant.

So both plain properties and user properties are in fact mutable
if you use the Ant API.  Only one of the five setter methods will not
overwrite an existing property, only two of them will overwrite an
existing user property - which makes user properties more immutable.

Stefan

Footnotes: 
[1]  Since I know I'll have to explain the almost, available will
 happily overwrite existing properties.



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



Re: test for directory existence

2006-02-15 Thread Stefan Bodewig
On Wed, 15 Feb 2006, Martin Gainty [EMAIL PROTECTED] wrote:

 *Not sure about delete*

it will fail if you tell it to delete something that isn't there -
unless you set the quite attribute to true in which case it will
simply do nothing.

 but I know mkdir will fail if the folder is already in place

No it won't.

,
| project
|   mkdir dir=foo/
|   mkdir dir=foo/
| /project
`

leads to

,
| [mkdir] Created dir: /tmp/foo
| 
| BUILD SUCCESSFUL
| Total time: 1 second
`

The task doesn't even issue a warning message.

Stefan

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



AW: input, but for paths...

2006-02-15 Thread Jan.Materne
This is great!!! I just take a look at both the code in svn 
HEAD and in the docs and I saw it. Well, this means  that I 
have to revise the article for 1.7.


Ask Steve - he is very happy to rewrite the book ;-)
Especially if 1.7 is not fixed. So something which is ok for now could
be impossible tomorrow...

Jan

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