Re: Copy a directory list

2006-01-23 Thread Frank Harnack
Another ant-contrib solution may be using the for task:















Regards

Frank

Quoting Ken Gentle <[EMAIL PROTECTED]>:

> At 15:57 2006-01-21, you wrote:
> > >   Here is the error: the includes attribute should contain patterns
> > > matching the file names you want copied.
> > > The patterns only match the directories.
> > >   Try: includes="**/*.jar""
> >
> >Tommy,
> >
> >I know where the error is my real problem is the property friving
> >the selector
> >needs to be a comma separated list which describes the configurations to
> >deploy. I want to use that value to drive the copy. In other words changing
> >the comma separated values to resemble a patternset pattern is not an
> option.
> >So that leaves me with few options. I can define some custom task to do a
> >regex replace on the property value appending "/**/*" sequences on each
> entry
> >or I can use beanshell with a script task to  do the same. Neither of those
> >options are what I consider appealing. I thought I might be overlooking some
> >simple functionality in Ant when I ran into the problem but it just doesn't
> >seem to easy to copy directories specified in a CSV list without exposing
> >patternset syntax to the creator of the list.
>
> This will load the file and do the replacements:
>
> 
>
>   property="confs-to-deploy-pattern">
>
>  
>
>  flags="g"
>  replace="\1/** "/>
>  
>
>
>  
>  ${confs-to-deploy-pattern}
>
> 
>
> [EMAIL PROTECTED] $ ant -f prop-regex.xml
> Buildfile: prop-regex.xml
>
> default:
>   [echo] default/** debug/** prod/**
>
> BUILD SUCCESSFUL
> Total time: 0 seconds
>
>
> Or if you already have the property and you're open to AntContrib
> tasks, you can use the PropertyRegex to do the replacements:
>
> 
>
>  
> location="../lib/build/ant-contrib-1.0b2/lib/ant-contrib.jar"/>
>  
>
>
>
>  
>   input="${confs-to-deploy}"
> regexp="([^,]+),?"
> replace="\1/** " />
>  ${confs-to-deploy-pattern}
>
> 
>
> [EMAIL PROTECTED] $ ant -f prop-regex.xml
> Buildfile: prop-regex.xml
>
> default:
>   [echo] default/** debug/** prod/**
>
> BUILD SUCCESSFUL
> Total time: 0 seconds
>
> >---
> >Clifton C. Craig, Software Engineer
> >Intelligent Computer Systems -  A Division of GBG
> >[EMAIL PROTECTED]
> >[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]



AW: SUSPECT: RE: How to exclude files with same pattern except on e

2006-01-23 Thread Kasparek, Bernadette
Hi,

yes it works.

Thanks,

Bernadette

-Ursprüngliche Nachricht-
Von: Stephen McConnell [mailto:[EMAIL PROTECTED] 
Gesendet: Montag, 23. Januar 2006 06:08
An: 'Ant Users List'
Betreff: SUSPECT: RE: How to exclude files with same pattern except one


 

> -Original Message-
> From: Kasparek, Bernadette [mailto:[EMAIL PROTECTED]
> Sent: Saturday, 21 January 2006 12:01 AM
> To: 'user@ant.apache.org'
> Subject: How to exclude files with same pattern except one
> 
> Hi everybody,
> 
> I've the following problem:
> I've got a list of some hundred files with pattern "index_xxx*". Now I 
> want to pack only the files with pattern "index_999*" (about 6
> instances) all others should be excluded.
> 
> I tried the following:
>basedir="dist"
>   includes="index_9950*"
>   excludes="index_*"
> />

Havn't tried this but what happends if you just do:

 

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

Convert fileset into command-line args, allowing for spaces in directories

2006-01-23 Thread Javier Pavier

Hi,
probably some obvious answer :-) but I cant find it.

I have a fileset, and i have a variable defining includes, and one defining 
excludes. The fileset is created like this. This works fine.



   
   
   
   
   

   
   
   
   
   


I now want to pass all of these files into a java task as command line args. 
I'm getting lots of problems whenever I have spaces in the directory or file 
names.


I've tried

which will semicolon separate my files for me ... ok, but how do I then get 
these as command line args on a  task ?




   ...

   


which passes them in with either : or ; as a separator (which isn't what I 
want). I need each file to be a separate argument to the application. Is 
there some way of iterating through the fileset or some other way of 
achieving this so that I get the spaces preserved in the arguments and the 
correct number of arguments etc.


Thanks in advance!

_
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/



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



AW: Convert fileset into command-line args, allowing for spaces in directories

2006-01-23 Thread Jan.Materne
>I have a fileset, and i have a variable defining includes, and 
>one defining excludes. The fileset is created like this. This 
>works fine.
>
>
>
>
>
>
>
>
>
>
>
>
>
>


hmm, dont know what this stuff should do. But if it works for you,
I can skip that ...



>refid="my.files"/> which will semicolon separate my files for 
>me ... ok, but how do I then get these as command line args on 
>a  task ?

One string will be passed to main(String[]) when using  have
to have a look what  would do.

You can use


to get a space separated (and quoted) path.




"A string that will be treated as a path-like string as a single
command-line argument; you can use ; or : as path separators and Ant
will convert it to the platform's local conventions."

Have you tried what comes?



BTW - have you tried ?



Jan

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



Re: Copy a directory list

2006-01-23 Thread Clifton Craig
See, herein lies the problem. I'm not open to Ant-contrib. I'm what you might 
call a purest. I believe that this should be possible using vanilla Ant 
declarative syntax. I refuse to muddy up my build with forced procedural 
logic when it doesn't need to be included. I don't have the list in a file 
nor do I want it in a file. The idea is that the caller should not need to be 
exposed to patternset syntax and should only need to pass in a list 
(separated by commas), of configurations to deploy. The configurations are 
coincident with the names of subfolders containing the projects dependencies. 
The target in question needs to take the list of configurations and deploy 
from all of the subfolders indicated by the list. I could make it such that 
the list didn't tie directly to the folder naming scheme, rather it specified 
individual target names to invoke, but in the interest of doing the simplest 
thing that works I'm trying to incrementally work my way towards that point 
if it is at all necessary.
--- 
Clifton C. Craig, Software Engineer
Intelligent Computer Systems -  A Division of GBG
[EMAIL PROTECTED]
[EMAIL PROTECTED]

On Sunday 22 January 2006 12:50 am, Ken Gentle wrote:
> At 15:57 2006-01-21, you wrote:
> > >   Here is the error: the includes attribute should contain patterns
> > > matching the file names you want copied.
> > > The patterns only match the directories.
> > >   Try: includes="**/*.jar""
> >
> >Tommy,
> >
> >I know where the error is my real problem is the property friving
> >the selector
> >needs to be a comma separated list which describes the configurations to
> >deploy. I want to use that value to drive the copy. In other words
> > changing the comma separated values to resemble a patternset pattern is
> > not an option. So that leaves me with few options. I can define some
> > custom task to do a regex replace on the property value appending "/**/*"
> > sequences on each entry or I can use beanshell with a script task to  do
> > the same. Neither of those options are what I consider appealing. I
> > thought I might be overlooking some simple functionality in Ant when I
> > ran into the problem but it just doesn't seem to easy to copy directories
> > specified in a CSV list without exposing patternset syntax to the creator
> > of the list.
>
> This will load the file and do the replacements:
>
> 
>
>   property="confs-to-deploy-pattern">
>
>  
>
>  flags="g"
>  replace="\1/** "/>
>  
>
>
>  
>  ${confs-to-deploy-pattern}
>
> 
>
> [EMAIL PROTECTED] $ ant -f prop-regex.xml
> Buildfile: prop-regex.xml
>
> default:
>   [echo] default/** debug/** prod/**
>
> BUILD SUCCESSFUL
> Total time: 0 seconds
>
>
> Or if you already have the property and you're open to AntContrib
> tasks, you can use the PropertyRegex to do the replacements:
>
> 
>
>  
> location="../lib/build/ant-contrib-1.0b2/lib/ant-contrib.jar"/>
>  
>
>
>
>  
>   input="${confs-to-deploy}"
> regexp="([^,]+),?"
> replace="\1/** " />
>  ${confs-to-deploy-pattern}
>
> 
>
> [EMAIL PROTECTED] $ ant -f prop-regex.xml
> Buildfile: prop-regex.xml
>
> default:
>   [echo] default/** debug/** prod/**
>
> BUILD SUCCESSFUL
> Total time: 0 seconds
>
> >---
> >Clifton C. Craig, Software Engineer
> >Intelligent Computer Systems -  A Division of GBG
> >[EMAIL PROTECTED]
> >[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: Convert fileset into command-line args, allowing for spaces in directori

2006-01-23 Thread Javier Pavier

Hi,


hmm, dont know what this stuff should do. But if it works for you,
I can skip that ...


It just creates fileset of the files I need. It works :-)


>refid="my.files"/> which will semicolon separate my files for
>me ... ok, but how do I then get these as command line args on
>a  task ?

One string will be passed to main(String[]) when using  have
to have a look what  would do.


I don't want one string. I want each file to be passed as a separate command 
line arg.
The application cannot be changed. It takes args in and each file should be 
a separate arg.


If I use  I get the problems with spaces being used for 
separating the files and so Ant splits the files at incorrect places.


If I use  it passes a single command line arg.

Lets give an example, if my FileSet has
/my/file/with a space/file1
/my/file/withoutaspace/file2

I want these both passed in as they are there as 2 separate commandline 
args.



Thanks for your response.

_
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/



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



Creating a task for getting the current target in a project

2006-01-23 Thread none ofyourbusiness

hi,

In our ant script we do an antcall at a certain moment. This antcall call's 
another xml ant script with a specific target. This called xml ant script 
contains a project with mulitple targets, and outside those targets, it also 
checks for the availability of certain 3th party jars and puts there path in 
properties.


This all works very well for most targets (fe: build, compile, pre-compile, 
etc), but for some targets (fe package and clean) these 3th party jars are 
not required. This causes these 2 targets to fail...


Thats why we would like to make these dependancies optional for these 2 
targets. We would like check for the availibilty of these jars only if the 
target is something else then "clean" or "package"


so first i looked for a system property that gives the current target, but 
that doesnt seem to exist. After this i tried making a task for this myself, 
but i couldnt get it working...


I hope someone of you could help me with this...

I tried using following methods:

getOwningTarget
--> works, but only when the task is called in the target itself
since we need it outside the target, this method is useless

getCurrentTarget
--> allways gives back value null

getImplicitTarget
--> result isnt null, but a toString() of the target results gives ""

So i didnt achieve much... :/

below you can find a copy of the source that ive been playing around with:

package com.eds.ant.taskdefs;

import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.helper.AntXMLContext;

public class CurrentTarget extends Task {

private String addproperty = null;

   /**
* Defines the name of a property to be created from input. Behaviour is
* according to property task which means that existing properties
* cannot be overridden.
*
* @param addproperty Name for the property to be created from input
*/
   public void setAddproperty(String addproperty) {
   this.addproperty = addproperty;
   }

   /**
* Actual method executed by ant.
*
* @throws BuildException on error
*/
   public void execute() throws BuildException {
if (addproperty == null || "".equals(addproperty.trim()))
throw new BuildException("Property 'addproperty' was not 
set.");
Project project = getProject();
System.out.println(project.toString());
		AntXMLContext context = (AntXMLContext) 
project.getReference("ant.parsing.context");

context = new AntXMLContext(project);
System.out.println(context.toString());
org.apache.tools.ant.Target target1 = 
context.getImplicitTarget();
org.apache.tools.ant.Target target2 = 
context.getCurrentTarget();
org.apache.tools.ant.Target target3 = getOwningTarget();
String value = null;
if (target1 != null) {
value = target1.toString();
System.out.println("getimptar isnt empty " + value);
} else {
System.out.println("getimptar is empty");
}
if (target2 != null) {
value = target2.toString();
System.out.println("getcurtar isnt empty " + value);
} else {
System.out.println("getcurtar is empty");
}
if (target3 != null) {
value = target3.toString();
System.out.println("getowntar isnt empty " + value);
} else {
System.out.println("getowntar is empty");
}

System.out.println(value);
   if (addproperty != null && value != null) {
   getProject().setNewProperty(addproperty, value);
   }
   }

}

