在 build.gradle 中添加任务:
task getDeps(type: Copy) {
from sourceSets.main.runtimeClasspath
into 'runtime/'
}
运行 gradle getDeps
,会将依赖的jar下载到 runtime 目录。
在 build.gradle 中添加任务:
task copyDeps(type: Copy) {
from (configurations.compile + configurations.testCompile) {
include "*.jar"
include "*.so", "*.dll"
}
into rootProject.rootDir.getAbsolutePath() + "/lib"
}
运行 gradle copyDeps
,会将依赖的jar下载到 lib 目录。
( 本文完 )
扫码阅读本文