在Eclipse项目中混合AspectJ和Scala [英] Mixing AspectJ and Scala in an Eclipse Project

查看:85
本文介绍了在Eclipse项目中混合AspectJ和Scala的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以获得Scala和AspectJ(AJDT)在Eclipse 3.6中很好地一起玩?

Any one been able to get a Scala and AspectJ (AJDT) to play nicely together in Eclipse 3.6?

似乎Scala的织工与AspectJ的织布工冲突。
我希望我只是错过了一些东西。

It seems Scala's weaver conflicts with AspectJ's weaver. I'm hoping I'm just missing something.

编辑:在同一个项目中很好玩

推荐答案

根据上面的评论,您希望单个项目同时使用AspectJ构建器和Scala构建器。这不可能。每个代理自己的编译器,两个编译器不兼容。 Scala编译器可以一起构建Java和Scala代码,AspectJ编译器可以一起构建AspectJ和Java代码,但是它是这样的。

Based on your comment above, it looks like you want a single project to use both the AspectJ builder and the Scala builder. This is not possible. Each one delegates to its own compiler and the two compilers are not (yet) compatible. The Scala compiler can build Java and Scala code together, and the AspectJ compiler can build AspectJ and Java code together, but that's it.

如果要将方面应用于Scala代码,您必须将AspectJ和Scala代码分隔成不同的项目,然后将Scala项目添加到AspectJ项目的路径中。

If you want aspects to apply to your Scala code, you must separate your AspectJ and Scala code into different projects and then add the Scala project to the inpath of your AspectJ project.

这与您同样的事情如果您正在从ant或命令行编译,则需要执行此操作。

This is the same thing that you would need to do if you were compiling from ant or the command line.

这篇关于在Eclipse项目中混合AspectJ和Scala的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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