gradle-release
gradle-release copied to clipboard
Task with name 'build' not found in root project gradlebuild_examples'
plugins { id 'net.researchgate.release' version '2.4.0'
}
- What went wrong:
A problem occurred configuring root project 'gradlebuild_examples'.
Task with name 'build' not found in root project gradlebuild_examples'.
What buildTasks used for? The following settings are wrong buildTasks = [ 'build'] buildTasks = [ 'assembleRelease']
ERROR:
Task with name 'assembleRelease' not found in root project 'gradlebuild_examples'.
To tell the plugin which gradle task builds your project. For example in java project the build task creates the jar and also runs the tests.
build android project
buildTasks = [ 'app:assembleRelease']
Task with name 'app:assembleRelease' not found in root project 'gradlebuild_examples'.
buildTasks = [ 'app:build']
Task with name 'app:build' not found in root project 'gradlebuild_examples'.
This is a bug and needs a major change to fix it. As a workaround you could create a task build and add dependsOn to your child project tasks, now buildTasks = [ 'build'] should work and run the other tasks on execution. If the build task is already there you can use a different name or only add the dependsOn to the other tasks.
Good day, Has there been any progress on this? I need to build 3 release builds for 3 different flavors. eg. buildTasks = [assemble$feature$flavor]
There is no progress yet on this.
okay, thank you.
+1 to issue, I want to use plugin, but don't want to re-write the code in order to use it =)
+1 this issue, older version has "Task.leftShift(Closure) method has been deprecated" with gradle 4.1, newer version fails with this error.
+1 .
+1
what is the workaround for an android application? This doesn't seem to work:
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-beta7'
}
}
plugins {
id 'net.researchgate.release' version '2.4.0'
}
task build {}
build.dependsOn('app:build')
build.dependsOn('lib:build')
release {
buildTasks=['build']
...
}
What is the output of gradle?
classpath 'net.researchgate:gradle-release:2.1.2' seems to work fine but when I update the version to 'net.researchgate:gradle-release:2.4.0' I get Error:Task with name 'build' not found in root project error.
+1 gradle-release 2.6.0
'com.android.tools.build:gradle:3.4.2'
Hello, I encountered this error too. I'm using gradle 6.8 and I have a multi-project build. I tried the suggested workaround and it worked, however passing the argument -x test
to the command line has no effect, and I really would like to exclude the execution of my tests because they are very long and the release should be fast (in my environment, the tests are executed apart).
The reason that it doesn't work is because the release task creates another gradle build with new startParameters. See https://github.com/researchgate/gradle-release/blob/master/src/main/groovy/net/researchgate/release/ReleasePlugin.groovy#L43 If you want to exclude them always or use some other way with properties env etc... you can set the tasks to exclude on task level in your build.gradle. See https://docs.gradle.org/current/javadoc/org/gradle/StartParameter.html#setExcludedTaskNames-java.lang.Iterable-
Thank you very much for your reponse @Hillkorn
I thought I understand what to do but I am not a gradle guru. I tried several things to customize the release
task or the runBuildTasks
(I noticed the same startParameter.newInstance()
) task but without success. Basically what I would like to achieve is, if I call gradle release
, I would like to exclude the task test
. I wonder if I can do that from my build.gradle or if it is only possible from the plugin source.