【发布时间】:2016-12-25 07:07:04
【问题描述】:
我正在寻找一种方法来将某个配置的项目依赖项提取到工作区文件夹中。由于可能存在多个依赖项,我想将每个工件提取到具有工件名称的文件夹中。我试图在 python 的上下文中解决这个问题,但这个问题与 python 无关......
目前我的 gradle 文件如下所示:
configurations { python }
dependencies {
python group: 'github.dpeger', name: 'py-utils', version: '1.6', ext: 'zip'
python group: 'github.dpeger', name: 'py-test', version: '1.6', ext: 'zip'
}
task cleanPythonDependencies(type: Delete) { delete 'lib/python' }
tasks.clean.dependsOn cleanPythonDependencies
task importPythonDependencies(type: Copy) {
dependsOn cleanPythonDependencies
from {
configurations.python.collect { zipTree(it) }
}
into 'lib/python'
}
然而,这会将 python 配置中的所有依赖项提取到文件夹 lib\pyhton 中,而不使用工件的名称。
我想要的是 py-utils 被提取到 lib\pyhton\py-utils 和 py-test 到 lib\pyhton\py-test。
【问题讨论】:
标签: gradle dependencies unzip