- 在Project的build.gradle文件添加下面幾行代碼:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
#下面這句是添加的
classpath 'com.gradle:build-scan-plugin:1.8'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
#下面5行是添加的
apply plugin: 'com.gradle.build-scan'
buildScan {
licenseAgreementUrl = 'https://gradle.com/terms-of-service'
licenseAgree = 'yes'
}
allprojects {
repositories {
google()
jcenter()
}
}
- 在控制臺執行命令 ./gradlew build --scan
-
命令執行完后會給出一個網址,打開網址根據提示就可以得到相應的構建審核內容,如下圖:
image.png
注意
- Gradle不同的版本對應的build-scan-plugin的版本也不同,可以在官網查看對應的版本號(上面示例使用Gradle的4.2.1版本);