Re: Multiple files to task

2007-01-20 Thread Peter Kennard
OK - convoluted nastiness but it works to make a quoted space 
delimited list of file names.


The two "commands" below are needed to translate all the '/' to 
${file.separator} s in the

original property which are coded with '/' separators. and expand it to
the full path so it will compare character for character with the
path built by the final fileset.


 




Now I can create the fileset for the source directory



 


this will "map out" the path to ""
and will put '" "' between every two entries





Now you just have to add the leading and trailing '"' and you have
a nice quoted space delimited list of files. (hopefully suitable for 
a command line="" argument in a  task :)




~
~


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



Re: Question about Classpath

2007-01-20 Thread Farid Izem

Hi julying,

My jdbc driver is in lib directory there is no problem.
My main problem is the simple build.xml script doesn't work at all
To specify the classpath :




   
   main project with many futures
   

   
   
   
   

   
   
   
   


i have still the problem with the classpath tag.

I can't see what i am doing wrong.

Thanks for you help.

Kind Regards,

Farid.

On 1/20/07, julying <[EMAIL PROTECTED]> wrote:



make sure your mysql connector is the right version to your driver class!
and you can use some ant debug tools to print the stracktrace of it's
procession to make sure
your lib is in !
--
julying
2007-01-20

-
发件人:Farid Izem
发送日期:2007-01-20 06:39:24
[EMAIL PROTECTED]
抄送:
主题:Question about Classpath

Hi all,

I'm new to ant and i d'like to make a connexion to a mysql database.
To do that, i hava done the following scripts :




   
   main project with many futures
   

   
   
   
   


   
   
   
   



But, i get the following error :

mysql:

BUILD FAILED
/LNXVOL01/projets/ESE/esepro02/build2.xml:19: Class Not Found: JDBC driver
com.mysql.jdbc.Driver could not be loaded

I try adding  in the mysql task
without success, i get the following error :

Buildfile: build2.xml

mysql:

BUILD FAILED
/LNXVOL01/projets/ESE/esepro02/build2.xml:14: Problem: failed to create
task
or type classpath
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any / declarations have taken
place.

Can anyone help solving this issue with the classpath element.

I'm using ant 1.7.0 and JVM 1.5.0_10-b03



Kind Regards,

Farid





Using antcall but not re-running dependent targets

2007-01-20 Thread Cameron McCormack
Hi.

I’ve got a build file that’s structured like this:

  

  

  

  


  

  
  

  
  

  
  

If I run "ant one" I get:

  jet:/tmp $ ant one
  Buildfile: build.xml

  init:
   [echo] something

  something:

  one:

  init:
   [echo] something

  two-other:

  BUILD SUCCESSFUL

but I want it so that the init target doesn’t get run again, because it
has already been run.  Is that just a limitation of antcall (that it
forgets which dependencies have already been run)?  If so, how I else
can I get this sort of flow control?

Thanks,

Cameron

-- 
Cameron McCormack, http://mcc.id.au/
xmpp:[EMAIL PROTECTED]  ▪  ICQ 26955922  ▪  MSN [EMAIL PROTECTED]

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



Re: java errors when running build file

2007-01-20 Thread Dalibor Topic
Steve Loughran  apache.org> writes:

> 
> Mike.Horn  wincanton.co.uk wrote:
> > Hello
> > 
> > HP-UX11i
> > Java 1.3
> > ANT v.1.7.0
> > 
> 
> > 
> > $ ant -f Unix_Build.xml
> > Buildfile: Unix_Build.xml
> >  [property] java.lang.reflect.InvocationTargetException: 
> > java.lang.IllegalArgume
> > ntException: Unknown signal: HUP
> >  [property] at sun.misc.Signal.(Unknown Source)
> >  [property] at java.lang.Terminator.setup(Unknown Source)

[snip]

> In smartfrog we have to wrap signal setup with an exception catcher, as 
> it fails earlly on on the kaffe JVMs. We catch it and warn that the tool 
> is not tested on those JVMs and so use at your own risk...

We don't have an implementation of sun.misc.Signal in Kaffe, I don't think it's
part of the standard API.

