gradle build scan

1:gradle build scan 用于视图审查

  构建步骤如下  https://guides.gradle.org/creating-build-scans/?_ga=2.80362963.595316040.1517890073-1324300803.1517890073#enable_build_scans_on_all_builds_of_your_project

2:build.gradle  中配置代码

    

//buildscript {        //gradle 2.0+  添加构建审视的方法
//    repositories {
//        maven {
//            url "https://plugins.gradle.org/m2/"
//        }
//    }
//    dependencies {
//        classpath "com.gradle:build-scan-plugin:1.11"
//    }
//}
//
//apply plugin: "com.gradle.build-scan"
plugins {  //构建审视,gradle 2.1+,  前面只能有plugis和buildscript元素
    id 'com.gradle.build-scan' version '1.11'  //在插件里面也要在最前面
    id 'java'
}

buildScan {  //gradle,scans.gradle.com 版,推送到云端,另外一种是企业版,推送到企业服务器。构建审视,利于团队开发,版本管理等。
    licenseAgreementUrl = 'https://gradle.com/terms-of-service'
    licenseAgree = 'yes'
    publishAlways()  //gradle clean build --scan  可以使用命令行控制哪次进行构建审视
}
//如果想要build-scan应用于说有gradle,可以在gradle目录下(C:\Users\lenovo\.gradle)放置init.gradle,添加内容
//initscript {
//    repositories {
//        maven { url 'https://plugins.gradle.org/m2' }
//    }
//    dependencies {
//        classpath 'com.gradle:build-scan-plugin:1.11'
//    }
//}
//rootProject {
//    apply plugin: com.gradle.scan.plugin.BuildScanPlugin
//}

group 'com.li'
version '1.0-SNAPSHOT'

apply plugin: 'java'


sourceCompatibility = 1.8



repositories {
    mavenCentral()
}

dependencies {
    testCompile group: 'junit', name: 'junit', version: '4.12'
}

3:执行方法,右侧可以初始化,也可以命令行执行。点击publishing链接,邮件激活,查看推送

     

 4:查看gradle

 

 

posted @ 2018-02-06 13:23  1367356  阅读(1619)  评论(0编辑  收藏  举报