AspectJ编译器(ajc):如何在inpath中覆盖编织类?

时间:2014-01-21 11:39:52

标签: java ant aspectj

我的项目源的模块化布局是使用ant构建的。在使用javac构建项目之后,我正在运行(对于特定模块)iajc任务,以建议分散在inpath上的二进制类,该二进制类组成来自我的依赖模块的二进制输出目录:

<iajc destDir="${dest.dir}" >
    <inpath refid="modules.binaries.path" />
    <classpath>
        <path refid="module.classpath" />
    </classpath>
    <aspectpath refid="aspects.path" />
</iajc>

问题是,像这样,所有二进制文件的编织输出合并到${dest.dir},这意味着我正在失去我的二进制模块结构。但是我需要它在运行时保留。完全不指定destDir无效。有没有办法让编织类留在原来的地方,从而在inpath内覆盖原文(无纺布)? 感谢您提供任何帮助或提示。

1 个答案:

答案 0 :(得分:0)

我最终迭代了构成依赖模块的二进制目录的路径的元素。 inpathdestDir被设置为等于每次迭代时的当前路径元素:

<for param="path.item" >
   <path refid="modules.binaries.path" />
   <sequential>
      <iajc destDir="@{path.item}" >
      <inpath>
         <pathelement location="@{path.item}" />
      </inpath>
      <classpath>
         <path refid="module.classpath" />
      </classpath>
      <aspectpath refid="aspects.path" />
      </iajc>
   </sequential>
</for>

通过覆盖原始版本,可以在他们的位置建议课程。

相关问题