gradle-completion icon indicating copy to clipboard operation
gradle-completion copied to clipboard

Does not work nicely with custom build script names created by variables

Open Vampire opened this issue 8 years ago • 0 comments

The completion works fine if your root build script is either named build.gradle or its name is set via rootProject.buildFileName = '...' or rootProject.buildFileName = "..." (actually also rootProject.buildFileName = "...' and rootProject.buildFileName = '...", but those will not compile anyway) exactly like that. You cannot use a variable for the name, you cannot leave out the spaces around the equals sign or add more, it has to be at the start of a line without any preceding whitespaces, and you cannot use other constructs to set the name that are perfectly legal. In my case I do it for all projects like this which of course also does not work:

def setBuildFileNameRecursively
setBuildFileNameRecursively = { it ->
   it.buildFileName = "${it.name}.gradle"
   it.children.each { setBuildFileNameRecursively it }
}
setBuildFileNameRecursively rootProject

It would be nice if the completion would not require some narrow range of modification options but simply work. Is it really necessary to determine the root project filename upfront? Can't you use -p instead of -b for the call and use the project dir as cache key instead of the build file?

Vampire avatar Jun 14 '17 15:06 Vampire