ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 2412] - Self-coded tasks must be compiled before taskdef can be used
Date Wed, 04 Jul 2001 12:48:32 GMT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2412

*** shadow/2412	Wed Jul  4 04:50:56 2001
--- shadow/2412.tmp.20131	Wed Jul  4 05:48:32 2001
***************
*** 2,9 ****
  | Self-coded tasks must be compiled before taskdef can be used               |
  +----------------------------------------------------------------------------+
  |        Bug #: 2412                        Product: Ant                     |
! |       Status: RESOLVED                    Version: 1.3                     |
! |   Resolution: WORKSFORME                 Platform: Other                   |
  |     Severity: Normal                   OS/Version: Other                   |
  |     Priority: Other                     Component: Core tasks              |
  +----------------------------------------------------------------------------+
--- 2,9 ----
  | Self-coded tasks must be compiled before taskdef can be used               |
  +----------------------------------------------------------------------------+
  |        Bug #: 2412                        Product: Ant                     |
! |       Status: REOPENED                    Version: 1.3                     |
! |   Resolution:                            Platform: Other                   |
  |     Severity: Normal                   OS/Version: Other                   |
  |     Priority: Other                     Component: Core tasks              |
  +----------------------------------------------------------------------------+
***************
*** 23,25 ****
--- 23,83 ----
  ------- Additional Comments From bodewig@apache.org  2001-07-04 04:50 -------
  Since version 1.2 you can place the taskdef task itself after the javac task,
  this way it is possible to build and use a task in the same run.
+ 
+ 
+ ------- Additional Comments From boris@i3.informatik.rwth-aachen.de  2001-07-04 05:48 -------
+ The following code snippet is a part of my build.xml file.
+ 
+   <target name="prepare" depends="check_for_optional_packages, compile-tasks" >
+     <tstamp/>
+     <taskdef name="xml2pdf" classname="i3.tools.ant.tasks.Xml2Pdf" />
+   </target>
+ 
+   <target name="compile-tasks" >
+     <mkdir dir="${build.classes.dir}"/>
+ 
+     <javac srcdir="${src.share.dir}"
+            destdir="${build.classes.dir}"
+            debug="${debug}" 
+            deprecation="${deprecation}" >
+       <classpath refid="classpath" />
+       <include name="i3/tools/ant/**" />
+     </javac>
+   </target>
+ The `compile-tasks' target compiles my Ant tasks before a taskdef defines them.
+ A `build.sh' script, which invokes Ant, ensures that the directory
+ ${build.classes.dir} is in the CLASSPATH! If my task has not been compiled 
+ before I get the following error message:
+ 
+ 
+ compile-tasks:
+     [mkdir] Created dir: /home/boehlen/work/Projekte/UPGRADE/develop/upgrade/build
+     [mkdir] Created dir:
+ /home/boehlen/work/Projekte/UPGRADE/develop/upgrade/build/classes
+     [javac] Compiling 1 source file to
+ /home/boehlen/work/Projekte/UPGRADE/develop/upgrade/build/classes
+  
+ prepare:
+  
+ BUILD FAILED
+  
+ /home/boehlen/work/Projekte/UPGRADE/develop/upgrade/build.xml:88: taskdef class
+ i3.tools.ant.tasks.Xml2Pdf cannot be found
+ --- Nested Exception ---
+ java.lang.ClassNotFoundException: i3.tools.ant.tasks.Xml2Pdf
+         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
+         at java.security.AccessController.doPrivileged(Native Method)
+         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
+         at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
+         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
+         at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
+         at org.apache.tools.ant.taskdefs.Taskdef.execute(Taskdef.java:111)
+         at org.apache.tools.ant.Target.execute(Target.java:153)
+         at org.apache.tools.ant.Project.runTarget(Project.java:898)
+         at org.apache.tools.ant.Project.executeTarget(Project.java:536)
+         at org.apache.tools.ant.Project.executeTargets(Project.java:510)
+         at org.apache.tools.ant.Main.runBuild(Main.java:421)
+         at org.apache.tools.ant.Main.main(Main.java:149)
+ 
+ BTW, putting the taskdef in the same target doesn't help. If I invoke the build
+ a second time, then my tasks can be defined.

Mime
View raw message