diff --git a/.gitignore b/.gitignore index aa97fb757..fc9333371 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,8 @@ test/data/ /bin/ /data/ publish.sh + +# Gradle build files +.gradle/ +build/ + diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..ab1a94652 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,10 @@ +language: java +matrix: + include: + - jdk: oraclejdk8 + + +addons: + apt: + packages: + - oracle-java8-installer diff --git a/README.md b/README.md index 30edc698c..15de7ea29 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +[![Build Status](https://travis-ci.org/se-edu/addressbook-level3.svg?branch=master)](https://travis-ci.org/se-edu/addressbook-level3) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/d4a0954383444a8db8cb26e5f5b7302c)](https://www.codacy.com/app/se-edu/addressbook-level3?utm_source=github.com&utm_medium=referral&utm_content=se-edu/addressbook-level3&utm_campaign=Badge_Grade) # AddressBook (Level 3) diff --git a/build.gradle b/build.gradle new file mode 100644 index 000000000..2a76a6b8b --- /dev/null +++ b/build.gradle @@ -0,0 +1,41 @@ +apply plugin: 'java' + +repositories { + mavenCentral() +} + +sourceSets { + main { + java { + srcDirs = ['src'] + } + } + test { + java { + srcDirs = ['test/java'] + } + } +} + +dependencies { + testCompile 'junit:junit:4.12' +} + +test { + /* + * Prints the currently running test's name in the CI's build log, + * so that we can check if tests are being silently skipped or stalling the build. + */ + if (System.env.'CI') { + beforeTest { descriptor -> + logger.lifecycle('Running test: ' + descriptor) + } + } +} + +compileJava { + sourceCompatibility = 1.8 + targetCompatibility = 1.8 +} + +defaultTasks 'clean', 'test'