Validate presense of gradle wrapper to provide better feedback

- Provide a more useful error message when no Gradle wrapper can be located,
  and 'gradle-version' or 'gradle-executable' is not used.
- Add test for case where wrapper is missing.
  This isn't really a "test" per-se, but this failing build invocation makes it
  easy to verify the GitHub action behaviour when the build is misconfigured.
This commit is contained in:
Daz DeBoer 2021-06-24 12:13:54 -07:00
parent f0c6ac01d3
commit 15a8123fbc
4 changed files with 29 additions and 1 deletions

View file

@ -62,6 +62,7 @@ async function resolveGradleExecutable(
? path.resolve(workspaceDirectory, wrapperDirectory)
: buildRootDirectory
gradlew.validateGradleWrapper(gradlewDirectory)
await cacheWrapper.restoreCachedWrapperDist(gradlewDirectory)
return path.resolve(gradlewDirectory, gradlew.wrapperFilename())