ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Alberto Fernandez" <j_a_fernan...@yahoo.com>
Subject Re: removing deprecated stuff
Date Mon, 03 Dec 2001 22:18:00 GMT
From: "Stephane Bailliez" <sbailliez@imediation.com>

> > From: Sam Ruby [mailto:rubys@us.ibm.com]

> [...]
> > By the way, I am *very* concerned that -legacy will be used too
> > aggressively.  IMHO, it should only be used after a 
> > *significant* period of
> > deprecation, containing at a minimum one public release.  
> > [...]
> 
> Agreed. 1st release is a warning as used now. Next one means -legacy must be
> used.

I like it. Why don't we provide a simple API that simplifies maintaing this deprecated messages,
something like:

    public void deprecated(String message, String version) {

        String antversion = /*the current version */  + ".";
        version += ".";

        if (antversion.startsWith(version) || isInLegacyMode()) {
            log(message, ...);
        }
        else throw new BuildException(message);

    }

or something like that. The usage would be something like:

    public void setUserproperty(boolean user) {
        deprecated("You can only override properties using -Doption or as <ant> or <antcall>
parameters", "1.5");
        //deprecated implementation
    }

This would really simplify maintaining deprecation rules in check. You only do it once.

Jose Alberto



--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message