Skip to content

Commit

Permalink
Update dependency from spring-cloud-gcp-core to autoconfigure
Browse files Browse the repository at this point in the history
  • Loading branch information
emmileaf committed Jan 4, 2023
1 parent 94b1d09 commit d6e400e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
1 change: 1 addition & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ SPRING_DEPS = [
"@maven//:org_springframework_boot_spring_boot",
"@maven//:org_springframework_spring_context",
"@maven//:org_springframework_spring_beans",
"@maven//:com_google_cloud_spring_cloud_gcp_autoconfigure",
"@maven//:com_google_cloud_spring_cloud_gcp_core",
"@maven//:commons_logging_commons_logging",
]
Expand Down
2 changes: 1 addition & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ load("@rules_jvm_external//:defs.bzl", "maven_install")

SPRING_MAVEN_ARTIFACTS = [
"org.springframework.boot:spring-boot-starter:2.7.4",
"com.google.cloud:spring-cloud-gcp-core:3.3.0",
"com.google.cloud:spring-cloud-gcp-autoconfigure:3.3.0",
]

maven_install(
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>spring-cloud-gcp-core</artifactId>
<artifactId>spring-cloud-gcp-autoconfigure</artifactId>
<version>3.3.0</version>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import com.google.api.generator.spring.utils.ComposerUtils;
import com.google.api.generator.spring.utils.LoggerUtils;
import com.google.api.generator.spring.utils.Utils;
import com.google.cloud.spring.autoconfigure.core.GcpContextAutoConfiguration;
import com.google.cloud.spring.core.Credentials;
import com.google.cloud.spring.core.DefaultCredentialsProvider;
import com.google.common.base.CaseFormat;
Expand Down Expand Up @@ -316,7 +317,7 @@ private static List<AnnotationNode> createClassAnnotations(
VariableExpr.builder()
.setVariable(
Variable.builder().setType(TypeNode.CLASS_OBJECT).setName("class").build())
.setStaticReferenceType(types.get("GcpContextAutoConfiguration"))
.setStaticReferenceType(STATIC_TYPES.get("GcpContextAutoConfiguration"))
.build())
.build();
AnnotationNode configurationNode =
Expand Down Expand Up @@ -963,6 +964,7 @@ private static Map<String, TypeNode> createStaticTypes() {
ConditionalOnMissingBean.class,
EnableConfigurationProperties.class,
CredentialsProvider.class,
GcpContextAutoConfiguration.class,
AutoConfiguration.class,
AutoConfigureAfter.class,
Bean.class,
Expand Down Expand Up @@ -1013,15 +1015,6 @@ private static Map<String, TypeNode> createDynamicTypes(Service service, String
.setPakkage("com.google.cloud.spring.core.util")
.build());

// TODO: This should move to static types after adding spring-cloud-gcp-autoconfigure as
// dependency
TypeNode gcpContextAutoConfiguration =
TypeNode.withReference(
VaporReference.builder()
.setName("GcpContextAutoConfiguration")
.setPakkage("com.google.cloud.spring.autoconfigure")
.build());

TypeNode serviceClient =
TypeNode.withReference(
VaporReference.builder()
Expand Down Expand Up @@ -1049,7 +1042,6 @@ private static Map<String, TypeNode> createDynamicTypes(Service service, String
typeMap.put("ServiceSettingsBuilder", serviceSettingsBuilder);
typeMap.put("Retry", retryProperties);
typeMap.put("RetryUtil", retryUtil);
typeMap.put("GcpContextAutoConfiguration", gcpContextAutoConfiguration);

return typeMap;
}
Expand Down

0 comments on commit d6e400e

Please sign in to comment.