You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "M.A.Dunphy" <ma...@bigfoot.com> on 2001/05/04 19:29:30 UTC

Filters and token values

Hi there,

When you setup filter tokens via a filterfile, is it possible to access a
token and it's value as if it was a property. This if I had this in the
file:

VERSION =1.0

Then could I reference it like ${ant.token.VERSION}

Doing it this way, the file drives the whole process. I know I could use a
standard properties file and thus would get properties, but then I'd have to
explicitly code the <filter token value>

Thanks

Mick

Re: Using Ant with IBM Java 1.3

Posted by David Goodenough <da...@btconnect.com>.
David Goodenough wrote:

> Hi,
>
> I have read my way through the archives, and noticed that many
> questions have been raised about using Ant with IBM's Java
> 1.3.  I have looked at the CLASSPATH etc and I am sure that
> Ant should be finding the right tools.jar and that inside this
> jar is the right class com.sun.tools.javac.Main, but still it does
> not work.  I am running under Linux by the way.
>
> Now I so have many Java JVMs installed on my machine, but
> none of them are actually in the regular paths, and there is
> no exported CLASSPATH there by default.
>
> I set JAVA_HOME to point to the root of the JDK:-
>
> /opt/IBMJava2-13
>
> and boostrap.sh correctly finds tools.jar in lib.
>
> When I run bootstrap to try to compile Ant (from CVS) it
> goes through the compile of the basic Ant classes, but then
> when it runs the generated Ant with build.xml it complains
> that it can not use modern as it can not find it and so it
> trys to use classic and fails on that too.
>
> Anyone got any ideas?
>
> Tnanks in advance
>
> David

Well I have done some more experiments, and what I have found
is that Ant works IFF tools.jar is copied into the jre lib/ext
directory.
This suggests that either the security policies are different or the
AntClassLoader is somehow interacting oddly with the compiler
class.  Anyone got any ideas?

Using Ant with IBM Java 1.3

Posted by David Goodenough <da...@btconnect.com>.
Hi,

I have read my way through the archives, and noticed that many
questions have been raised about using Ant with IBM's Java
1.3.  I have looked at the CLASSPATH etc and I am sure that
Ant should be finding the right tools.jar and that inside this
jar is the right class com.sun.tools.javac.Main, but still it does
not work.  I am running under Linux by the way.

Now I so have many Java JVMs installed on my machine, but
none of them are actually in the regular paths, and there is
no exported CLASSPATH there by default.

I set JAVA_HOME to point to the root of the JDK:-

/opt/IBMJava2-13

and boostrap.sh correctly finds tools.jar in lib.

When I run bootstrap to try to compile Ant (from CVS) it
goes through the compile of the basic Ant classes, but then
when it runs the generated Ant with build.xml it complains
that it can not use modern as it can not find it and so it
trys to use classic and fails on that too.

Anyone got any ideas?

Tnanks in advance

David

RE: output from tasks isn't always available as output="xxx". Alternatives?

Posted by Kris Bravo <br...@us.net>.
Thank you Diane!

-----Original Message-----
From: Diane Holt [mailto:holtdl@yahoo.com]
Sent: Saturday, May 05, 2001 4:15 PM
To: ant-user@jakarta.apache.org
Subject: Re: output from tasks isn't always available as output="xxx".
Alternatives?


See the new <record> task. The doc for it is at:
http://jakarta.apache.org/cvsweb/index.cgi/jakarta-ant/docs/manual/CoreTasks
/recorder.html

You can get the source for it from CVS (or pick up a nightly build).

Diane

--- Kris Bravo <br...@us.net> wrote:
> I have not been able to find this one in the archives, so here is my
> question.
>
> I would like to specify output files for each task individually. I can
> see
> where a few tasks have an output field that can cause this to happen
> (e.g.,
> exec, java, etc.); however, javac, jar and a few other critical ones
> don't.
> Am I missing something? It there a good way to do this?
>
> My guess is that the way to accomplish this for any task is to parse the
> output of ant (or the XmlLogger) according to the brackets (tags) to get
> the
> messages broken down. True?
>
> Any pointers would be appreciated!
>
> Kris
>


=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/



Re: output from tasks isn't always available as output="xxx". Alternatives?

Posted by Diane Holt <ho...@yahoo.com>.
See the new <record> task. The doc for it is at:
http://jakarta.apache.org/cvsweb/index.cgi/jakarta-ant/docs/manual/CoreTasks/recorder.html

You can get the source for it from CVS (or pick up a nightly build).

Diane

--- Kris Bravo <br...@us.net> wrote:
> I have not been able to find this one in the archives, so here is my
> question.
> 
> I would like to specify output files for each task individually. I can
> see
> where a few tasks have an output field that can cause this to happen
> (e.g.,
> exec, java, etc.); however, javac, jar and a few other critical ones
> don't.
> Am I missing something? It there a good way to do this?
> 
> My guess is that the way to accomplish this for any task is to parse the
> output of ant (or the XmlLogger) according to the brackets (tags) to get
> the
> messages broken down. True?
> 
> Any pointers would be appreciated!
> 
> Kris
> 


=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

output from tasks isn't always available as output="xxx". Alternatives?

Posted by Kris Bravo <br...@us.net>.
I have not been able to find this one in the archives, so here is my
question.

I would like to specify output files for each task individually. I can see
where a few tasks have an output field that can cause this to happen (e.g.,
exec, java, etc.); however, javac, jar and a few other critical ones don't.
Am I missing something? It there a good way to do this?

My guess is that the way to accomplish this for any task is to parse the
output of ant (or the XmlLogger) according to the brackets (tags) to get the
messages broken down. True?

Any pointers would be appreciated!

Kris


Re: Filters and token values

Posted by Diane Holt <ho...@yahoo.com>.
--- "M.A.Dunphy" <ma...@bigfoot.com> wrote:
> When you setup filter tokens via a filterfile, is it possible to access
> a token and it's value as if it was a property. This if I had this in
> the file:
> 
> VERSION =1.0
> 
> Then could I reference it like ${ant.token.VERSION}
> 
> Doing it this way, the file drives the whole process. I know I could use
> a standard properties file and thus would get properties, but then I'd
> have to explicitly code the <filter token value>

Maybe I'm not understanding what you need to do (since I can't think of
why you'd need to reference a filter-token). You can use the same file for
both filters and properties. Just read the file in twice -- once using
<property> and again using <filter>. Eg., put those tasks in an "init"
target:

  <target name="init">
    <property file="build.properties"/>
    <filter filtersfile="build.properties"/>
  </target>

Now, any filtered copying you do, just set filtering="true" (or yes|on),
and you should be good to go, without having to do any addition <filter>
tasks, and you can still reference things as normal properties where you
need to.

Diane


=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/