cheers,
dalibor topic


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



Re: Question about Classpath

2007-01-20 Thread Peter Reilly

The  task does not automaticylly use any
classpath reference defined in the build file, you
need to tell it about the classpath using in
this case the attribute classpathref

  

Peter

On 1/20/07, Farid Izem <[EMAIL PROTECTED]> wrote:

Hi julying,

My jdbc driver is in lib directory there is no problem.
My main problem is the simple build.xml script doesn't work at all
To specify the classpath :





main project with many futures













i have still the problem with the classpath tag.

I can't see what i am doing wrong.

Thanks for you help.

Kind Regards,

Farid.

On 1/20/07, julying <[EMAIL PROTECTED]> wrote:
>
>
> make sure your mysql connector is the right version to your driver class!
> and you can use some ant debug tools to print the stracktrace of it's
> procession to make sure
> your lib is in !
> --
> julying
> 2007-01-20
>
> -
> 发件人:Farid Izem
> 发送日期:2007-01-20 06:39:24
> [EMAIL PROTECTED]
> 抄送:
> 主题:Question about Classpath
>
> Hi all,
>
> I'm new to ant and i d'like to make a connexion to a mysql database.
> To do that, i hava done the following scripts :
>
>
> 
>
>
>main project with many futures
>
>
>
>
>
>
>
>
>
>driver="com.mysql.jdbc.Driver"
>url="jdbc:mysql//localhost:3306/BROWSE"
>userid="X"
>password="Y"
>>
>
>
>
> 
>
> But, i get the following error :
>
> mysql:
>
> BUILD FAILED
> /LNXVOL01/projets/ESE/esepro02/build2.xml:19: Class Not Found: JDBC driver
> com.mysql.jdbc.Driver could not be loaded
>
> I try adding  in the mysql task
> without success, i get the following error :
>
> Buildfile: build2.xml
>
> mysql:
>
> BUILD FAILED
> /LNXVOL01/projets/ESE/esepro02/build2.xml:14: Problem: failed to create
> task
> or type classpath
> Cause: The name is undefined.
> Action: Check the spelling.
> Action: Check that any custom tasks/types have been declared.
> Action: Check that any / declarations have taken
> place.
>
> Can anyone help solving this issue with the classpath element.
>
> I'm using ant 1.7.0 and JVM 1.5.0_10-b03
>
>
>
> Kind Regards,
>
> Farid
>
>
>



Re: Using antcall but not re-running dependent targets

2007-01-20 Thread Jacob Kjome


You can do it via scripting.  See this thread...
http://marc.theaimsgroup.com/?t=10758568804&r=1&w=2

...and specifically, this message...
http://marc.theaimsgroup.com/?l=ant-user&m=107589782422983&w=2


I added my own twist on it and made dependency 
following configurable (follows dependencies by 
default if not specified) along with optional 
"if" and "unless" attributes.  Actually, all the 
attributes are optional, even "target".  If 
"target" is either not defined or defined but 
doesn't exist in the build file, no action is 
performed instead of failing the build.  I 
intentionally made it very lenient to meet the 
needs of my project.  Note that this also avoids 
creating a whole separate Ant context like , 
, and  do, so properties created 
by the called target will continue to exist after 
it is called.  Here's my version.  I hope you find it useful...











Jake