_
Bescherm je Inbox: Phishing - hoe te herkennen, rapporteren en voorkomen
http://www.msn.be/security/phishing/



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



Re: Unit test a build

2006-01-23 Thread Clifton Craig
On Sunday 22 January 2006 4:55 pm, Steve Loughran wrote:
> Clifton Craig wrote:
> > Given my passion for TDD I am now looking for a way to apply unit tests
> > to my Ant build files. Is there an easy way or framework I can use?
>
> you need the antunit test framework; its in Ant's SVN repo. Its really
> for testing tasks, but comes with a good set of assertions
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
Steve,

Great idea. However, I'm a little lost. I have a source distribution of 
Ant-1.6.5 that I'm working with and I can't figure out where the antunit test 
framework begins and where the the actual test cases end.
--- 
Clifton C. Craig, Software Engineer
Intelligent Computer Systems -  A Division of GBG
[EMAIL PROTECTED]
[EMAIL PROTECTED]

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



RE: Convert fileset into command-line args, allowing for spaces in directori

2006-01-23 Thread Javier Pavier

Lets give an example, if my FileSet has
/my/file/with a space/file1
/my/file/withoutaspace/file2

I want these both passed in as they are there as 2 separate commandline 
args.


I managed to achieve this at last since I'm using a Jelly file and so can 
use a Jelly tokenizer to split the path apart and iterate through it. Still 
no idea how people are supposed to do this with Ant!


