ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran" <stev...@iseran.com>
Subject Re: cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Expand.java
Date Sat, 29 Dec 2001 03:18:24 GMT
Magesh,


Before you do the same to the zip/war/jar tasks, I have done it already on
my box here; I am just playing with it a week to see if I am happy with the
changes, In fact, I had similar changes to Expand, but was taking my time
about committing all of them, because of concerns I had and the need to add
more test cases.

In particular, here are some of the implications of moving to SrcDir and
DestDir

1. where exceptions get thrown has moved.
2. the exception messages change, which can break tests
3. we are potentially tightening up the rules of validity. Which is good,
but it runs a risk of people coming back from the crimble break and
discovering their builds no longer work.

I fear your changes to Expand have broken peoples build. The tasks' dest can
be a directory or a file; the task behaves appropriately. Your change to the
task now only lets a destination directory be selected.

Now it may be that the tests didn't catch this, but this means the tests
need supplementing to test all options stated in the system. Other peoples
build files will be a test, and I shall await tonights GUMP build with
curiousity.


>         */
>        public void setDest(File d) {
>   -        this.dest=d;
>   +        log("DEPRECATED - The setDest(File) method has been
deprecated."
>   +            + " Use setDest(DestDir) instead.");
>   +        DestDir dd = new DestDir();
>   +        dd.setFile(d);
>   +        setDest(dd);
>        }

I think this must be reverted to the old functionality, although a
deprecated message can stay
 and supplemented with SetDestDir and SetDestFile methods, such as the ones
I have written:

    /**
     * Sets the destdir attribute.
     * @since 1.5
     * @param destDir The new destination directory
     */
    public void setDestDir(DestDir destDir) {
        this.dest=destDir.getFile();
    }

    /**
     * Sets the destfile attribute.
     * @since 1.5
     * @param destFile The new destination file
     */
    public void setDestFile(DestFile destFile) {
        this.dest=destFile.getFile();
    }


>        public void setSrc(File s) {
>   -        this.source = s;
>   +        log("DEPRECATED - The setSrc(File) method has been deprecated."
>   +            + " Use setSrcFile(SrcFile) instead.");
>   +        SrcFile sf = new SrcFile();
>   +        sf.setFile(s);
>   +        setSrc(sf);
>   +    }
>   +
>   +    /**
>   +     * Set the path to zip-file.
>   +     *
>   +     * @param s Path to zip-file.
>   +     */
>   +    public void setSrc(SrcFile s) {
>   +        this.source = s.getFile();
>        }
>

same thing. for the source file setting. Note the use of @since and
@deprecated too.

    /**
     * Sets the srcfile attribute.
     * @since 1.5
     * @param srcFile The new SrcFile value
     */
    public void setSrcFile(SrcFile srcFile) {
        this.source = srcFile.getFile();
    }

    /**
     * Set the path to zip-file.
     *
     * @param s Path to zip-file.
     * @deprecated use setSrcFile(SrcFile) instead
     */
    public void setSrc(File s) throws BuildException {
        log("DEPRECATED - The setSrc(File) method has been deprecated."
            + " Use setSrc(SrcFile) instead.");
        setSrcFile(new SrcFile(s));
    }

I can make these changes, I just want to make clear my rationale.

Also, please leave jar,zip,war,ear alone. I have changed them on this box,
but the tests need improvement before I am prepared to commit the changes.
Plus I want to make sure that the rest of the dev group is happy with these
changes.


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