Problem with custom ant build [message #253823] |
Tue, 10 June 2008 15:11 |
Eclipse User |
|
|
|
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 ?
|
|
|
|
Powered by
FUDForum. Page generated in 0.26427 seconds