From ccb5f3d191a38a59a7cead01fc2403790d2874e0 Mon Sep 17 00:00:00 2001 From: Paul-Christian Volkmer Date: Sun, 13 Sep 2015 15:58:43 +0200 Subject: [PATCH] Configure the build to use Checkstyle This commit adds checkstyle plugin and provides a simple config file. Closes gh-125 --- build.gradle | 5 + checkstyle.xml | 92 +++++++++++++++++++ .../com/example/ExampleApplicationTests.java | 4 +- 3 files changed, 99 insertions(+), 2 deletions(-) create mode 100644 checkstyle.xml diff --git a/build.gradle b/build.gradle index a849cd98..7f849e63 100644 --- a/build.gradle +++ b/build.gradle @@ -47,6 +47,7 @@ subprojects { apply plugin: 'propdeps-eclipse' apply plugin: 'propdeps-maven' apply plugin: 'maven' + apply plugin: 'checkstyle' apply from: "${rootProject.projectDir}/gradle/publish-maven.gradle" sourceCompatibility = 1.7 @@ -72,6 +73,10 @@ subprojects { } } + checkstyle { + configFile = rootProject.file('checkstyle.xml') + } + configurations { jacoco } diff --git a/checkstyle.xml b/checkstyle.xml new file mode 100644 index 00000000..4e7653a2 --- /dev/null +++ b/checkstyle.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/src/test/java/com/example/ExampleApplicationTests.java b/docs/src/test/java/com/example/ExampleApplicationTests.java index cc6c6406..d94622f5 100644 --- a/docs/src/test/java/com/example/ExampleApplicationTests.java +++ b/docs/src/test/java/com/example/ExampleApplicationTests.java @@ -27,7 +27,7 @@ import org.springframework.web.context.WebApplicationContext; import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.documentationConfiguration; public class ExampleApplicationTests { - + // tag::mock-mvc-setup[] @Rule public final RestDocumentation restDocumentation = new RestDocumentation("build/generated-snippets"); @@ -44,4 +44,4 @@ public class ExampleApplicationTests { .build(); } // end::mock-mvc-setup[] -} \ No newline at end of file +}