sbt-aspectj
sbt-aspectj copied to clipboard
Possible to weave scala-library.jar?
I'm attempting to add before
advice to a function within scala-library.jar.
It appears that the sbt-aspectj plugin is successfully weaving the jar. However, the weaved jar is somehow not getting loaded, despite the fullClasspath in Runtime <<= useInstrumentedClasses(Runtime)
line in my build file.
For what it's worth, here is my build file, my aspectj file, and my test program.
To reproduce:
git clone -b test-ask [email protected]:NetSys/sts2-applications.git test-ask
cd test-ask
sbt debug run
Running it should print "WOOHOO" at the beginning. However, no such message appears.
Interestingly, the weaved classes are on the classpath. Moreover, as far as I can tell, there are no redundant classes on the classpath, i.e. there is one and only one of the class I'm trying to weave on the classpath.
I suspect that the scala runtime somehow loads its own scala-library, dynamically and without regard to the classpath.. Any insights?
Thanks!