Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Commit

Permalink
Make it clear the user configured version is wrong (#273)
Browse files Browse the repository at this point in the history
* Make it clear the user configured version is wrong
  • Loading branch information
loosebazooka committed Jun 26, 2018
1 parent ad7a8b9 commit fdf76aa
Showing 1 changed file with 11 additions and 4 deletions.
Expand Up @@ -95,23 +95,30 @@ public void configureCoreProperties(

private void configureFactories() {
project.afterEvaluate(
project -> {
projectAfterEvaluated -> {
try {
if (toolsExtension.getCloudSdkHome() == null) {
managedCloudSdk =
new ManagedCloudSdkFactory(toolsExtension.getCloudSdkVersion()).newManagedSdk();
toolsExtension.setCloudSdkHome(managedCloudSdk.getSdkHome().toFile());
}
} catch (UnsupportedOsException | BadCloudSdkVersionException ex) {
throw new GradleException("Configuring... ", ex);
} catch (UnsupportedOsException ex) {
throw new RuntimeException(ex.getMessage(), ex);
} catch (BadCloudSdkVersionException ex) {
throw new RuntimeException(
"Failed to auto-configure Cloud Sdk at cloudSdkVersion = '"
+ toolsExtension.getCloudSdkVersion()
+ "': "
+ ex.getMessage(),
ex);
}

try {
cloudSdkOperations =
new CloudSdkOperations(
toolsExtension.getCloudSdkHome(), toolsExtension.getServiceAccountKeyFile());
} catch (CloudSdkNotFoundException ex) {
// this should never happen, not foudn exception only occurs when auto-discovery fails,
// this should never happen, not found exception only occurs when auto-discovery fails,
// but we don't use that mechanism anymore.
throw new AssertionError("Failed when attempting to discover SDK: ", ex);
}
Expand Down

0 comments on commit fdf76aa

Please sign in to comment.