AspectJ - 使用预编译方面编译Java源代码 [英] AspectJ - Compile Java source with precompiled aspects

查看:154
本文介绍了AspectJ - 使用预编译方面编译Java源代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有几个方面,我已编译过,现在我只想编译单个源文件,但不重新编译方面,因为它需要花费很多时间。
有没有办法这样做?

Let's say I have few aspects, which I have already compiled, and now I just want to compile single source file, but without recompiling the aspects, since it takes a lot of time. Is there any way to do so?

例如,我有以下内容:


  • Trace.aj

  • Log.aj

  • Test.java

所有这些都是在我的build-all中编译的,现在我已经更改了 Test.java 并想要重新编译它使用(已编译的)方面。

All of them were compiled during my "build-all", and now I've changed Test.java and wants to recompile it using the (already compiled) aspects.

推荐答案

使用加载时编织。

http://www.aspectprogrammer.org/blogs /adrian/2004/05/loadtime_weavin.html

以下是如何在eclipse中执行此操作:
http://www.eclipse.org/aspectj/doc/released /devguide/ltw-configuration.html#enabling-load-time-weaving

Here's how to do it in eclipse: http://www.eclipse.org/aspectj/doc/released/devguide/ltw-configuration.html#enabling-load-time-weaving

这篇关于AspectJ - 使用预编译方面编译Java源代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