Building Scala projects
Following the last section, most of this section would be very predictable from the application build's standpoint. So let's quickly go through the gist of it. The directory structure is as follows:
qotd-scala ├── build.gradle └── src ├── main │ ├── java │ │ └── com/packtpub/ge/qotd │ │ └── QotdService.java │ └── scala │ └── com/packtpub/ge/qotd │ └── ScalaQotdService.scala └── test └── scala └── com/packtpub/ge/qotd └── ScalaQotdServiceTest.scala
All Scala source files are read from src/main/scala
and src/test/scala
, unless configured using sourceSets
. This time, the only plugin that we need to apply is the scala
plugin, which just like the groovy
plugin, implicitly applies the java
plugin to our project. Let's write the build.gradle
file for this project:
apply plugin: 'scala' repositories { mavenCentral() } dependencies...