Gradle tooling API freezes if checksum verification fails #9361

@chyingo

Description

Expected Behavior

Gradle should throw RuntimeException indicating "Verification of Gradle distribution failed".

Current Behavior

The tooling API never return. Had to manually kill the process to continue.

Context

Sometimes user forgets to update the checksum value after changing the versions of Gradle distribution. Tooling API should fail gracefully in that case.

Steps to Reproduce

Add this line to gradle-wrapper.properties,
"distributionsha256sum=[Some Invalid SHA]"
Query any builder model using ModelBuilder#get(), and notice it hangs.