Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Problem with custom ant build
Problem with custom ant build [message #253823] Tue, 10 June 2008 11:11 Go to next message
Eclipse UserFriend
Originally posted by: thomas.diligent.st.com

Hello,

I would like a plugin to provide some ant tasks accessing some classes of
the encapsulating plugin. To do so, it seems mandatory to build an
external jar that would hold the tasks. Thanks to extension points, the
plugin contributes the tasks and its core classes are accessible from
these tasks.

In order to have a proper automated build, I wrote a custom ant build file
for the ant tasks. This build is called from the custom build callback
post.compile.@dot of the encapsulating plugin. The ant tasks also depend
on classes from some other plugins. The problem I encounter is the
following:

Although I set up the classpath of the javac task (using
org.eclipse.jdt.core.JDTCompilerAdapter), the classes on which depend the
tasks cannot be accessed and I get "... cannot be resolved" errors.

--------------------------------------
custom build callback invocation :

...
<target name="post.compile.@dot">
<dirname property="plugins.dir" file="${basedir}"/>
<ant antfile="build.xml"
dir="${plugins.dir}/com.st.nmfperf.ant.tasks/"
target="jar">
<!-- ant tasks code in plugins, perhaps not the best place...-->
<property name="plugins.dir" value="${plugins.dir}"/>
</ant>
</target>
...

--------------------------------------
custom build file:

...
<path id="ant.tasks.classpath">
<pathelement location="${plugins.dir}/<some dependency>/@dot"/>
<pathelement location="${plugins.dir}/<some other dependency>/@dot"/>
</path>

...

<target name="compile">
<mkdir dir="${basedir}/@dot"/>
<javac destdir="${basedir}/@dot"
compiler="org.eclipse.jdt.core.JDTCompilerAdapter"
failonerror="true"
source="1.5" target="1.5"
verbose="true"
debug="on"
classpathref="ant.tasks.classpath"
srcdir="${basedir}/src">
<include name="**/MyTask.java"/>
</javac>
</target>

Please can someone help ?
Re: Problem with custom ant build [message #253853 is a reply to message #253823] Wed, 11 June 2008 07:11 Go to previous message
Eclipse UserFriend
Originally posted by: thomas.diligent.st.com

I was actually not using the right callback.
post.<name> seems much more appropriate.
Previous Topic:Formatter preference name for empty line between created fields
Next Topic:Extended Refactor->Rename for new file type
Goto Forum:
  


Current Time: Sat May 03 16:10:04 EDT 2025

Powered by FUDForum. Page generated in 0.02644 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top