Thanks anyway

_
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/



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



Re: Unit test a build

2006-01-23 Thread Steve Loughran

Clifton Craig wrote:

On Sunday 22 January 2006 4:55 pm, Steve Loughran wrote:

Clifton Craig wrote:

Given my passion for TDD I am now looking for a way to apply unit tests
to my Ant build files. Is there an easy way or framework I can use?

you need the antunit test framework; its in Ant's SVN repo. Its really
for testing tasks, but comes with a good set of assertions

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

Steve,

Great idea. However, I'm a little lost. I have a source distribution of 
Ant-1.6.5 that I'm working with and I can't figure out where the antunit test 
framework begins and where the the actual test cases end.


the antunit sub project creates a library, called something like 
antunit.jar, that contains an antlib with all the test cases and things 
in. If you look through the source for the resource antlib.xml you'll 
find out the tasks it offers, and the URL to use to call it. just add 
the lib to ant's classpath, declare a namespace with the antlib: url and 
use the tasks on demand.


-steve


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



ant and os

2006-01-23 Thread Marc Collin
hi

i search a way to do:

exec rmiregistry.exe if windows
else exec rmiregistry

any idea?

thanks
-- 
www.laboiteaprog.com

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



Re: Copy a directory list

2006-01-23 Thread Ken Gentle
Just for the record, the word is "purist" - Mary, Mother of Jesus, is 
reported to have be "the purest".  :)


Um, Clifton, the first solution I showed you is 100%, pure, core 
ANT.  It does involve a file read.  I have a similar issue in my 
current project that necessitates writing properties to a file so 
that they can be read back in as tokens.  A bit of a pain, but a 
macrodef and preset def handle it quite well.


scriptdef is 100% pure ant as well; do it in your scripting language 
of choice and hand it back.


There are ways around this problem.  They are workarounds.

I wish I had such tools to work around bugs (and I mean DEFECTS in 
IDEA) - ant is really, amazingly, quite flexible.


Ken


At 09:03 2006-01-23, you wrote:

See, herein lies the problem. I'm not open to Ant-contrib. I'm what you might
call a purest. I believe that this should be possible using vanilla Ant
declarative syntax. I refuse to muddy up my build with forced procedural
logic when it doesn't need to be included. I don't have the list in a file
nor do I want it in a file. The idea is that the caller should not need to be
exposed to patternset syntax and should only need to pass in a list
(separated by commas), of configurations to deploy. The configurations are
coincident with the names of subfolders containing the projects dependencies.
The target in question needs to take the list of configurations and deploy
from all of the subfolders indicated by the list. I could make it such that
the list didn't tie directly to the folder naming scheme, rather it specified
individual target names to invoke, but in the interest of doing the simplest
thing that works I'm trying to incrementally work my way towards that point
if it is at all necessary.
---
Clifton C. Craig, Software Engineer
Intelligent Computer Systems -  A Division of GBG
[EMAIL PROTECTED]
[EMAIL PROTECTED]

