android {
lintOptions {
// 設置為 true時lint將不報告分析的進度
quiet true
// 如果為 true,則當lint發現錯誤時停止 gradle構建
abortOnError false
// 如果為 true,則只報告錯誤
ignoreWarnings true
// 如果為 true,則當有錯誤時會顯示文件的全路徑或絕對路徑 (默認情況下為true)
//absolutePaths true
// 如果為 true,則檢查所有的問題,包括默認不檢查問題
checkAllWarnings true
// 如果為 true,則將所有警告視為錯誤
warningsAsErrors true
// 不檢查給定的問題id
disable 'TypographyFractions','TypographyQuotes'
// 檢查給定的問題 id
enable 'RtlHardcoded','RtlCompat', 'RtlEnabled'
// * 僅 * 檢查給定的問題 id
check 'NewApi', 'InlinedApi'
// 如果為true,則在錯誤報告的輸出中不包括源代碼行
noLines true
// 如果為 true,則對一個錯誤的問題顯示它所在的所有地方,而不會截短列表,等等。
showAll true
// 重置 lint 配置(使用默認的嚴重性等設置)。
lintConfig file("default-lint.xml")
// 如果為 true,生成一個問題的純文本報告(默認為false)
textReport true
// 配置寫入輸出結果的位置;它可以是一個文件或 “stdout”(標准輸出)
textOutput 'stdout'
// 如果為真,會生成一個XML報告,以給Jenkins之類的使用
xmlReport false
// 用於寫入報告的文件(如果不指定,默認為lint-results.xml)
xmlOutput file("lint-report.xml")
// 如果為真,會生成一個HTML報告(包括問題的解釋,存在此問題的源碼,等等)
htmlReport true
// 寫入報告的路徑,它是可選的(默認為構建目錄下的 lint-results.html )
htmlOutput file("lint-report.html")
// 設置為 true, 將使所有release 構建都以issus的嚴重性級別為fatal(severity=false)的設置來運行lint
// 並且,如果發現了致命(fatal)的問題,將會中止構建(由上面提到的 abortOnError 控制)
checkReleaseBuilds true
// 設置給定問題的嚴重級別(severity)為fatal (這意味着他們將會
// 在release構建的期間檢查 (即使 lint 要檢查的問題沒有包含在代碼中)
fatal 'NewApi', 'InlineApi'
// 設置給定問題的嚴重級別為error
error 'Wakelock', 'TextViewEdits'
// 設置給定問題的嚴重級別為warning
warning 'ResourceAsColor'
// 設置給定問題的嚴重級別(severity)為ignore (和不檢查這個問題一樣)
ignore 'TypographyQuotes'
}
}