Search code examples
scalagradlescalac

Gradle scala project and private compile options


I just started working on a Scala project using Gradle as the build tool and I'm struggling to cause builds to warn when there are unused imports.

ScalaStyle doesn't support the detection of unused imports so I thought I would use the private option for scalac -Ywarn-unused-imports but I can't figure out how to pass it from build.gradle. I've tried all of:

- scalaCompileOptions.additionalParameters = ["-Ywarn-unused-imports"]
- scalaCompileOptions.options << "-Ywarn-unused-imports"
- options.compilerArgs = ["-Ywarn-unused-imports"]

Help much appreciated!


Solution

  • Actually this was just a misspelling. See comments on the question.