Search⌘ K
AI Features

Getting the Project Files

Explore how to prepare your Kotlin project for unit testing by downloading the project files and choosing between Gradle and Maven build tools. Understand the necessary dependencies, directory structures, and how to run initial builds to ensure a successful testing setup.

We'll cover the following...

We’ll write code in the unittests/airportapp directory—our project location for this example. Since setting up the build files often takes effort, we can save significant time by using a pre-created project structure. Download the source code zip file from the book’s website, unzip the file, and cd to the unittests/airportapp directory. Take a few minutes to study the project structure.

You’ll find the following empty directories: src/main/kotlin/com/agiledeveloper/airportstatus and src/test/kotlin/com/agiledeveloper/airportstatus. These are the default directory structures, for source files and test files, used by both Gradle and Maven build tools. So we can use this structure irrespective of which build tool we pick from those two.

In addition to the two empty directories, in the project directory you’ll also find files related to Gradle build and Maven build.

First, we have to pick either Gradle or Maven for the build tool. Maven is the more popular tool, while Gradle is the more ...