Created
January 19, 2019 13:26
-
-
Save DamianReeves/d8aaa55e834bcdfcad32f2d035ebc046 to your computer and use it in GitHub Desktop.
Add Scala Compiler Plugins Using a Custom Config
This file contains hidden or 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
tasks.withType(ScalaCompile){ | |
// Map plugin jars to -Xplugin parameter | |
List<String> parameters = | |
configurations.scalaCompilerPlugin.files.collect { | |
'-Xplugin:'+ it.absolutePath | |
} | |
// Add existing parameters | |
List<String> existingParameters = scalaCompileOptions.additionalParameters | |
if (existingParameters) { | |
parameters.addAll(existingParameters) | |
} | |
// Add whatever flags you typically add | |
parameters += [ | |
'-language:implicitConversions', | |
'-language:higherKinds' | |
] | |
// Finally set the additionalParameters | |
scalaCompileOptions.additionalParameters = parameters | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment