Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save olafurpg/89dae930216e38db590202a9ac9f5456 to your computer and use it in GitHub Desktop.
Save olafurpg/89dae930216e38db590202a9ac9f5456 to your computer and use it in GitHub Desktop.
⚠️Untested. Enable semanticdb-scalac in Gradle build.
apply plugin: 'application'
apply plugin: 'scala'
repositories {
mavenLocal()
mavenCentral()
}
ext {
scalaBinaryVersion = "2.12"
scalaMinorVersion = "7"
scalametaVersion = "<update me>"
}
configurations {
scalaCompilerPlugin
}
dependencies {
compile("org.scala-lang:scala-library:$scalaBinaryVersion.$scalaMinorVersion")
// Add semanticdb-scalac compiler plugin
scalaCompilerPlugin "org.scalameta:semanticdb-scalac_$scalaBinaryVersion.$scalaMinorVersion:$scalametaVersion"
}
compileScala {
scalaCompileOptions.additionalParameters = ['-Yrangepos'] // required by semanticdb-scalac
}
tasks.withType(ScalaCompile) {
scalaCompileOptions.additionalParameters = [
"-Xplugin:" + configurations.scalaCompilerPlugin.asPath
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment