RE: Check if exist a file and then run or not a target

2009-08-04 Thread Felix Dorner
Maybe you want, although it's not really the same...? ... The other way would be to use ant-contrib's if. Which I think is ugly. I'm trying to do with ANT anything like: If exist a file (file.txt) Exec file.bat End if

RE: compare files line by line

2009-07-30 Thread Felix Dorner
> I am here again needing some help > now I need to do a I script to compare two ".properties"..like I'd just write a custom task for these kind of things. Then you're done within an hour, taking Hofstadters law into account. If you've never written a custom task, your objective sounds like a goo

Memory issue when using a lot of 'Ant' tasks.

2009-07-29 Thread Felix Dorner
Hey, Hey, I've written a task that repeatedly calls the 'Ant' task to execute another target. (The number of times that target is called Depends on the size of a given FileSet). The problem is that I get an OutOfMemory error. Wanted to ask if the following code looks suspicious to anyone. If n

RE: Problems with ANTLR

2009-04-30 Thread Felix Dorner
> > Reason: /scratch2/nemer/test/build.xml:47: Problem: failed > to create > > task or type antlr > > Cause: the class > org.apache.tools.ant.taskdefs.optional.ANTLR was not > > found. Did you even look at this: http://ant.apache.org/manual/OptionalTasks/antlr.html ? Note that this refers to An

RE: Pass multiple directories to -lib option

2009-04-22 Thread Felix Dorner
> > The 'help' output and the manual say: > >"-lib specifies a path to search for jars and > > classes" > > > > I had a look into the source code: the is a real path: it is > > tokenized by File.pathSeparator and each token is added to Ants > > classpath. > > I didn't have a l

RE: Pass multiple directories to -lib option

2009-04-21 Thread Felix Dorner
> > So you mean it should work with ; (on Windows) separation > and a single > > -lib argument? > yes, have you tried? Yes I tried it, and once more right now. Doesn't work. Two possible sources of confusion: - Version issue, I use 1.7.0, but the one that's shipped with eclipse. - The director

RE: Pass multiple directories to -lib option

2009-04-21 Thread Felix Dorner
Hi Jan, > Use multiple -lib options > $ant -lib one.jar -lib another.jar Great! Thanks. Guess that was the only thing I didn't try... > I had a look into the source code: the is a real path: > it is tokenized by File.pathSeparator and each token is added > to Ants classpath. So you mean it

Pass multiple directories to -lib option

2009-04-21 Thread Felix Dorner
Hey, I tried several ways (space separated, semicolon-separated) to add more than one directory to the -lib option, somehow I cannot get this working (-diagnostics doesn't list my jars..). Thankful for any tips. Felix - To uns

RE: Help regular expression for appending to the content of a tag

2009-04-16 Thread Felix Dorner
Hey, > And I want to append some more text like reloadable="true" docBase="\YYYRoot"/>, so the content of > tag would be > > > > Did you consider to use a strylesheet transformation? Felix - To unsubscribe, e-mail: user-

RE: Read a file line by line and do something for each line

2009-04-08 Thread Felix Dorner
Hey Jan, > list="${src}" delimiter="${line.separator}"> > > > > Yes this works too, apart from my natural dislikes against for. :-) I'll include a filter and meditate into happiness..: Thanks, Felix - To unsubsc

Read a file line by line and do something for each line

2009-04-08 Thread Felix Dorner
Hey, I'm trying to figure out a way how to read a text file line by line. Then for each read line I'd like to invoke a macro with that line's contents as an argument. I can't find a better whay than using ant-contribs math+var tasks to count the number of lines read so far. With that I can use

RE: echo + embedded newlines

2009-03-27 Thread Felix Dorner
This is why: http://www.w3.org/TR/2004/REC-xml-20040204/#sec-line-ends > > What might be going on here? - To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional commands, e-mail: user-h...@ant.apache.org

echo + embedded newlines

2009-03-27 Thread Felix Dorner
Hey, I have the following snippet in my ant file: This is the first line A This is the second line B When I look at the build file, after the A, I see a CR LF. When I look at the file that ant echoed to, I only see a LF. What might be going on here? Felix ---

RE: Dynamic macro dispatch.

