diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 023d6140c..8b5e086d9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,9 +19,9 @@ before_script: - echo " == Installing Android emulator images" - echo y | android -s update sdk --no-ui -a -t android-10 - echo " == Installing Gradle" - - wget -q -O gradle.zip https://services.gradle.org/distributions/gradle-2.4-bin.zip + - wget -q -O gradle.zip https://services.gradle.org/distributions/gradle-2.7-bin.zip - unzip -q gradle.zip - - export PATH="$PWD/gradle-2.4/bin:$PATH" + - export PATH="$PWD/gradle-2.7/bin:$PATH" test: script: diff --git a/F-Droid/build.gradle b/F-Droid/build.gradle index 18ba6334c..4916f4c71 100644 --- a/F-Droid/build.gradle +++ b/F-Droid/build.gradle @@ -1,5 +1,6 @@ apply plugin: 'com.android.application' apply plugin: 'witness' +apply plugin: 'checkstyle' if (!hasProperty('sourceDeps')) { repositories { @@ -182,6 +183,14 @@ android { } } +task checkstyle(type: Checkstyle) { + configFile file("${project.rootDir}/config/checkstyle/checkstyle.xml") + source 'src' + include '**/*.java' + exclude '**/gen/**' + + classpath = files() +} // This person took the example code below from another blogpost online, however // I lost the reference to it: // http://stackoverflow.com/questions/23297562/gradle-javadoc-and-android-documentation diff --git a/build.gradle b/build.gradle index 583db1576..6c9018bc1 100644 --- a/build.gradle +++ b/build.gradle @@ -7,3 +7,7 @@ buildscript { classpath files('libs/gradle-witness.jar') } } + +task wrapper(type: Wrapper) { + gradleVersion = '2.7' +} diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml new file mode 100644 index 000000000..8fb1856b6 --- /dev/null +++ b/config/checkstyle/checkstyle.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +