Hi,
I am pretty new to gradle and after doing good amount searching - posting it here.
In a multi-project build, I am trying to apply distributions to all sub-projects and the custom distribution name should be same as the subproject. But i am having issues figuring out a way to do it. Below is how I was trying
Project Structure:
rootProject
- subProject1
- subSubProject1
- subSubProject2
- subProject2
Inside subProject1 build.gradle - I am tying below code
subprojects {
apply plugin: 'distribution'
tasks.withType(Tar) {
compression = Compression.GZIP
extension = 'tar.gz'
}
def distName = it.name
def distNameWithResources = it.name + 'WithResources'
distributions {
distName {
contents {
into('') {
from("somefile.sh")
fileMode 0755
}
}
}
distNameWithResources {
contents {
into('resources') {
from tarTree("${rootDir}/resources/resources.tar.gz")
}
into('') {
from("somefile.sh")
fileMode 0755
}
}
}
}
}
But when i try this - I get below error
* What went wrong:
A problem occurred evaluating project ':subProject1'.
> No signature of method: java.lang.String.call() is applicable for argument types: (build_4lwtu0zhwpisgjzqhmd10p8kj$_run_closure1$_closure7$_closure8) values: [build_4lwtu0zhwpisgjzqhmd10p8kj$_run_closure1$_closure7$_closure8@7c0f8d06]
Possible solutions: wait(), chars(), any(), wait(long), take(int), any(groovy.lang.Closure)