2009-03-25 Thread Felix Dorner
Heya, > You can check out the various macroforeach tasks > around to get an idea of what you need to do. This hint lead me to AntExtra, which provides a task that accepts makro names. Thanks, Felix - To unsubscribe, e-mail:

RE: Dynamic macro dispatch.

2009-03-24 Thread Felix Dorner
Well I assume it would be easy to write a contributed task similar to the one that I describe above. The only thing I'd need to know is how to execute a macro with a given name from within a Task implementation... > I understand what you mean now. You want all possible values > to be taken car

RE: Dynamic macro dispatch.

2009-03-24 Thread Felix Dorner
Hey David, Thanks for your suggestions. > Well the only reason I specified the method below is that you > asked what could be done with ant-core. > However, if you're able to use ant-contrib, then you can > simplify it a little more using the ant-contrib task. Of course this is a possibility,

RE: Dynamic macro dispatch.

2009-03-24 Thread Felix Dorner
This approach would make the macros obsolete. Instead I would move the macro code into the targets you mention, and could do This is actually how my build file currently looks like. But I want to switch to macros as they are more lightweight and controllable. Felix > You'd probably be better

Dynamic macro dispatch.

2009-03-24 Thread Felix Dorner
Hi Ant users, I have three macros: a, b, c, and a property 'x'. Is there a way to execute the macro ${x}, i.e. a if ${x}=a, b if ${x}=b, c if ${x}=c, (fail otherwise) with ant core? Something like Thanks, Felix - To unsubscri

RE: Developing in Java with ANT

2009-03-17 Thread Felix Dorner
Whoops > Maybe you look for something like this: http://www.ibm.com/developerworks/websphere/library/techarticles/0502_gawor/0502_gawor.html Felix - To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional comman

RE: Developing in Java with ANT

2009-03-17 Thread Felix Dorner
Maybe you look for something like this: > -Mensaje original- > De: David Nemer [mailto:davidne...@gmail.com] > Enviado el: Monday, March 16, 2009 10:26 PM > Para: user > Asunto: Re: Developing in Java with ANT > > Hello David and Martin, > > Thank you for your answers. But, I was just

Looking for something similar to javas 'finally' block

2009-03-10 Thread Felix Dorner
Hey, In a target, I create a bunch of intermediary files which should *always* be deleted right before the build completes, even if it completes abnormally. This is quite similar to closing a stream in a java 'finally' block. Anything similar for ant? Thanks, Felix

RE: How Ant can find third-party-jars

2009-03-10 Thread Felix Dorner
This is explained on the first page of the ant manual: http://ant.apache.org/manual/running.html#libs - To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional commands, e-mail: user-h...@ant.apache.org

RV: Trim leading spaces line by line

2009-03-10 Thread Felix Dorner
Heya, I confirm that both alternatives work. However, I'm more confident with "^\s*", and don't see why "\s*" works... Felix - To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional commands, e-mail: user-h...@an

RE: Trim leading spaces line by line

2009-03-09 Thread Felix Dorner
I found the solution my self in the ant manual: It would be nice to do this on-the-fly, so that source and dest are the same. Is this possible somehow? ---

Trim leading spaces line by line

2009-03-09 Thread Felix Dorner
Hey, I prefer my xml files to look nice, so I indent multi-line-echoes (these go to a file). Is there a simple ant way to remove all the spaces that were caused by the indentation afterwards? Felix - To unsubscribe, e-mail: us

RE: How to use nested if in ant script?

2009-03-09 Thread Felix Dorner
> Use ;) That brings me to ask: Does the new (?)

RE: Showtargets task, task 'flags'

2009-03-04 Thread Felix Dorner
Hi, > There is not task for that. > But starting Ant with "-projecthelp" will show the targets. That's perfectly fine. > "ant -Da=someValue" will start target a but not target b. Yes this works. I tried to find a way that lets me omit the "=someValue" part, as the value doesn't matter.. Feli

Showtargets task, task 'flags'

2009-03-04 Thread Felix Dorner
Hey, A) I couldn't find a task that shows all available targets (and their descriptions). I didn't think through whether that's a computable problem, but I guess it is :-) B) I'd like to just 'define a symbol' on the command line. My target would then conditionally do something different if A gi