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

Commit

Permalink
Remove injectGcloud
Browse files Browse the repository at this point in the history
  • Loading branch information
chanseokoh committed Feb 12, 2021
1 parent 4f4ca16 commit 9018e56
Showing 1 changed file with 8 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ public void configureCoreProperties(
createDeployQueueTask();
createDeployAllTask();
createShowConfigurationTask();
injectGcloud();
}

private void configureFactories() {
Expand Down Expand Up @@ -198,6 +197,7 @@ private void createLoginTask() {

project.afterEvaluate(
project -> {
cloudSdkLogin.configure(task -> task.setGcloud(cloudSdkOperations.getGcloud()));
if (toolsExtension.getServiceAccountKeyFile() != null) {
String warn =
"WARNING: ServiceAccountKeyFile is configured and will be used instead of Cloud "
Expand Down Expand Up @@ -265,10 +265,13 @@ private void createDeployTaskHelper(
task.setDescription(taskDescription);
});

if (injectDeployExtension) {
project.afterEvaluate(
project -> taskProvider.configure(task -> task.setDeployExtension(deployExtension)));
}
project.afterEvaluate(
project -> {
taskProvider.configure(task -> task.setGcloud(cloudSdkOperations.getGcloud()));
if (injectDeployExtension) {
taskProvider.configure(task -> task.setDeployExtension(deployExtension));
}
});
}

private void createShowConfigurationTask() {
Expand All @@ -294,14 +297,4 @@ private void checkGradleVersion() {
+ " or higher.");
}
}

private void injectGcloud() {
project.afterEvaluate(
project -> {
project
.getTasks()
.matching(task -> task instanceof GcloudTask)
.configureEach(task -> ((GcloudTask) task).setGcloud(cloudSdkOperations.getGcloud()));
});
}
}

0 comments on commit 9018e56

Please sign in to comment.