Re: WOPath, Ant 1.7, Odd Behavior Change

From: Chuck Hill (chil..lobal-village.net)
Date: Fri Feb 22 2008 - 19:16:34 EST

  • Next message: Mike Schrag: "Re: WOPath, Ant 1.7, Odd Behavior Change"

    Ever notice how as soon as you post you say, "Eureka!!!!"?

    OK, the bug is in WOProject. The names returned from getIncludedFiles
    () are supposed to be relative to the directory of the scanner. BUT
    WOProject is returning
    /Library/Frameworks/CadreJars.framework/Resources/Java/cadrejars.jar
    and now in Ant 1.7 it really has to be the properly relative path:
    Library/Frameworks/CadreJars.framework/Resources/Java/cadrejars.jar

    Can one of the committers kindly change

    for (int i = 0; i < frameworkJars.length; i++)
    {
         frameworkJars[i] = frameworkJars[i].substring(dirLength);
    }

    to this:

    for (int i = 0; i < frameworkJars.length; i++)
    {
         frameworkJars[i] = frameworkJars[i].substring(dirLength +
    1); // Exclude leading /
    }

    Thanks
    Chuck

    On Feb 22, 2008, at 4:06 PM, Chuck Hill wrote:

    > WOPath is broken on Leopard with Ant 1.7, it works fine with 1.6.5.
    > Under 1.7, it does not see the jars for any of the frameworks. If
    > you run Ant with -debug -verbose, you see this:
    >
    > dropping /Library/Frameworks/CadreJars.framework/Resources/Java/
    > cadrejars.jar from path as it doesn't exist
    > dropping /Library/Frameworks/CadreJars.framework/Resources/Java/
    > dbunit-2.2.1.jar from path as it doesn't exist
    > dropping /Library/Frameworks/CadreJars.framework/Resources/Java/
    > ganymed.jar from path as it doesn't exist
    > dropping /Library/Frameworks/CadreJars.framework/Resources/Java/
    > GVCWOProjectAntTasks.jar from path as it doesn't exist
    > dropping /Library/Frameworks/CadreJars.framework/Resources/Java/
    > jass-rt.jar from path as it doesn't exist
    > dropping /Library/Frameworks/CadreJars.framework/Resources/Java/
    > javasvn.jar from path as it doesn't exist
    > dropping /Library/Frameworks/CadreJars.framework/Resources/Java/
    > jxl.jar from path as it doesn't exist
    > dropping /Library/Frameworks/CadreJars.framework/Resources/Java/
    > log4j-1.2.14.jar from path as it doesn't exist
    > dropping /Library/Frameworks/CadreJars.framework/Resources/Java/
    > svnant.jar from path as it doesn't exist
    > dropping /Library/Frameworks/CadreJars.framework/Resources/Java/
    > svnClientAdapter.jar from path as it doesn't exist
    > dropping /Library/Frameworks/CadreJars.framework/Resources/Java/
    > svnjavahl.jar from path as it doesn't exist
    > dropping /Library/Frameworks/CadreJars.framework/Resources/Java/
    > taglets.jar from path as it doesn't exist
    > dropping /Library/Frameworks/CadreJars.framework/Resources/Java/
    > testng-5.6-jdk14.jar from path as it doesn't exist
    > dropping /Library/Frameworks/CadreJars.framework/Resources/Java/
    > woproject.jar from path as it doesn't exist
    > dropping /Library/Frameworks/CadrePrototypes.framework/Resources/
    > Java/cadreprototypes.jar from path as it doesn't exist
    > dropping /Library/Frameworks/ERExtensions.framework/Resources/Java/
    > ERExtensions.jar from path as it doesn't exist
    > dropping /Library/Frameworks/FrontBasePlugIn.framework/Resources/
    > Java/FrontBasePlugIn.jar from path as it doesn't exist
    > dropping /Library/Frameworks/GVCEOFExtensions.framework/Resources/
    > Java/gvceofextensions.jar from path as it doesn't exist
    > dropping /Library/Frameworks/GVCFoundation.framework/Resources/Java/
    > gvcfoundation.jar from path as it doesn't exist
    > dropping /Library/Frameworks/GVCWOExtensions.framework/Resources/
    > Java/gvcwoextensions.jar from path as it doesn't exist
    > dropping /Library/Frameworks/JavaWOExtensions.framework/Resources/
    > Java/JavaWOExtensions.jar from path as it doesn't exist
    > dropping /Library/Frameworks/MicrosoftPlugIn.framework/Resources/
    > Java/microsoftplugin.jar from path as it doesn't exist
    > dropping /Library/Frameworks/JavaEOAccess.framework/Resources/Java/
    > javaeoaccess.jar from path as it doesn't exist
    > dropping /Library/Frameworks/JavaEOControl.framework/Resources/Java/
    > javaeocontrol.jar from path as it doesn't exist
    > dropping /Library/Frameworks/JavaFoundation.framework/Resources/
    > Java/javafoundation.jar from path as it doesn't exist
    > dropping /Library/Frameworks/JavaJDBCAdaptor.framework/Resources/
    > Java/javajdbcadaptor.jar from path as it doesn't exist
    > dropping /Library/Frameworks/JavaWebObjects.framework/Resources/
    > Java/javawebobjects.jar from path as it doesn't exist
    > dropping /Library/Frameworks/JavaXML.framework/Resources/Java/
    > javaxml.jar from path as it doesn't exist
    >
    > Note that it is missing the /System and /Users/chuck prefixes on
    > the paths.
    >
    > I have discovered that if I change
    > FrameworkSet.SortedDirectoryScanner, in this method
    > public synchronized String[] getIncludedFiles()
    > and comment out this line:
    >
    > for (int i = 0; i < frameworkJars.length; i++)
    > {
    > // frameworkJars[i] = frameworkJars[i].substring(dirLength);
    > }
    >
    > Note that this breaks API:
    >
    > // The results of calling jarsPaths() on the FrameworkSet is a
    > // fully qualified path. This creates a problem as FileSet qualifies
    > // these file paths with the directory. To accomodate this, we
    > // trim off the root dir. This will be added back after
    > getIncludedFiles()
    > // is called. This (hack) was done instead of making a parallel
    > // implementation of jarsPath() that returns a partial path.
    >
    > That it now works. I have also built some code that does not use
    > WOPath and this change also works fine.
    >
    > This method is called from here:
    >
    > [wocompile] at org.objectstyle.woproject.ant.FrameworkSet
    > $SortedDirectoryScanner.getIncludedFiles(Unknown Source)
    > [wocompile] at org.apache.tools.ant.types.FileSet.iterator
    > (FileSet.java:69)
    > [wocompile] at
    > org.apache.tools.ant.types.resources.Union.getCollection(Union.java:
    > 105)
    > [wocompile] at
    > org.apache.tools.ant.types.resources.Union.getCollection(Union.java:
    > 88)
    > [wocompile] at
    > org.apache.tools.ant.types.resources.BaseResourceCollectionContainer.c
    > acheCollection(BaseResourceCollectionContainer.java:244)
    > [wocompile] at
    > org.apache.tools.ant.types.resources.BaseResourceCollectionContainer.i
    > terator(BaseResourceCollectionContainer.java:120)
    > [wocompile] at org.apache.tools.ant.types.Path.iterator(Path.java:
    > 687)
    > [wocompile] at org.apache.tools.ant.types.Path.iterator(Path.java:
    > 684)
    > [wocompile] at
    > org.apache.tools.ant.types.resources.Union.getCollection(Union.java:
    > 105)
    > [wocompile] at org.apache.tools.ant.types.resources.Union.list
    > (Union.java:67)
    > [wocompile] at org.apache.tools.ant.types.Path.list(Path.java:356)
    > [wocompile] at org.apache.tools.ant.types.Path.addExisting
    > (Path.java:327)
    > [wocompile] at org.apache.tools.ant.types.Path.addExisting
    > (Path.java:315)
    > [wocompile] at org.apache.tools.ant.types.Path.concatSpecialPath
    > (Path.java:560)
    > [wocompile] at
    > org.apache.tools.ant.types.Path.concatSystemClasspath(Path.java:512)
    > [wocompile] at
    > org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter.getComp
    > ileClasspath(DefaultCompilerAdapter.java:152)
    >
    > Does anyone have any insight into why this is different under 1.7?
    >
    >
    > Chuck
    >
    >
    > --
    >
    > Practical WebObjects - for developers who want to increase their
    > overall knowledge of WebObjects or who are trying to solve specific
    > problems.
    > http://www.global-village.net/products/practical_webobjects
    >
    >
    >
    >
    >
    >

    -- 
    

    Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects



    This archive was generated by hypermail 2.0.0 : Fri Feb 22 2008 - 19:18:03 EST