Skip to content
This repository has been archived by the owner on Aug 19, 2020. It is now read-only.

Can't fail build in gradle.taskGraph.whenReady(Action) #1143

Closed
dsvoronin opened this issue Sep 25, 2018 · 3 comments
Closed

Can't fail build in gradle.taskGraph.whenReady(Action) #1143

dsvoronin opened this issue Sep 25, 2018 · 3 comments

Comments

@dsvoronin
Copy link

dsvoronin commented Sep 25, 2018

Expected Behavior

Following code in build.gradle.kts should fail build in the end of configuration phase:

gradle.taskGraph.whenReady {
    throw GradleException("!!!")
}

Current Behavior

Build successful with any type of exception thrown

same code in groovy fails build as expected

gradle.taskGraph.whenReady {
    throw new GradleException("!!!")
}

Context

I'm trying to configure fail fast properties validation for plugin

Your Environment

I'm using gradle 4.10.1 (also tried with .2 version)
It's just a sample Android studio project with provided sample added into root build.gradle.kts

@bamboo
Copy link
Member

bamboo commented Sep 25, 2018

Thanks for the report, @dsvoronin.

Curiously enough the Closure overload fails the build as expected:

gradle.taskGraph.whenReady(closureOf<TaskExecutionGraph> {
    throw GradleException("!!!")
})

@dsvoronin
Copy link
Author

dsvoronin commented Sep 25, 2018

Yep, closureOf variant works for me now (somehow failed when i tried)

@eskatos eskatos changed the title Can't fail build in gradle.taskGraph.whenReady Can't fail build in gradle.taskGraph.whenReady(Action) Sep 26, 2018
@eskatos
Copy link
Member

eskatos commented Sep 26, 2018

Issue moved to gradle/gradle #6900 via ZenHub

@eskatos eskatos closed this as completed Sep 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants