我希望能够提取某个配置下的项目依赖项到工作区文件夹中,这些依赖项可能不止一个,我希望将每个构件提取到以该构件名称命名的文件夹中。我正在尝试在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
。
cleanPythonDependencies
将在配置阶段之后执行,从而再次删除所有提取的构件... - dpr