0

Is there any way to make eclipse ant editor to understand custom ant tasks provided by plugins such as antcontrib, flaka, etc? It is very convenient when editing ant project, but when I use flaka I must have manual opened. I've added flaka jar in Preferences->Ant->Runtime->Classpath->AntHomeEntries just in case, but this doesn't help. Maybe there is some plugin for eclipse for this to work? Thanks!

Tertium
  • 6,049
  • 3
  • 30
  • 51

1 Answers1

0

When I added

<taskdef resource="it/haefelinger/flaka/antlib.xml"/>

in the beginning of my ant build file, eclipse included into a global scope all flaka targets, so now it autoappends <when> and <while> with attributes. But it seems it's impossible to turn on autocompletion if you include flaka in the usual way as namespace:

<project name="myname" xmlns:c="antlib:it.haefelinger.flaka">

It's a problem, because having all flaka targets in a global scope we have some targets failed to redefine, for example <echo>.

Update: When I combine two approaches it finally works.

    <project name="myname" xmlns:c="antlib:it.haefelinger.flaka">
        <taskdef uri="antlib:it.haefelinger.flaka" 
             resource="it/haefelinger/flaka/antlib.xml" 
             classpath="${ant.library.dir}/ant-flaka.jar" />
    .....

    </project>

The same thing with antcontrib.

Tertium
  • 6,049
  • 3
  • 30
  • 51
  • This works indeed. The catch however is that "taskdef" must be a top-level element (must have "project" as parent). Thus at that time of execution you must already have fetched ant-flaka.jar. – wh81752 Aug 14 '15 at 17:04