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 ...

Get Gradle Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.