์ƒ์„ธ ์ปจํ…์ธ 

๋ณธ๋ฌธ ์ œ๋ชฉ

[ํ”„๋กœ์ ํŠธ] Gradle์— Java CheckStyle ์„ค์ •ํ•˜๊ธฐ

๋ณธ๋ฌธ

728x90

build.gradle

plugins {
	id 'checkstyle'
}

compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'

dependencies {
	checkstyle "com.puppycrawl.tools:checkstyle:${checkstyle.toolVersion}"
}

tasks.withType(Checkstyle) {
    reports {
        xml.required = true
        html.required = true
    }
}

checkstyle {
	toolVersion = "10.12.4"
    configFile = file("checkstyle/naver-checkstyle-rules.xml")
    configProperties = ["suppressionFile": "checkstyle/naver-checkstyle-suppressions.xml"]
    soureSets = [sourceSets.main]
}

checkstyleMain.source = fileTree('src/main/java')

 

 

 


 

https://docs.gradle.org/current/userguide/checkstyle_plugin.html

 

The Checkstyle Plugin

By default, the Checkstyle plugin expects configuration files to be placed in the root project, but this can be changed. โ””โ”€โ”€ config โ””โ”€โ”€ checkstyle (1) โ””โ”€โ”€ checkstyle.xml (2) โ””โ”€โ”€ suppressions.xml 1 Checkstyle configuration files go h

docs.gradle.org

 

728x90

๊ด€๋ จ๊ธ€ ๋”๋ณด๊ธฐ