ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nico Seessle" <Nico.Sees...@epost.de>
Subject Re: [PATCH] New <case> task
Date Wed, 11 Oct 2000 07:49:34 GMT
----- Original Message -----
From: "Diane Holt" <holtdl@yahoo.com>
To: <ant-dev@jakarta.apache.org>
Sent: Wednesday, October 11, 2000 5:19 AM
Subject: RE: [PATCH] New <case> task


> Don't know what Jose Alberto's particular need is, but I can tell you one
> of the things I'd like it for... I have a property that contains a value
> of either "true" or "false" -- note: it's not something I can have simply
> either set or not-set, because the literal value of it is used as the
> replacement string for a filter token. The token is the value of a boolean
> in a .java file, and depending on whether it is set to "true" or "false"
> determines whether the source-tree is being compiled with debug code or
> without

You CAN do it without scripting or case-tasks with just setting the property
to true or not setting it if you use something like this in your Java-Code

    private static final String DEBUG_STRING  = "@DEBUG@";
    public static final boolean DEBUG  =
DEBUG_STRING.toLowerCase().equals("true");

I don't know if and how javac/jikes/your_compiler optimizes this and/or if
it is slower than your solution (at run-time) but it works now :-) And you
can use the already-available target if/unless-solution.

Nico



Mime
View raw message