1. 程式人生 > >【mac+Android Studio】搭建Jenkins+svn+Android Studio+釋出到蒲公英+發郵件+findbugs

【mac+Android Studio】搭建Jenkins+svn+Android Studio+釋出到蒲公英+發郵件+findbugs

在Jenkins+svn+Android+蒲公英+發郵件+增加java靜態程式碼檢查外掛findbugs

【1】在工程app/build.gradle中配置

apply plugin: "findbugs"  //靜態程式碼檢查


task findbugs(type: FindBugs){
    ignoreFailures = true
    effort = "max"
    reportLevel = "low"
    classes = files("$project.buildDir/intermediates/classes")
    source = fileTree('src/main/java/')
    classpath = files()

    reports {
        xml{
            destination "build/findbugs.xml"
        }
    }

}

靜態檢查的結果在app/build/findbugs.xml

【2】在Jenkins中配置

修改兩處:在Tasks中輸入 findbugs --debug

只勾選Run Always




【3】開始構建,構建成功後就可以生成靜態檢測報告了