At 04:59 AM 1/20/2007, you wrote:
>Hi.
>
>I’ve got a build file that’s structured like this:
>
>  
>
>  
>
>  
>
>  
>
>
>  
>
>  
>  
>
>  
>  
>
>  
>  
>
>If I run "ant one" I get:
>
>  jet:/tmp $ ant one
>  Buildfile: build.xml
>
>  init:
>   [echo] something
>
>  something:
>
>  one:
>
>  init:
>   [echo] something
>
>  two-other:
>
>  BUILD SUCCESSFUL
>
>but I want it so that the init target doesn’t get run again, because it
>has already been run.  Is that just a limitation of antcall (that it
>forgets which dependencies have already been run)?  If so, how I else
>can I get this sort of flow control?
>
>Thanks,
>
>Cameron
>
>--
>Cameron McCormack, http://mcc.id.au/
>   xmpp:[EMAIL PROTECTED]  â­ª  ICQ 26955922  â­ª  MSN [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: Using antcall but not re-running dependent targets

2007-01-20 Thread Cameron McCormack
Jacob Kjome:
> I added my own twist on it and made dependency 
> following configurable (follows dependencies by 
> default if not specified) along with optional 
> "if" and "unless" attributes.  Actually, all the 
> attributes are optional, even "target".  If 
> "target" is either not defined or defined but 
> doesn't exist in the build file, no action is 
> performed instead of failing the build.  I 
> intentionally made it very lenient to meet the 
> needs of my project.  Note that this also avoids 
> creating a whole separate Ant context like , 
> , and  do, so properties created 
> by the called target will continue to exist after 
> it is called.  Here's my version.  I hope you find it useful...

Cool, that seems useful.  Luckily, the project bundles js.jar anyway so
it need not be downloaded by users compiling.  I wonder why there’s no
build-in task to do this?

BTW is there anything other than js.jar that I need to put on the
classpath so that it will work?  Ant gives me the “Could not create task
or type of type: scriptdef” error.  I also put bsf.jar on the classpath
and still get the error.

Thanks,

Cameron

-- 
Cameron McCormack, http://mcc.id.au/
xmpp:[EMAIL PROTECTED]  ▪  ICQ 26955922  ▪  MSN [EMAIL PROTECTED]

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



Re: Using antcall but not re-running dependent targets

2007-01-20 Thread Ninju Bohra
Yes, 

The behavior you see is correct...there is an inherent limition of the 
 task becuase it starts a new ANT "cycle" and knowlegde of previous 
run targets (like your "init" target) are not retained. 

You can try many different solutions: 

First solution: 
1) Create a "property setting" target like the following 





  The key thing is to avoid the usage of the else attribute of the 
condition task, we DO NOT want the property to be defined only IF the OS is Mac 
OS X

2) Now add an "if" to your "two-mac" target --> so that it will only execute if 
the isMAC property is set

.
.
.

Now unfortunately, the way ANT is written the presence of an "if" 
attribute only controls the execution of the tasks within the target NOT the 
execution of the dependent targets (but we will fix soon enough)
3) Add an "unless" attribute to your "two-other" target --> so that it will 
only execute if the isMAC property is NOT set

.
.
.

4) Now adjust your "init" target to run the "determineOS" target in its depends 
list
5) Adjust your main target "one" to run the targets in order

.
.
.

And now instead of  off to another target (and incurring the 
cost of creating a new ANT "cycle") you are attempting to run both targets and 
based on the way they are protected (via the if/unless attributes) only one of 
them will run.
6) Along the same line, to make sure that the code of the "init" target is run 
only once you can add an "unless" attribute in its definition and set the 
property at the bottom of the target:

.
(really delicate stuff that can only be run once)
.








- Original Message  
From: Cameron McCormack <[EMAIL PROTECTED]> 
To: user@ant.apache.org 
Sent: Saturday, January 20, 2007 4:59:26 AM 
Subject: Using antcall but not re-running dependent targets 


Hi. 

I’ve got a build file that’s structured like this: 

 
 
 

 
 
 
 
 
 

 
 

 
 

 
 

If I run "ant one" I get: 

jet:/tmp $ ant one 
Buildfile: build.xml 

init: 
[echo] something 

something: 

one: 

init: 
[echo] something 

two-other: 

BUILD SUCCESSFUL 

but I want it so that the init target doesn’t get run again, because it 
has already been run. Is that just a limitation of antcall (that it 
forgets which dependencies have already been run)? If so, how I else 
can I get this sort of flow control? 

Thanks, 

Cameron 

-- 
Cameron McCormack, http://mcc.id.au/ 
xmpp:[EMAIL PROTECTED] ▪ ICQ 26955922 ▪ MSN [EMAIL PROTECTED] 

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


 

Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo! Games.
http://videogames.yahoo.com/platform?platform=120121

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



Re: Using antcall but not re-running dependent targets

2007-01-20 Thread Cameron McCormack
Hi Ninju.

