Pregunta

I have an Ant build with a lot of javac tasks. I want all of them to be executed with the following attributes:

debug = "true" debuglevel = "lines,vars,source"

(by default debugging information is turned off which makes it harder to investigate the console).

Is it possible to provide such attributes in some centralized place which will have influence for all javac tasks in current Ant build? (I don't want duplicating them over all javac tasks...)

¿Fue útil?

Solución

You need ant's presetdef

From the example

<presetdef name="my.javac">
   <javac debug="${debug}" deprecation="${deprecation}"
          srcdir="${src.dir}" destdir="${classes.dir}">
      <src path="${gen.dir}"/>
   </javac>
</presetdef>

Instead of my.javac, you can put javac.

You can define this in one build file and import every where else.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top