質問

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...)

役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top