Re: FrameworkSet questions

From: tblanchar..ac.com
Date: Tue Aug 13 2002 - 12:53:52 EDT

  • Next message: Andrus: "Re: FrameworkSet questions"

    This is an OK hack. But its only required because root is defined as
    type String.

    If root were defined as File, this test would be unnecessary.

    Actually, that's sort of why I think WOProject should just use a regular
    DirSet pre-configured to look for *.framework. Then we could do away
    with root and all the code that tries to figure out your installation.

    On Tuesday, August 13, 2002, at 02:45 PM, Tatsuya Kawano wrote:

    >
    > Hi,
    >
    >> What I would like to suggest is that we leave root as a synonym for
    >> dir,
    >> then change the implementation of dir to be:
    >>
    >> public void setDir(File dir) throws BuildException
    >> {
    >> setRoot(dir.getAbsolutePath());
    >> }
    >>
    >> This at least allows dir to work as expected on unix (I think it has
    >> issues on Windows since the test is looking for a string that starts
    >> with "/".
    >
    >
    > I can't tell what is good or bad because I just started to learn Ant,
    > but,
    > as a user, this is what I did with my version to prevent
    > isAbsoluteRoot() to
    > throw an exception on Windows.
    >
    > Index: FrameworkSet.java
    > ===================================================================
    > RCS file:
    > /cvsroot/woproject/woproject/src/java/org/objectstyle/woproject/ant/Framewor
    > kSet.java,v
    > retrieving revision 1.8
    > diff -r1.8 FrameworkSet.java
    > 116c116,117
    > < return root.charAt(0) == '/';
    > ---
    >> return root.charAt(0) == '/'
    >> || (root.length() >= 3 && root.substring(1,
    >> 3).equals(":/"));
    > -------------------------------------------------------------------
    >
    > Thanks,
    > Tatsuya
    >
    >
    >
    > On 8/13/02 8:20 AM Eastern/US, tblanchar..ac.com wrote:
    >
    >> I'm trying to work with WOApplication and to be honest, I'm finding the
    >> FrameworkSet class to be really strange and I don't understand why its
    >> been limited in such a strange way.
    >>
    >> It seems to me that it would be more natural to simply let FrameworkSet
    >> take a dir parameter like DirSet or FileSet and then provide some
    >> predefined property names for these predefined roots rather then
    >> disallow the use of dir and then have root do all this fancy looking up
    >> of private properties. Its not at all ant-like and its very confusing
    >> for a user. I actually had to read the source code for the class to
    >> find out how it works because its so different from how the other sets
    >> work.
    >>
    >> What I would like to suggest is that we leave root as a synonym for
    >> dir,
    >> then change the implementation of dir to be:
    >>
    >> public void setDir(File dir) throws BuildException
    >> {
    >> setRoot(dir.getAbsolutePath());
    >> }
    >>
    >> This at least allows dir to work as expected on unix (I think it has
    >> issues on Windows since the test is looking for a string that starts
    >> with "/".
    >>
    >> I think it would make more sense though, rather than have user enter
    >> something like root="sometokenname" to actually define those properties
    >> per platform and then have the user be able to do
    >> dir="${sometokenname}"
    >> so it works like everything else.
    >>
    >> This is what I've done with my version.
    >
    >
    >



    This archive was generated by hypermail 2.0.0 : Tue Aug 13 2002 - 12:54:04 EDT