Ninju Bohra:
> The behavior you see is correct...there is an inherent limition of the
>  task becuase it starts a new ANT "cycle" and knowlegde of
> previous run targets (like your "init" target) are not retained.
>
> You can try many different solutions: 
> 
> First solution: 
> 1) Create a "property setting" target like the following 
> 
> 
> 
> 
> 
>   The key thing is to avoid the usage of the else attribute of the
> condition task, we DO NOT want the property to be defined only IF the
> OS is Mac OS X
>
> 2) Now add an "if" to your "two-mac" target --> so that it will only execute 
> if the isMAC property is set
> 
> .
> .
> .
> 
> Now unfortunately, the way ANT is written the presence of an
> "if" attribute only controls the execution of the tasks within the
> target NOT the execution of the dependent targets (but we will fix
> soon enough)

Yes that is the problem I ran into when structuring my targets with
'if's, and switched to using antcalls.  The ability to have dependent
targets not executed if the target is not to be executed would be a
welcome addition.

> 6) Along the same line, to make sure that the code of the "init"
>target is run only once you can add an "unless" attribute in its
>definition and set the property at the bottom of the target:
>
> 
> .
> (really delicate stuff that can only be run once)
> .
> 
> 

Ah that’s a good workaround.

Thanks,

Cameron

-- 
Cameron McCormack, http://mcc.id.au/
xmpp:[EMAIL PROTECTED]  ▪  ICQ 26955922  ▪  MSN [EMAIL PROTECTED]

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



Re: Using antcall but not re-running dependent targets

2007-01-20 Thread Jacob Kjome

At 09:49 PM 1/20/2007, you wrote:
>Jacob Kjome:
>> I added my own twist on it and made dependency
>> following configurable (follows dependencies by
>> default if not specified) along with optional
>> "if" and "unless" attributes.  Actually, all the
>> attributes are optional, even "target".  If
>> "target" is either not defined or defined but
>> doesn't exist in the build file, no action is
>> performed instead of failing the build.  I
>> intentionally made it very lenient to meet the
>> needs of my project.  Note that this also avoids
>> creating a whole separate Ant context like ,
>> , and  do, so properties created
>> by the called target will continue to exist after
>> it is called.  Here's my version.  I hope you find it useful...
>
>Cool, that seems useful.  Luckily, the project bundles js.jar anyway so
>it need not be downloaded by users compiling.  I wonder why there’s no
>build-in task to do this?
>
>BTW is there anything other than js.jar that I need to put on the
>classpath so that it will work?  Ant gives me the “Could not create task
>or type of type: scriptdef” error.  I also put bsf.jar on the classpath
>and still get the error.
>

Versions matter.  I have BSF-2.3.0.jar and 
js-1.5R3.jar in ${user.home}/.ant/lib.  Using a 
later version of js.jar with BSF-2.3.0 won't 
work.  If you want to use a newer version of 
javascript, then upgrade to BSF-2.4.0 and grab 
the latest js.jar.  Of course, BSF-2.4.0 has a 
new dependency on commons-logging.jar, so you'll 
need to have that in .ant/lib as well.  And if 
you care about the logging, this would require a 
logging implementation to be available where 
commons-logging can see it, such as JDK14+ 
logging or putting something like Log4j.jar in 
.ant/lib as well.  Why they added the 
commons-logging dependency is beyond me!!!


If BSF becomes a standard extension, then 
commons-logging needs to become a standard 
extension, which requires your preferred logging 
implementation to be a standard extension, which 
really sucks because now the only option to 
perform logging separation is to, at least in 
Log4j's case, install a custom repository 
selector (which can be problematic and is 
understood by very few out there).  I'm sticking 
with the older BSF-2.3.0 until they realize what 
a terrible decision they made and release a new 
BSF version without a commons-logging dependency 
(hint, hint, hint BSF developers).



Jake

>Thanks,
>
>Cameron
>
>--
>Cameron McCormack, http://mcc.id.au/
>   xmpp:[EMAIL PROTECTED]  â­ª  ICQ 26955922  â­ª  MSN [EMAIL PROTECTED]
>


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