Skip to content

An AspectJ Plugin For SBT0.11.0(or 0.10+) which will weave classes with aspect sources directly instead of weaving target jars

Notifications You must be signed in to change notification settings

CSUG/AspectJ-Plugin-For-SBT0.11.0

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This is an AspectJ-SBT-Plugin I wrote for SBT0.11.0, but maybe it works on SBT0.10.x too(I didn't test it).

You may wonder why I reinvent such a wheel, since there are alternatives for such things, e.g. Typesafehub's sbt-aspectj. Yes, sbt-aspectj is ok for its job, but the weaving source and weaving target format are not what I want. I want do weaving with classes and aspect sources, not jars. That's why I wrote this.

How to Use it?

It's simple, just put following lines into your $PROJECT_ROOT/project/plugins/build.sbt:

resolvers += Resolver.url("githubResolver", url("git://github.com/fujohnwang/AspectJ-Plugin-For-SBT0.11.0.git"))

addSbtPlugin("name.fujohnwang" % "aspectj_sbt_plugin" % "0.0.1")

If you don't want to do other customizations, then its done.

Before running your main scala class(es), and if you want to weave in your aspects into the byte codes, run:

aspect:weave

After that, your running result will reflect the weaved result(s).

Are there any project structure changes?

Put your aspect source files into "src/main/aspectj", nothing more.

Can I customize the configuration or settings of the plugin?

Yes, currently, you can override the settings for "aspectjVersion" and "aspectDirectory"(override "aspectjClasspath" is not recommended). Refer to SBT0.10+ document to see how to add more settings to your project.

About

An AspectJ Plugin For SBT0.11.0(or 0.10+) which will weave classes with aspect sources directly instead of weaving target jars

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages