2017-03-02 1 views
1

checkstyle 작업을 사용하는 프로젝트 (다중 모듈)가 있습니다. 나는 잘 작동하는 것 같다 7.4에 도구 버전을 다운 그레이드하는 경우Android Studio checkstyle 작업

Execution failed for task ':domain:checkstyle'. Unable to create Root Module: configLocation {[my_project_path]\quality_tools\checkstyle\google_checks.xml}, classpath {null}.

:

apply plugin: 'checkstyle' 
check.dependsOn 'checkstyle' 

// Set the directory for quality config files 
def configDir = "${project.rootDir}/quality_tools" 
// Set the directory for quality reports 
def reportsDir = "${project.buildDir}/reports" 

checkstyle { 
    toolVersion = "7.6" 

    configFile file("$configDir/checkstyle/google_checks.xml") 
    configProperties.checkstyleSuppressionsPath = file("$configDir/checkstyle/suppressions.xml").absolutePath 
} 

@ParallelizableTask 
class ParallelCheckstyle extends Checkstyle {} 

task checkstyle(type: ParallelCheckstyle, group: 'verification') { 
    description 'Runs Checkstyle inspection against Android sourcesets.' 

    source 'src' 
    include '**/*.java' 
    exclude '**/gen/**' 
    exclude '**/test/**' 
    exclude '**/androidTest/**' 
    exclude '**/R.java' 
    exclude '**/BuildConfig.java' 

    classpath = files() 
} 

이 나에게 다음과 같은 오류를 제공합니다 : 이것은 관련 구성입니다. 최신 버전에서 작동하게 할 수있는 방법이 있습니까? 아니면 구성에 문제가 있다면 알려주십시오.

감사합니다.

+0

'google_checks'를 최신 버전으로 업데이트했으며 현재 작동하고있는 것 같습니다. 여기에서 스타일을 사용하고 있습니다. https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/google_checks.xml 오류는 오해의 소지가있었습니다. 일부 속성이 아닌 것 같습니다. 더 이상 지원되지 않습니다 (또는 대체되었습니다). –

답변

0

구성 파일의 속성으로 인해 checkstyle 작업이 실패한 것처럼 보입니다. google_checks.xm의 최신 버전으로 업데이트했습니다. 이제 정상적으로 작동합니다.

오류 설명이 잘못되었습니다.

관련 문제