ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 8891] New: - Cannot use a different classpath for loading optional script task
Date Tue, 07 May 2002 22:41:43 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8891>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8891

Cannot use a different classpath for loading optional script task

           Summary: Cannot use a different classpath for loading optional
                    script task
           Product: Ant
           Version: 1.5Beta1
          Platform: PC
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Core
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: wr0ngway@yahoo.com


The following script fails to run - it seems to think the Script task is in the
parent loader even though ANT_HOME/lib does not contain optional.jar (It only
contains ant.jar and xml jars).

<project name="foo" default="all">
	
	<property name="lib.dir" value="/path/to/dir/with/optional/bsf/rhino"/>

	<path id="task.classpath">
		<fileset dir="${lib.dir}">
			<include name="optional.jar"/>
			<include name="bsf.jar"/>
			<include name="js.jar"/>
		</fileset>
	</path>
	
	
	<target name="showcp">
		<pathconvert targetos="windows"
                             property="taskcp" refid="task.classpath"/>
		<echo message="tasks cp: ${taskcp}"/>
	</target>

	<target name="all" depends="showcp">
		<taskdef name="myscript"
                     classname="org.apache.tools.ant.taskdefs.optional.Script">
			<classpath refid="task.classpath"/>
		</taskdef>
		<myscript language="javascript"> <![CDATA[
			java.lang.System.out.println("In script");
			]]></myscript>
	</target>
	
</project>

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