Override the compiler attribute in an Ant javac task

前端 未结 1 1991
清歌不尽
清歌不尽 2020-12-18 00:29

I\'m trying to override Ant compiler attributes via the command line so that all \'javac\' tasks use my specified compiler. The problem I\'ve run into is that any target tha

相关标签:
1条回答
  • 2020-12-18 00:50

    The Ant javac task documentation says:

    It is possible to use different compilers. This can be specified by either setting the global build.compiler property, which will affect all tasks throughout the build, or by setting the compiler attribute, specific to the current task. Valid values for either the build.compiler property or the compiler attribute are:

    It sounds as if you can either specify the global build.compiler property or set a specific compiler attribute.

    So, it looks like you will need to modify your build file and either:

    1. remove the compiler attribute from the javac calls and allow the global build.compiler setting to cascade down

    2. change the values of the compiler attribute from a hard-coded string compiler="modern" to be property compiler="${javac.compiler}"

    0 讨论(0)
提交回复
热议问题