use of com.google.cloud.tools.appengine.cloudsdk.CloudSdkNotFoundException in project google-cloud-intellij by GoogleCloudPlatform.
the class CloudSdkValidator method validateCloudSdk.
protected Set<CloudSdkValidationResult> validateCloudSdk(Path path) {
Set<CloudSdkValidationResult> validationResults = new HashSet<>();
if (path == null) {
validationResults.add(CloudSdkValidationResult.CLOUD_SDK_NOT_FOUND);
// If the Cloud SDK is not found, don't bother checking anything else
return validationResults;
}
CloudSdk sdk = buildCloudSdkWithPath(path);
try {
sdk.validateCloudSdk();
} catch (CloudSdkNotFoundException exception) {
validationResults.add(CloudSdkValidationResult.CLOUD_SDK_NOT_FOUND);
// If the Cloud SDK is not found, don't bother checking anything else
return validationResults;
} catch (CloudSdkOutOfDateException exception) {
validationResults.add(com.google.cloud.tools.intellij.appengine.sdk.CloudSdkValidationResult.CLOUD_SDK_VERSION_NOT_SUPPORTED);
}
try {
sdk.validateAppEngineJavaComponents();
} catch (AppEngineJavaComponentsNotInstalledException ex) {
validationResults.add(CloudSdkValidationResult.NO_APP_ENGINE_COMPONENT);
}
return validationResults;
}
use of com.google.cloud.tools.appengine.cloudsdk.CloudSdkNotFoundException in project app-maven-plugin by GoogleCloudPlatform.
the class CloudSdkAppEngineFactory method defaultCloudSdkBuilder.
protected CloudSdk.Builder defaultCloudSdkBuilder() {
mojo.handleCloudSdkPathDeprecation();
Path sdkPath = mojo.getCloudSdkHome();
if (mojo.getCloudSdkHome() == null) {
sdkPath = cloudSdkOperationsFactory.newDownloader(mojo.getCloudSdkVersion()).downloadCloudSdk(mojo.getLog());
}
CloudSdk.Builder cloudSdkBuilder = cloudSdkFactory.cloudSdkBuilder().sdkPath(sdkPath);
if (mojo.getCloudSdkHome() != null && mojo.getCloudSdkVersion() != null) {
try {
cloudSdkOperationsFactory.newChecker(mojo.getCloudSdkVersion()).checkCloudSdk(cloudSdkBuilder.build());
} catch (CloudSdkNotFoundException | CloudSdkVersionFileException | InvalidJavaSdkException | AppEngineJavaComponentsNotInstalledException | CloudSdkOutOfDateException ex) {
throw new RuntimeException(ex);
}
}
ProcessOutputLineListener lineListener = new DefaultProcessOutputLineListener(mojo.getLog());
return cloudSdkBuilder.addStdOutLineListener(lineListener).addStdErrLineListener(lineListener).exitListener(new NonZeroExceptionExitListener()).appCommandMetricsEnvironment(mojo.getArtifactId()).appCommandMetricsEnvironmentVersion(mojo.getArtifactVersion()).appCommandCredentialFile(mojo.getServiceAccountKeyFile());
}
Aggregations