On Sunday 22 January 2006 12:50 am, Ken Gentle wrote:
> At 15:57 2006-01-21, you wrote:
> > >   Here is the error: the includes attribute should contain patterns
> > > matching the file names you want copied.
> > > The patterns only match the directories.
> > >   Try: includes="**/*.jar""
> >
> >Tommy,
> >
> >I know where the error is my real problem is the property friving
> >the selector
> >needs to be a comma separated list which describes the configurations to
> >deploy. I want to use that value to drive the copy. In other words
> > changing the comma separated values to resemble a patternset pattern is
> > not an option. So that leaves me with few options. I can define some
> > custom task to do a regex replace on the property value appending "/**/*"
> > sequences on each entry or I can use beanshell with a script task to  do
> > the same. Neither of those options are what I consider appealing. I
> > thought I might be overlooking some simple functionality in Ant when I
> > ran into the problem but it just doesn't seem to easy to copy directories
> > specified in a CSV list without exposing patternset syntax to the creator
> > of the list.
>
> This will load the file and do the replacements:
>
> 
>
>   property="confs-to-deploy-pattern">
>
>  
>
>  flags="g"
>  replace="\1/** "/>
>  
>
>
>  
>  ${confs-to-deploy-pattern}
>
> 
>
> [EMAIL PROTECTED] $ ant -f prop-regex.xml
> Buildfile: prop-regex.xml
>
> default:
>   [echo] default/** debug/** prod/**
>
> BUILD SUCCESSFUL
> Total time: 0 seconds
>
>
> Or if you already have the property and you're open to AntContrib
> tasks, you can use the PropertyRegex to do the replacements:
>
> 
>
>  
> location="../lib/build/ant-contrib-1.0b2/lib/ant-contrib.jar"/>
>  
>
>
>
>  
>   input="${confs-to-deploy}"
> regexp="([^,]+),?"
> replace="\1/** " />
>  ${confs-to-deploy-pattern}
>
> 
>
> [EMAIL PROTECTED] $ ant -f prop-regex.xml
> Buildfile: prop-regex.xml
>
> default:
>   [echo] default/** debug/** prod/**
>
> BUILD SUCCESSFUL
> Total time: 0 seconds
>
> >---
> >Clifton C. Craig, Software Engineer
> >Intelligent Computer Systems -  A Division of GBG
> >[EMAIL PROTECTED]
> >[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]




-
To unsubscribe, e

No supported regular expression matcher found

2006-01-23 Thread Benjamin Podszun

Hi there.

I'm using the propertyregex task - or at least I'd love to. I get the  
exception given in the message subject when I try to run ant with my  
buildfile.
I'm using java 1.5 and rely on regexps quite heavily.. Since the  
platform supports them: What's the dependency here? Checking google  
made me download the latest jar from jakarta-oro, but neither putting  
it in my projects library dir nor in the ${ant.home}/lib directory  
resolved this issue.

Can anyone provice some insight? Thanks in advance,

Ben

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



RE: sshexec fix for ant1.7 question

2006-01-23 Thread Anderson, Rob (Global Trade)
Which option is better really depends on a lot of things.

I would patch 1.6.5.

-Rob Anderson

> -Original Message-
> From: glenn opdycke-hansen [mailto:[EMAIL PROTECTED] 
> Sent: Sunday, January 22, 2006 7:37 AM
> To: user@ant.apache.org
> Subject: sshexec fix for ant1.7 question
> 
> I have a followup question on the fix for sshexec fix mentioned below:
> 
> glenn opdycke-hansen wrote:
> > Steve,
> > I have been looking at using Ant for application deployment 
> to multiple servers.
> > I see there is a known problem with ant 1.6.5 where a 
> sshexec request 
> > will close stdout.  This can be patched, but this problem is pretty 
> > serious since multiple sshexec requests would be needed.
> 
> To start using sshexec with the fix, would it be better to patch ant
> 1.6.5 with that fix or to get a beta copy of ant 1.7?
> 
> --glenn
> 
> -
> 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: Copy a directory list

2006-01-23 Thread Matt Benson


--- Ken Gentle <[EMAIL PROTECTED]> wrote:

> Just for the record, the word is "purist" - Mary,
> Mother of Jesus, is 
> reported to have be "the purest".  :)

Hmm.  Purism regarding use of the word "purist".  We
may end up with another "misspelt is misspelled"
argument on our hands.  I do agree your tone, CC, was
getting a little heated.  Anyway, take a look at the
attached, 100% pure Ant (1.6.5) buildfile to see some
ideas you might have missed.

HTH,
Matt


__
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: ant and os

2006-01-23 Thread Andrew Goktepe




Then have the script act according to whether or not running.on.windows is
set.

You can also use the os attribute of exec, but there are multiple OS values
for multiple versions of Windows.

-Andrew

On 1/23/06, Marc Collin <[EMAIL PROTECTED]> wrote:
>
> hi
>
> i search a way to do:
>
> exec rmiregistry.exe if windows
> else exec rmiregistry
>
> any idea?
>
> thanks
> --
> www.laboiteaprog.com
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: No supported regular expression matcher found

2006-01-23 Thread Antoine Levy-Lambert
Hello Benjamin,

I did not look into the source code of the propertyregex task (from
ant-contrib), but if it behaves like other regular expression based ant
tasks,
maybe it uses the same mechanism like ant to find out a regular
expression implementation.

The property |ant.regexp.regexpimpl| governs which regular expression
implementation will be chosen. Possible values for this property are :

* org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp
* org.apache.tools.ant.util.regexp.JakartaOroRegexp
* org.apache.tools.ant.util.regexp.JakartaRegexpRegexp



http://ant-contrib.sourceforge.net/tasks/tasks/propertyregex.html

Cheers,
Antoine

Benjamin Podszun wrote:

> Hi there.
>
> I'm using the propertyregex task - or at least I'd love to. I get the 
> exception given in the message subject when I try to run ant with my 
> buildfile.
> I'm using java 1.5 and rely on regexps quite heavily.. Since the 
> platform supports them: What's the dependency here? Checking google 
> made me download the latest jar from jakarta-oro, but neither putting 
> it in my projects library dir nor in the ${ant.home}/lib directory 
> resolved this issue.
> Can anyone provice some insight? Thanks in advance,
>
> Ben
>
> -
> 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: Unit test a build

2006-01-23 Thread Antoine Levy-Lambert
Clifton Craig wrote:

>On Sunday 22 January 2006 4:55 pm, Steve Loughran wrote:
>  
>
>>Clifton Craig wrote:
>>
>>
>>>Given my passion for TDD I am now looking for a way to apply unit tests
>>>to my Ant build files. Is there an easy way or framework I can use?
>>>  
>>>
>>you need the antunit test framework; its in Ant's SVN repo. Its really
>>for testing tasks, but comes with a good set of assertions
>>
>>
>>
>Steve,
>
>Great idea. However, I'm a little lost. I have a source distribution of 
>Ant-1.6.5 that I'm working with and I can't figure out where the antunit test 
>framework begins and where the the actual test cases end.
>  
>
Hello,

the antunit tests did not exist yet when ant 1.6.5 was released. You
would have to download the source from subversion.

see this web page .
http://ant.apache.org/svn.html

Cheers,

Antoine

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



Re: Convert fileset into command-line args, allowing for spaces in directori

2006-01-23 Thread Dominique Devienne
On 1/23/06, Javier Pavier <[EMAIL PROTECTED]> wrote:
> >Lets give an example, if my FileSet has
> >/my/file/with a space/file1
> >/my/file/withoutaspace/file2
> >
> >I want these both passed in as they are there as 2 separate commandline
> >args.
>
> I managed to achieve this at last since I'm using a Jelly file and so can
> use a Jelly tokenizer to split the path apart and iterate through it. Still
> no idea how people are supposed to do this with Ant!

 with its 'parallel' attribute might be what you want. It forks
a separate process though, so would work only if you are using 
or .

--DD

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



Re: Copy a directory list

2006-01-23 Thread Clifton Craig
Embarassing! Ok, some I misspelt purest. (Or is that misspelled purist.) 
Admitting that I'm not the purest I sought out to be ;) I must clarify that 
my tone was not intended as a heated tone. It is hard to express or 
interperet tone in text so let me assure you all that I'm not angry at 
anybody. I mentioned my purism to convey that I am not in favor of using 
Antcontrib to coerce procedural logic into what should be a declarative build 
system. I take such a stance on that as I've made that mistake (and paid for 
it) the first time I used Ant. Back to the topic. I feel as though (or felt 
as though) there should be a simpler solution for what I'm trying to do. 
That's all. Nothing wrong with any of the responses I've received so far, I'm 
just looking for the cleanest solution for my new prestine build system. What 
I'm learning is that I may need to back track and take a whole different look 
at my current situation of no such solution exists. I don't like the idea of 
hacking patternset syntax into a property if there is no such tool to take 
care of this for me. My feeling is that once you have to start reading a 
property into a file and back into a property you've taken a wrong step 
somewhere and things should be able to be done better.  My take away from all 
of this is that there is no such way to easily copy a list of folders 
separated by commas and include their contents. Simple is being defined as 
not requiring the list be swapped to disk, not requiring third party 
extensions installed to the base, and not requiiring custom ant tasks or 
procedural logic as each of these approaches involve additional functionality 
that is not part of the base set. Once again not trying to sound "heated" but 
trying to clarify my position. It is also sometimes hard to not sound or be 
interpreted as "heated" when those who is help misunderstand the context of 
the question requiring the question be repeated for clarity. The fault, I 
suppose, lies entirely on me as I should be more specific when I post.
--- 
Clifton C. Craig, Software Engineer
Intelligent Computer Systems -  A Division of GBG
[EMAIL PROTECTED]
[EMAIL PROTECTED]

On Monday 23 January 2006 12:41 pm, Matt Benson wrote:
> --- Ken Gentle <[EMAIL PROTECTED]> wrote:
> > Just for the record, the word is "purist" - Mary,
> > Mother of Jesus, is
> > reported to have be "the purest".  :)
>
> Hmm.  Purism regarding use of the word "purist".  We
> may end up with another "misspelt is misspelled"
> argument on our hands.  I do agree your tone, CC, was
> getting a little heated.  Anyway, take a look at the
> attached, 100% pure Ant (1.6.5) buildfile to see some
> ideas you might have missed.
>
> HTH,
> Matt
>
>
> __
> 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: Copy a directory list

2006-01-23 Thread Matt Benson


--- Clifton Craig <[EMAIL PROTECTED]> wrote:

[SNIP]
> ;) I must clarify that 
> my tone was not intended as a heated tone. It is
> hard to express or 
> interperet tone in text so let me assure you all
> that I'm not angry at 
> anybody.

Okay, sorry for the misinterpretation... :)

[SNIP]
> I don't like the idea of 
> hacking patternset syntax into a property if there
> is no such tool to take 
> care of this for me. My feeling is that once you
> have to start reading a 
> property into a file and back into a property you've
> taken a wrong step 
> somewhere and things should be able to be done
> better.

Agreed; I hate temp files, and many of the changes I
have made in Ant can be traced back to that simple
fact.

>  My take away from all 
> of this is that there is no such way to easily copy
> a list of folders 
> separated by commas and include their contents.
> Simple is being defined as 
> not requiring the list be swapped to disk, not
> requiring third party 
> extensions installed to the base, and not requiiring
> custom ant tasks or 
> procedural logic as each of these approaches involve
> additional functionality 
> that is not part of the base set. 

Hmm... my solution involved nothing but built-in Ant. 
Pathconvert was used to turn your list of directories
into a patternset.  The most "foreign" material used
was a regexp mapper... which should be included w/o
add-ons if you're using JDK>= 1.4 ... what more do you
want?  ;)

-Matt

[SNIP]

__
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: Copy a directory list

2006-01-23 Thread Matt Benson
Just because I'm a bastard who can't shut up, I'll
even boil my example (which may have been obscured by
setup and testing) down to a macro:


  
  
  
  

  

  
  


  


  

  


best I can do for now, until we have local properties
for macrodefs.

-Matt

--- Matt Benson <[EMAIL PROTECTED]> wrote:

> 
> 
> --- Clifton Craig <[EMAIL PROTECTED]> wrote:
> 
> [SNIP]
> > ;) I must clarify that 
> > my tone was not intended as a heated tone. It is
> > hard to express or 
> > interperet tone in text so let me assure you all
> > that I'm not angry at 
> > anybody.
> 
> Okay, sorry for the misinterpretation... :)
> 
> [SNIP]
> > I don't like the idea of 
> > hacking patternset syntax into a property if there
> > is no such tool to take 
> > care of this for me. My feeling is that once you
> > have to start reading a 
> > property into a file and back into a property
> you've
> > taken a wrong step 
> > somewhere and things should be able to be done
> > better.
> 
> Agreed; I hate temp files, and many of the changes I
> have made in Ant can be traced back to that simple
> fact.
> 
> >  My take away from all 
> > of this is that there is no such way to easily
> copy
> > a list of folders 
> > separated by commas and include their contents.
> > Simple is being defined as 
> > not requiring the list be swapped to disk, not
> > requiring third party 
> > extensions installed to the base, and not
> requiiring
> > custom ant tasks or 
> > procedural logic as each of these approaches
> involve
> > additional functionality 
> > that is not part of the base set. 
> 
> Hmm... my solution involved nothing but built-in
> Ant. 
> Pathconvert was used to turn your list of
> directories
> into a patternset.  The most "foreign" material used
> was a regexp mapper... which should be included w/o
> add-ons if you're using JDK>= 1.4 ... what more do
> you
> want?  ;)
> 
> -Matt
> 
> [SNIP]
> 
> __
> 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]
> 
> 


__
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: Copy a directory list

2006-01-23 Thread Clifton Craig
Matt,
That's not bad! Thanx for the tip. I haven't tried it yet but I'm sure it will 
most likely work. I'll work that into my build once I fix an unrelated bug 
that was dropped into my lap a moment ago. Thanx again.
--- 
Clifton C. Craig, Software Engineer
Intelligent Computer Systems -  A Division of GBG
[EMAIL PROTECTED]
[EMAIL PROTECTED]

On Monday 23 January 2006 12:41 pm, Matt Benson wrote:
> --- Ken Gentle <[EMAIL PROTECTED]> wrote:
> > Just for the record, the word is "purist" - Mary,
> > Mother of Jesus, is
> > reported to have be "the purest".  :)
>
> Hmm.  Purism regarding use of the word "purist".  We
> may end up with another "misspelt is misspelled"
> argument on our hands.  I do agree your tone, CC, was
> getting a little heated.  Anyway, take a look at the
> attached, 100% pure Ant (1.6.5) buildfile to see some
> ideas you might have missed.
>
> HTH,
> Matt
>
>
> __
> 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: Copy a directory list

2006-01-23 Thread Clifton Craig
Sorry Matt, I don't believe I read your reply correctly. I'll go back and 
re-read then post again. Thanx!

On Monday 23 January 2006 3:29 pm, Matt Benson wrote:
> --- Clifton Craig <[EMAIL PROTECTED]> wrote:
>
> [SNIP]
>
> > ;) I must clarify that
> > my tone was not intended as a heated tone. It is
> > hard to express or
> > interperet tone in text so let me assure you all
> > that I'm not angry at
> > anybody.
>
> Okay, sorry for the misinterpretation... :)
>
> [SNIP]
>
> > I don't like the idea of
> > hacking patternset syntax into a property if there
> > is no such tool to take
> > care of this for me. My feeling is that once you
> > have to start reading a
> > property into a file and back into a property you've
> > taken a wrong step
> > somewhere and things should be able to be done
> > better.
>
> Agreed; I hate temp files, and many of the changes I
> have made in Ant can be traced back to that simple
> fact.
>
> >  My take away from all
> > of this is that there is no such way to easily copy
> > a list of folders
> > separated by commas and include their contents.
> > Simple is being defined as
> > not requiring the list be swapped to disk, not
> > requiring third party
> > extensions installed to the base, and not requiiring
> > custom ant tasks or
> > procedural logic as each of these approaches involve
> > additional functionality
> > that is not part of the base set.
>
> Hmm... my solution involved nothing but built-in Ant.
> Pathconvert was used to turn your list of directories
> into a patternset.  The most "foreign" material used
> was a regexp mapper... which should be included w/o
> add-ons if you're using JDK>= 1.4 ... what more do you
> want?  ;)
>
> -Matt
>
> [SNIP]
>
> __
> 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]

-- 
- 
Clifton C. Craig, Software Engineer
Intelligent Computer Systems -  A Division of GBG
[EMAIL PROTECTED]
[EMAIL PROTECTED]

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



Re: Uptodate task

2006-01-23 Thread Stefan Bodewig
On Fri, 20 Jan 2006, shreedhar natarajan <[EMAIL PROTECTED]> wrote:

> I have a question regarding using  task that is being used
> as a part of  task. I have a set of src files say one.src,
> two.src and they generate one.target and two.target. If any of the
> source is updated both target has to be re-generated. I have problem
> matching multiple target files ..

Use a  and two merge mappers.  Ant 1.6.3 or higher is
required.

Stefan

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



Re: Copy a directory list

2006-01-23 Thread Clifton Craig
Matt,

You bastard! Why won't you shut up??!!! ;) Thanx all the same for the boiled 
down example.
--- 
Clifton C. Craig, Software Engineer
Intelligent Computer Systems -  A Division of GBG
[EMAIL PROTECTED]
[EMAIL PROTECTED]

On Monday 23 January 2006 3:37 pm, Matt Benson wrote:
> Just because I'm a bastard who can't shut up, I'll
> even boil my example (which may have been obscured by
> setup and testing) down to a macro:
>
> 
>   
>   
>   
>   
>  pathsep=",">
>   
> 
>   
>   
>  handledirsep="true" />
> 
>   
> 
> 
>includes="[EMAIL PROTECTED]" />
> 
>   
> 
>
> best I can do for now, until we have local properties
> for macrodefs.
>
> -Matt
>
> --- Matt Benson <[EMAIL PROTECTED]> wrote:
> > --- Clifton Craig <[EMAIL PROTECTED]> wrote:
> >
> > [SNIP]
> >
> > > ;) I must clarify that
> > > my tone was not intended as a heated tone. It is
> > > hard to express or
> > > interperet tone in text so let me assure you all
> > > that I'm not angry at
> > > anybody.
> >
> > Okay, sorry for the misinterpretation... :)
> >
> > [SNIP]
> >
> > > I don't like the idea of
> > > hacking patternset syntax into a property if there
> > > is no such tool to take
> > > care of this for me. My feeling is that once you
> > > have to start reading a
> > > property into a file and back into a property
> >
> > you've
> >
> > > taken a wrong step
> > > somewhere and things should be able to be done
> > > better.
> >
> > Agreed; I hate temp files, and many of the changes I
> > have made in Ant can be traced back to that simple
> > fact.
> >
> > >  My take away from all
> > > of this is that there is no such way to easily
> >
> > copy
> >
> > > a list of folders
> > > separated by commas and include their contents.
> > > Simple is being defined as
> > > not requiring the list be swapped to disk, not
> > > requiring third party
> > > extensions installed to the base, and not
> >
> > requiiring
> >
> > > custom ant tasks or
> > > procedural logic as each of these approaches
> >
> > involve
> >
> > > additional functionality
> > > that is not part of the base set.
> >
> > Hmm... my solution involved nothing but built-in
> > Ant.
> > Pathconvert was used to turn your list of
> > directories
> > into a patternset.  The most "foreign" material used
> > was a regexp mapper... which should be included w/o
> > add-ons if you're using JDK>= 1.4 ... what more do
> > you
> > want?  ;)
> >
> > -Matt
> >
> > [SNIP]
> >
> > __
> > 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]
>
> __
> 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]

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



Problem with exec task

2006-01-23 Thread Tommy Nordgren

I have a problem with the exec task.
I want to run an executable nested in one of my build directories.
I've tried:

This executes the command, but the work directory is still the base  
directory of my build.

I want it set to the directory containing the executable.

When I tries:   


exec will just return an error code of 255.

When I try:

ant will throw an IOException ("File not Found")

What do I need to do to successfully execute in a nested directory.

The first option isn't viable, because I want generated files in the  
same directory as the executable.

-
This sig is dedicated to the advancement of Nuclear Power
Tommy Nordgren
[EMAIL PROTECTED]




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



Re: Unit test a build

2006-01-23 Thread Stefan Bodewig
On Mon, 23 Jan 2006, Clifton Craig <[EMAIL PROTECTED]> wrote:

> Great idea. However, I'm a little lost. I have a source distribution
> of Ant-1.6.5

AntUnit is not part of Ant's source distribution, but a subproject on
its own right.  Check out
, there
even are docs 8-)

It is quite likely that it won't compile against Ant 1.6.5 since its
main developers so far haven't taken the time to even try anything
else but Ant's svn trunk version.  Anyway, give it a try.
 
Stefan

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



Re: Creating a task for getting the current target in a project

2006-01-23 Thread Stefan Bodewig
On Mon, 23 Jan 2006, none ofyourbusiness <[EMAIL PROTECTED]> wrote:

> Thats why we would like to make these dependancies optional for
> these 2 targets. We would like check for the availibilty of these
> jars only if the target is something else then "clean" or "package"


  



  .. check for jar and fail if not available ..



   ...



  ...


> so first i looked for a system property that gives the current
> target, but that doesnt seem to exist. After this i tried making a
> task for this myself, but i couldnt get it working...

And you don't really have a chance to, only the project instance knows
which targets it is going to execute and it doesn't expose the
information.

Stefan

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



Re:[solved] Problem with exec task

2006-01-23 Thread Tommy Nordgren


On Jan 23, 2006, at 10:05 PM, Tommy Nordgren wrote:


I have a problem with the exec task.
I want to run an executable nested in one of my build directories.
I've tried:

This executes the command, but the work directory is still the base  
directory of my build.

I want it set to the directory containing the executable.

When I tries:   


exec will just return an error code of 255.

When I try:

ant will throw an IOException ("File not Found")

What do I need to do to successfully execute in a nested directory.

The first option isn't viable, because I want generated files in  
the same directory as the executable.


	adding the attribute resolveExecutable="yes" did solve my problem  
(On Mac OS X)

-
This sig is dedicated to the advancement of Nuclear Power
Tommy Nordgren
[EMAIL PROTECTED]




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



Re: ant and os

2006-01-23 Thread Stefan Bodewig
On Mon, 23 Jan 2006, Marc Collin <[EMAIL PROTECTED]> wrote:

> i search a way to do:
> 
> exec rmiregistry.exe if windows
> else exec rmiregistry

you'd probably want rmiregistry on OS/2 or OpenVMS as well if you are
ever going to run Ant there.



  


  





Stefan

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



Re: Problem with exec task

2006-01-23 Thread Stefan Bodewig
On Mon, 23 Jan 2006, Tommy Nordgren <[EMAIL PROTECTED]> wrote:

> I want to run an executable nested in one of my build directories.
> I've tried:
> 
> This executes the command, but the work directory is still the base
> directory of my build.
> I want it set to the directory containing the executable.
> 
> When I tries: 
> 
> exec will just return an error code of 255.

Is ${unittest.build.dir} an absolute path?  I would have expected that
to work.

> When I try:  executable="TestRequiredInput.pl" /> ant will throw an IOException
> ("File not Found")

See exec's manual page, in particular the entry of the vmlauncher
attribute.

Stefan

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



Re: Unit test a build

2006-01-23 Thread Ninju Bohra
I too created test cases for my build files (actually they are build files for 
testing my custom tasks, but they are still build files).
 
I used the BuildFileTest class as the base class (that my JUnit classes 
extended from).  The class provided some convience methods for reading the 
build.xml, initializing the project, and accessing property and log output 
(very useful when verified build behavior).
 
The class is in the ant-testutil.jar and I have been successfully using with my 
ANT 1.6.2 install (not sure about anything newer).
 
I would highly encourge the using of build scripts for the testing of custom 
tasks...but I never quite thought of "testing" a build script with unit tests 
(it seems a bit recursive as you would need a build script to invoke the build 
you are testing...)
 
Good luck,
 
Ninju
 


- Original Message 
From: Stefan Bodewig <[EMAIL PROTECTED]>
To: user@ant.apache.org
Sent: Monday, January 23, 2006 3:06:35 PM
Subject: Re: Unit test a build


On Mon, 23 Jan 2006, Clifton Craig <[EMAIL PROTECTED]> wrote:

> Great idea. However, I'm a little lost. I have a source distribution
> of Ant-1.6.5

AntUnit is not part of Ant's source distribution, but a subproject on
its own right.  Check out
, there
even are docs 8-)

It is quite likely that it won't compile against Ant 1.6.5 since its
main developers so far haven't taken the time to even try anything
else but Ant's svn trunk version.  Anyway, give it a try.

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: Unit test a build

2006-01-23 Thread Stefan Bodewig
On Mon, 23 Jan 2006, Ninju Bohra <[EMAIL PROTECTED]> wrote:

> I too created test cases for my build files (actually they are build
> files for testing my custom tasks, but they are still build files).
>  
> I used the BuildFileTest class as the base class (that my JUnit
> classes extended from).

This is the traditional way Ant used itself, but this is going to be
replaced by AntUnit step by step.  The difference is that you don't
write a Java class at all.

Say I want to test the  task and validate it creates a file, I
write a build file:


  

  

  

  



  


> The class provided some convience methods for reading the build.xml,
> initializing the project, and accessing property and log output
> (very useful when verified build behavior).

AntUnit provides a generic  task (with a nested condition) as
well as a bunch of macrodef'ed asserts and

> but I never quite thought of "testing" a build script with unit
> tests (it seems a bit recursive as you would need a build script to
> invoke the build you are testing...)

an  task to do just that.  The task takes a bunch of build
files and runs the targets whose names start with "test", with special
handling for targets names setUp and tearDown.  And it provides for
test listeners.

Stefan

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



AW: Convert fileset into command-line args, allowing for spaces in directori

2006-01-23 Thread Jan.Materne
Ok, I´ve done some tests...

App.java just print the given arguments.
The buildfile compiles that and uses several different invocations for that
application with a "path" as "argument"

Maybe we dont know exactly what you want to achieve, but I´m sure you get
your solution here ;-)


Jan



App.java
---8-<---8-<---8-<---8-<---8-<---8-<---8-<---8-<
public class App {
public static void main(String[] args) {
System.out.println("args (" + args.length + ")");
for (int i=0; i


































 






---8-<---8-<---8-<---8-<---8-<---8-<---8-<---8-<

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



AW: ant and os

2006-01-23 Thread Jan.Materne
Do you HAVE to differentiate between
rmiregistry
and 
rmiregistry.exe
?

Try invoking without the .exe suffix on windows (should be resolved via 
windows´ PATHEXT variable) and you´ll get rid off that problem.


Jan


>-Ursprüngliche Nachricht-
>Von: Stefan Bodewig [mailto:[EMAIL PROTECTED] 
>Gesendet: Montag, 23. Januar 2006 22:20
>An: user@ant.apache.org
>Betreff: Re: ant and os
>
>On Mon, 23 Jan 2006, Marc Collin <[EMAIL PROTECTED]> wrote:
>
>> i search a way to do:
>> 
>> exec rmiregistry.exe if windows
>> else exec rmiregistry
>
>you'd probably want rmiregistry on OS/2 or OpenVMS as well if 
>you are ever going to run Ant there.
>
>
>
>  
>
>
>  
>
>
>
>
>
>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]



AW: Problem with exec task

2006-01-23 Thread Jan.Materne
And is that REALLY an executable?
AFAIK a .pl is a perl script which needs the perl interpreter ...

Jan 

>-Ursprüngliche Nachricht-
>Von: Stefan Bodewig [mailto:[EMAIL PROTECTED] 
>Gesendet: Montag, 23. Januar 2006 22:26
>An: user@ant.apache.org
>Betreff: Re: Problem with exec task
>
>On Mon, 23 Jan 2006, Tommy Nordgren <[EMAIL PROTECTED]> wrote:
>
>> I want to run an executable nested in one of my build directories.
>> I've tried:
>> executable="${unittest.build.dir}/TestRequiredInput.pl" /> This 
>> executes the command, but the work directory is still the base 
>> directory of my build.
>> I want it set to the directory containing the executable.
>> 
>> When I tries:
>> 
>> exec will just return an error code of 255.
>
>Is ${unittest.build.dir} an absolute path?  I would have 
>expected that to work.
>
>> When I try: > executable="TestRequiredInput.pl" /> ant will throw an IOException 
>> ("File not Found")
>
>See exec's manual page, in particular the entry of the 
>vmlauncher attribute.
>
>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]