Unzip gradle dependencies using artifact name
<p>I'm looking for a way to extract a project's dependencies for a certain configuration into a workspace folder. As there might be more than one dependency I want to extract each artifact into a folder with the artifact's name. I'm trying to solve this in the context of python but this question is not really python related...</p>

<p>Currently my gradle file looks like this:</p>

<pre><code>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'
}
</code></pre>

<p>This however extracts all dependencies in the <code>python</code> configuration into the folder <code>lib\pyhton</code> without using the artifacts' names.</p>

<p>What I want is that <code>py-utils</code> gets extracted to <code>lib\pyhton\py-utils</code> and <code>py-test</code> to <code>lib\pyhton\py-test</code>.</p>