Add checkstyle plugin

This commit is contained in:
cugurlu
2019-03-17 17:06:50 +01:00
parent b1ab9f4e8a
commit f5fa03b104
7 changed files with 242 additions and 258 deletions

View File

@@ -13,32 +13,27 @@ apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'jacoco'
//apply plugin: 'checkstyle'
//
//checkstyle {
// version = '7.8.1'
// config = 'checkstyle/checkstyle.xml' as File
//}
//
//checkstyleMain {
// source ='src/main/java'
//}
//
//checkstyleTest {
// source ='src/test/java'
//}
//
//tasks.withType(Checkstyle) {
// reports {
// xml.enabled false
// html.enabled true
// html.stylesheet resources.text.fromFile('config/xsl/checkstyle-custom.xsl')
// }
//}
apply plugin: 'checkstyle'
sourceCompatibility = 1.8
targetCompatibility = 1.8
def configDir = "${project.rootDir}/quality"
checkstyle {
toolVersion '7.8.1'
configFile file("$configDir/checkstyle/checkstyle.xml")
configProperties.checkstyleSuppressionsPath = file("$configDir/checkstyle/suppressions.xml").absolutePath
}
checkstyleMain {
source ='src/main/java'
}
checkstyleTest {
source ='src/test/java'
}
test {
useJUnitPlatform()
}

View File

@@ -11,6 +11,7 @@ apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'jacoco'
apply plugin: 'checkstyle'
sourceCompatibility = 1.8
targetCompatibility = 1.8
@@ -19,6 +20,22 @@ repositories {
mavenCentral()
}
def configDir = "${project.rootDir}/quality"
checkstyle {
toolVersion '7.8.1'
configFile file("$configDir/checkstyle/checkstyle.xml")
configProperties.checkstyleSuppressionsPath = file("$configDir/checkstyle/suppressions.xml").absolutePath
}
checkstyleMain {
source ='src/main/java'
}
checkstyleTest {
source ='src/test/java'
}
dependencies {
testCompile("junit:junit")
testCompile(

View File

@@ -13,6 +13,7 @@ apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'jacoco'
apply plugin: 'checkstyle'
bootJar {
baseName = 'gs-rest-service'
@@ -31,6 +32,22 @@ repositories {
sourceCompatibility = 1.8
targetCompatibility = 1.8
def configDir = "${project.rootDir}/quality"
checkstyle {
toolVersion '7.8.1'
configFile file("$configDir/checkstyle/checkstyle.xml")
configProperties.checkstyleSuppressionsPath = file("$configDir/checkstyle/suppressions.xml").absolutePath
}
checkstyleMain {
source ='src/main/java'
}
checkstyleTest {
source ='src/test/java'
}
dependencies {
compile("org.springframework.boot:spring-boot-starter-web")
testCompile('org.springframework.boot:spring-boot-starter-test')