Forked from fomkin/scala-add-compiler-plugin.gradle
Last active
March 30, 2019 22:34
-
-
Save olafurpg/89dae930216e38db590202a9ac9f5456 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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