【发布时间】:2018-10-20 12:43:18
【问题描述】:
gradle 构建文件中depends 关键字和dependencies 关键字有什么区别?我在以下情况下遇到了这些关键字:
取决于:
project(':tools:bnd-module-plugin') {
description = "bnd plugin to build moduleinfo with ${rootProject.description}"
sourceSets.main.java.srcDirs += project(':asm').sourceSets.main.java.srcDirs
depends = ['biz.aQute.bnd:biz.aQute.bnd:3.4.0']
}
依赖:
subprojects {
apply plugin: 'com.github.sherter.google-java-format'
googleJavaFormat.toolVersion = '1.4'
compileTestJava {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
dependencies {
requires.each { projectName -> compile project(projectName) }
depends.each { artifactName -> compile artifactName }
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.1.0',
'org.junit.jupiter:junit-jupiter-params:5.1.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.1.0'
testCompile project(':asm-test')
}
}
【问题讨论】:
-
@lu.koerfer 已编辑
标签: gradle build dependencies