-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrating to the new version of sbt-aspectj #40
Comments
Hi, sorry for the late response. Let's see if this can help you:
|
Thank you for help. Scoping leads to a compile error in my case (keyword Aspectj is not recognized); however, I will study and try to mimic the statements in the example build file. I will also try to upgrade the SBT version. |
Hi, |
@hasansozer I am using |
I am trying to compile and run a tool, which is using an old version of sbt-aspectj (com.typesafe.sbtaspectj" % "sbt-aspectj" % "0.5.3"). I updated the plugins.sbt file to switch to the new version ("com.lightbend.sbt" % "sbt-aspectj" % "0.11.0"). I updated the build file as well. The original build file can be found in this link: https://github.com/samira-t/Bita/blob/master/project/Build.scala
Hereby, I updated the import statements as follows:
mport com.lightbend.sbt.SbtAspectj
import com.lightbend.sbt.AspectjKeys.{ aspectjInputs, aspectjBinaries, aspectjWeave }
Then I updated the library dependencies as follows:
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor" % "2.4.1",
"org.scalatest" %% "scalatest" % "2.2.4" % "test",
"org.scala-lang" % "scala-reflect" % "2.11.7",
"org.scala-lang.modules" %% "scala-xml" % "1.0.4"
),
The following definition does not work since "inputs in Aspectj" is apparently not defined anymore:
inputs in Aspectj <<= update map { report =>
report.matching(moduleFilter(organization = "com.typesafe.akka", name = "akka-actor"))
},
So, I changed it as follows (hoping that this value in AspectjKeys is representative):
aspectjInputs <<= update map { report =>
report.matching(moduleFilter(organization = "com.typesafe.akka", name = "akka-actor"))
},
I changed the last two lines for using the instrumented versions as well (hoping that they are comparable to the use of AspectjPlugin.useInstrumentedClasses and AspectjPlugin.useInstrumentedJars):
fullClasspath in Test <<= SbtAspectj.aspectjUseInstrumentedClasses(Test),
fullClasspath in Runtime <<= SbtAspectj.aspectjUseInstrumentedClasses(Runtime)))
Assuming that the above modifications are correct, the part that I am really puzzled with is the definition of an aspect filter as copied below:
aspectFilter in Aspectj := {
(jar, aspects) =>
{
if (jar.name.contains("akka-actor") )
aspects filter (jar => (jar.name.startsWith("Actor")))
else Seq.empty[File]
}
},
Apperrently such a filter is not defined in the version. I also could not find a representative definition.
The text was updated successfully, but these errors were encountered: