groovy

Ant Task Not Using Classpath

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0-JSR-3
  • Fix Version/s: 1.1-rc-2
  • Component/s: Ant integration
  • Labels:
    None
  • Environment:
    OSX 10.4, IDEA 5.0, Ant 1.6.5, Java 1.4.2
  • Testcase included:
    yes
  • Number of attachments :
    0

Description

In JSR03, the groovyc ant task doesn't seem to use the classpath provided.

In JSR01, the following Ant task worked. In JSR03 it does not and I get class not found errors.

<groovyc srcdir="${src}" destdir="${classes}" classpath="${classes}">
<classpath>
<fileset dir="${lib}" casesensitive="yes">
<include name="*/.jar"/>
</fileset>
</classpath>
</groovyc>

Activity

Hide
Hein Meling added a comment -

I had the opposite problem, JSR02 didn't work, while JSR03 works after I provided a fix. I use this:

<groovyc destdir="${build}" srcdir="${groovy-src}" listfiles="true" stacktrace="false">
<classpath refid="run.path"/>
</groovyc>

Could you provide more details to see if it is possible to resolve this. Try adding stacktrace="true" and see if that helps us get the necessary details to understand why your thing didn't work. Also, if you have a simple example that allows reproduction.

BTW: this issue does not include a junit test case as claimed. Maybe you forgot to add it.

Show
Hein Meling added a comment - I had the opposite problem, JSR02 didn't work, while JSR03 works after I provided a fix. I use this: <groovyc destdir="${build}" srcdir="${groovy-src}" listfiles="true" stacktrace="false"> <classpath refid="run.path"/> </groovyc> Could you provide more details to see if it is possible to resolve this. Try adding stacktrace="true" and see if that helps us get the necessary details to understand why your thing didn't work. Also, if you have a simple example that allows reproduction. BTW: this issue does not include a junit test case as claimed. Maybe you forgot to add it.
Hide
Paul King added a comment -

I am not sure when this was fixed but the following works for me now:

<project name="groovy-1019" default="run">
    <path id="taskdef.path">
        <path path="C:/Downloads/groovy.codehaus.org/groovy-1.1-rc-1/embeddable/groovy-all-1.1-rc-1.jar"/>
        <path path="C:/Downloads/groovy.codehaus.org/groovy-1.1-rc-1/lib/commons-cli-1.0.jar"/>
    </path>
    <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc" classpathref="taskdef.path"/>

    <path id="compile.path">
        <fileset dir="./groovy-1019/lib" />
    </path>

    <target name="run">
        <groovyc destdir="." srcdir="./groovy-1019/src" listfiles="true" stacktrace="false">
            <classpath refid="compile.path"/>
        </groovyc>
    </target>

</project>

Where in src is a single groovy file requiring commons lang and in lib is just the commons lang jar.

Show
Paul King added a comment - I am not sure when this was fixed but the following works for me now:
<project name="groovy-1019" default="run">
    <path id="taskdef.path">
        <path path="C:/Downloads/groovy.codehaus.org/groovy-1.1-rc-1/embeddable/groovy-all-1.1-rc-1.jar"/>
        <path path="C:/Downloads/groovy.codehaus.org/groovy-1.1-rc-1/lib/commons-cli-1.0.jar"/>
    </path>
    <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc" classpathref="taskdef.path"/>

    <path id="compile.path">
        <fileset dir="./groovy-1019/lib" />
    </path>

    <target name="run">
        <groovyc destdir="." srcdir="./groovy-1019/src" listfiles="true" stacktrace="false">
            <classpath refid="compile.path"/>
        </groovyc>
    </target>

</project>
Where in src is a single groovy file requiring commons lang and in lib is just the commons lang jar.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: