项目自动化构建工具 Gradle

码农软件 · 软件分类 · 项目构建 · 2019-11-17 06:27:05

软件介绍

Gradle 是一个基于 Apache Ant 和 Apache Maven 概念的项目自动化构建工具,支持依赖管理和多项目,类似 Groovy 的特定领域语言来声明项目设置,而不是传统的 XML。

当前其支持的语言限于 Java、Groovy 和 Scala,计划未来将支持更多的语言。

usePlugin 'groovy'

repositories {
    flatDir dirs: "lib"
}

dependencies {
    groovy ':groovy-all:1.7.0'
    compile fileTree(dir: 'lib', includes: ['*.jar'])
    runtime fileTree(dir: 'lib', includes: ['*.jar'])
}

// usage: gradle -i run
task run(dependsOn: classes) << {
    captureStandardOutput(LogLevel.INFO)
    ant.java( 
        classname: 'fox.gem.GroovyClass',
        fork: true,
        classpath: "${sourceSets.main.runtimeClasspath.asPath}"
    )
}

以上是 Gradle 的构建文件 build.gradle 中的内容,是不是比 Ant 的 build.xml 要简单太多了?这就是“惯例”的力量。由此,我们可以了解 Gradle 的第一个特点:“CoC(惯例优于配置)”。只要按照 Gradle 的惯例,那么可以最大限度的减少 build 文件的内容。

本文地址:https://codercto.com/soft/d/19158.html

We Are the Nerds

We Are the Nerds

Christine Lagorio-Chafkin / Hachette Books / 2018-10-2 / USD 18.30

Reddit hails itself as "the front page of the Internet." It's the third most-visited website in the United States--and yet, millions of Americans have no idea what it is. We Are the Nerds is an eng......一起来看看 《We Are the Nerds》 这本书的介绍吧!

随机密码生成器
随机密码生成器

多种字符组合密码

SHA 加密
SHA 加密

SHA 加密工具

html转js在线工具
html转js在线工具

html转js在线工具