I have a multi project build and need to place my project jars into one directory and library jar into the other directory.
I tried do this:
project(':someProj') {
distributions {
main {
contents {
into('jars') {
from(project.configurations.compile.copyRecursive(DependencySpecs.type(Type.EXTERNAL)))
}
}
}
}
}
But as a result I receive an error
Could not get unknown property ‘DependencySpecs’ for object of type org.gradle.api.internal.file.copy.CopySpecWrapper_Decorated
Variant 2:
distributions {
custom {
contents {
into(file('libsDir')) {
from {
subprojects.collect {
it.configurations.compile.copyRecursive(DependencySpecs.type(Type.EXTERNAL))
}
}
}
}
}
}
Was successfully compiled, but ‘installCustomDist’ do nothing:
Skipping task ‘:myproject:installCustomDist’ as it has no source files.
Also I tried copy task:
task libs(type: Copy) {
File libsDir = file('libsDir')
into libsDir
from {
subprojects.collect {
it.configurations.compile.copyRecursive(DependencySpecs.type(Type.EXTERNAL))
}
}
}
This was successful compiled, but there is no result.
Can someone help me?