apply plugin: 'scala'And scala lang/compiler dependencies:
compile group: 'org.scala-lang', name: 'scala-library', version: scalaVersion compile group: 'org.scala-lang', name: 'scala-compiler', version: scalaVersionYou should also make sure that .java and .scala files are being built together so:
sourceSets.main.scala.srcDir "src/main/java" sourceSets.test.scala.srcDir "src/test/java" sourceSets.main.java.srcDirs =  sourceSets.test.java.srcDirs = The project I've been working on has multiple modules so I've added sourceSets and dependencies in subprojects section. Remember about installing Scala plugin in your IDE (in intellij it's called Scala). That's all :) Now when I'm trying to build the project I get the following output:
➜ cw git:(develop) git status On branch develop Your branch is up-to-date with 'origin/develop'. nothing to commit, working directory clean ➜ cw git:(develop) gradle build :compileJava UP-TO-DATE :compileScala UP-TO-DATE :processResources UP-TO-DATE :classes UP-TO-DATE :jar UP-TO-DATE :assemble UP-TO-DATE :compileTestJava UP-TO-DATE :compileTestScala UP-TO-DATE :processTestResources UP-TO-DATE :testClasses UP-TO-DATE :test UP-TO-DATE :check UP-TO-DATE :build UP-TO-DATE ...As you can see there's compileScala among others which in fact builds both .java and .scala files. It's because of our sourceSets. It allows you to use Scala classes in .java files and Java classes in .scala files. You should also make sure that you chose proper version of Scala. I use 2.11.5. It works without any issues with Java 8.