diff --git a/.github/workflows/downstream.yaml b/.github/workflows/downstream.yaml index 8a41a7afcc..31c4429a26 100644 --- a/.github/workflows/downstream.yaml +++ b/.github/workflows/downstream.yaml @@ -151,7 +151,9 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-java@v3 with: + distribution: zulu java-version: ${{matrix.java}} - run: java -version + - run: sudo apt-get update -y - run: sudo apt-get install libxml2-utils - run: .kokoro/downstream-client-library-check.sh google-cloud-core-bom ${{matrix.repo}} diff --git a/CHANGELOG.md b/CHANGELOG.md index 6382267180..7694bb9efd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +### [2.5.11](https://github.com/googleapis/java-core/compare/v2.5.10...v2.5.11) (2022-03-28) + + +### Bug Fixes + +* **java:** Register Spanner classes for reflection to fix Native Image tests ([#760](https://github.com/googleapis/java-core/issues/760)) ([257de0f](https://github.com/googleapis/java-core/commit/257de0f71963550ce11aca608fdf9a99672ff19a)) + + +### Dependencies + +* update dependency com.google.api-client:google-api-client-bom to v1.33.4 ([#776](https://github.com/googleapis/java-core/issues/776)) ([1b6fb2a](https://github.com/googleapis/java-core/commit/1b6fb2a5b9602f5ff8375deb15f5121851b09bd1)) +* update dependency com.google.api:api-common to v2.1.5 ([#768](https://github.com/googleapis/java-core/issues/768)) ([c76c332](https://github.com/googleapis/java-core/commit/c76c332b5676bffad2a1e75b094790c9b0488447)) +* update dependency com.google.api:gax-bom to v2.13.0 ([#774](https://github.com/googleapis/java-core/issues/774)) ([8075c54](https://github.com/googleapis/java-core/commit/8075c54a127496a5330671652678b03f5abdd5c9)) +* update dependency com.google.api.grpc:proto-google-common-protos to v2.8.0 ([#770](https://github.com/googleapis/java-core/issues/770)) ([6809477](https://github.com/googleapis/java-core/commit/680947779ac9bc58f60c6c18750aac6b756e73b2)) +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.2.10 ([#763](https://github.com/googleapis/java-core/issues/763)) ([9f2eb5f](https://github.com/googleapis/java-core/commit/9f2eb5fed5d9dc91ee01068a2c4eec9acef38c86)) +* update dependency com.google.auth:google-auth-library-bom to v1.6.0 ([#765](https://github.com/googleapis/java-core/issues/765)) ([2eb1924](https://github.com/googleapis/java-core/commit/2eb19241f119f39de7d07ee863c9c78a3e7f11a4)) +* update dependency com.google.guava:guava to 31.1-jre ([#772](https://github.com/googleapis/java-core/issues/772)) ([060adf3](https://github.com/googleapis/java-core/commit/060adf35bf6afdd4b31d790e5484f63eac777a11)) +* update dependency com.google.http-client:google-http-client-bom to v1.41.5 ([#769](https://github.com/googleapis/java-core/issues/769)) ([999be7a](https://github.com/googleapis/java-core/commit/999be7ab10459b33ab001b5bd84d650aeb13313f)) +* update dependency org.threeten:threetenbp to v1.6.0 ([#767](https://github.com/googleapis/java-core/issues/767)) ([9a4a438](https://github.com/googleapis/java-core/commit/9a4a438e04acfd0ec15cdfac5da3610223fe0071)) + ### [2.5.10](https://github.com/googleapis/java-core/compare/v2.5.9...v2.5.10) (2022-03-10) diff --git a/google-cloud-core-bom/pom.xml b/google-cloud-core-bom/pom.xml index e196dc5c78..597dfc494a 100644 --- a/google-cloud-core-bom/pom.xml +++ b/google-cloud-core-bom/pom.xml @@ -3,12 +3,12 @@ 4.0.0 com.google.cloud google-cloud-core-bom - 2.5.10 + 2.5.11 pom com.google.cloud google-cloud-shared-config - 1.3.0 + 1.3.2 Google Cloud Core @@ -63,22 +63,22 @@ com.google.cloud google-cloud-core - 2.5.10 + 2.5.11 com.google.cloud google-cloud-core-grpc - 2.5.10 + 2.5.11 com.google.cloud google-cloud-core-http - 2.5.10 + 2.5.11 com.google.cloud native-image-support - 0.12.10 + 0.12.11 diff --git a/google-cloud-core-grpc/pom.xml b/google-cloud-core-grpc/pom.xml index 2c6ceca8d4..92eadb7115 100644 --- a/google-cloud-core-grpc/pom.xml +++ b/google-cloud-core-grpc/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-core-grpc - 2.5.10 + 2.5.11 jar Google Cloud Core gRPC https://github.com/googleapis/java-core @@ -13,7 +13,7 @@ com.google.cloud google-cloud-core-parent - 2.5.10 + 2.5.11 google-cloud-core-grpc diff --git a/google-cloud-core-http/pom.xml b/google-cloud-core-http/pom.xml index fddb5da100..07d8850b8e 100644 --- a/google-cloud-core-http/pom.xml +++ b/google-cloud-core-http/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-core-http - 2.5.10 + 2.5.11 jar Google Cloud Core HTTP https://github.com/googleapis/java-core @@ -13,7 +13,7 @@ com.google.cloud google-cloud-core-parent - 2.5.10 + 2.5.11 google-cloud-core-http diff --git a/google-cloud-core/pom.xml b/google-cloud-core/pom.xml index 90713c7223..a23267a7c2 100644 --- a/google-cloud-core/pom.xml +++ b/google-cloud-core/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-core - 2.5.10 + 2.5.11 jar Google Cloud Core https://github.com/googleapis/java-core @@ -13,7 +13,7 @@ com.google.cloud google-cloud-core-parent - 2.5.10 + 2.5.11 google-cloud-core diff --git a/native-image-support/pom.xml b/native-image-support/pom.xml index bb3237f653..744594fe2f 100644 --- a/native-image-support/pom.xml +++ b/native-image-support/pom.xml @@ -7,13 +7,13 @@ Google Cloud Native Image Support com.google.cloud native-image-support - 0.12.10 + 0.12.11 jar google-cloud-core-parent com.google.cloud - 2.5.10 + 2.5.11 diff --git a/native-image-support/src/main/java/com/google/cloud/nativeimage/features/clients/SpannerFeature.java b/native-image-support/src/main/java/com/google/cloud/nativeimage/features/clients/SpannerFeature.java index 3e5495840d..7c9fca1421 100644 --- a/native-image-support/src/main/java/com/google/cloud/nativeimage/features/clients/SpannerFeature.java +++ b/native-image-support/src/main/java/com/google/cloud/nativeimage/features/clients/SpannerFeature.java @@ -21,6 +21,7 @@ import com.oracle.svm.core.configure.ResourcesRegistry; import org.graalvm.nativeimage.ImageSingletons; import org.graalvm.nativeimage.hosted.Feature; +import org.graalvm.nativeimage.impl.ConfigurationCondition; /** Registers Spanner library classes for reflection. */ @AutomaticFeature @@ -28,6 +29,24 @@ final class SpannerFeature implements Feature { private static final String SPANNER_CLASS = "com.google.spanner.v1.SpannerGrpc"; private static final String SPANNER_TEST_CLASS = "com.google.cloud.spanner.GceTestEnvConfig"; + private static final String CLIENT_SIDE_IMPL_CLASS = + "com.google.cloud.spanner.connection.ClientSideStatementImpl"; + private static final String CLIENT_SIDE_VALUE_CONVERTER = + "com.google.cloud.spanner.connection.ClientSideStatementValueConverters"; + private static final String CONNECTION_IMPL = + "com.google.cloud.spanner.connection.ConnectionImpl"; + private static final String CLIENT_SIDE_STATEMENTS = + "com.google.cloud.spanner.connection.ClientSideStatements"; + private static final String CONNECTION_STATEMENT_EXECUTOR = + "com.google.cloud.spanner.connection.ConnectionStatementExecutor"; + private static final String CLIENT_SIDE_STATEMENT_NO_PARAM_EXECUTOR = + "com.google.cloud.spanner.connection.ClientSideStatementNoParamExecutor"; + private static final String CLIENT_SIDE_STATEMENT_SET_EXECUTOR = + "com.google.cloud.spanner.connection.ClientSideStatementSetExecutor"; + private static final String ABSTRACT_STATEMENT_PARSER = + "com.google.cloud.spanner.connection.AbstractStatementParser"; + private static final String STATEMENT_PARSER = + "com.google.cloud.spanner.connection.SpannerStatementParser"; @Override public void beforeAnalysis(BeforeAnalysisAccess access) { @@ -35,6 +54,34 @@ public void beforeAnalysis(BeforeAnalysisAccess access) { if (spannerTestClass != null) { NativeImageUtils.registerConstructorsForReflection(access, SPANNER_TEST_CLASS); } + if (access.findClassByName(CLIENT_SIDE_IMPL_CLASS) != null) { + NativeImageUtils.registerClassHierarchyForReflection(access, CLIENT_SIDE_IMPL_CLASS); + } + if (access.findClassByName(CLIENT_SIDE_STATEMENT_NO_PARAM_EXECUTOR) != null) { + NativeImageUtils.registerClassForReflection(access, CLIENT_SIDE_STATEMENT_NO_PARAM_EXECUTOR); + } + if (access.findClassByName(CLIENT_SIDE_STATEMENT_SET_EXECUTOR) != null) { + NativeImageUtils.registerClassForReflection(access, CLIENT_SIDE_STATEMENT_SET_EXECUTOR); + } + if (access.findClassByName(CLIENT_SIDE_VALUE_CONVERTER) != null) { + NativeImageUtils.registerClassHierarchyForReflection(access, CLIENT_SIDE_VALUE_CONVERTER); + } + if (access.findClassByName(CLIENT_SIDE_STATEMENTS) != null) { + NativeImageUtils.registerClassForReflection(access, CLIENT_SIDE_STATEMENTS); + } + if (access.findClassByName(CONNECTION_STATEMENT_EXECUTOR) != null) { + NativeImageUtils.registerClassForReflection(access, CONNECTION_STATEMENT_EXECUTOR); + } + if (access.findClassByName(CONNECTION_IMPL) != null) { + NativeImageUtils.registerClassForReflection(access, CONNECTION_IMPL); + } + if (access.findClassByName(ABSTRACT_STATEMENT_PARSER) != null) { + NativeImageUtils.registerClassHierarchyForReflection(access, ABSTRACT_STATEMENT_PARSER); + } + if (access.findClassByName(STATEMENT_PARSER) != null) { + NativeImageUtils.registerConstructorsForReflection(access, STATEMENT_PARSER); + } + Class spannerClass = access.findClassByName(SPANNER_CLASS); if (spannerClass != null) { NativeImageUtils.registerClassHierarchyForReflection( @@ -47,9 +94,13 @@ public void beforeAnalysis(BeforeAnalysisAccess access) { // Resources ResourcesRegistry resourcesRegistry = ImageSingletons.lookup(ResourcesRegistry.class); resourcesRegistry.addResources( + ConfigurationCondition.alwaysTrue(), "\\Qcom/google/cloud/spanner/connection/ClientSideStatements.json\\E"); resourcesRegistry.addResources( "\\Qcom/google/cloud/spanner/spi/v1/grpc-gcp-apiconfig.json\\E"); + resourcesRegistry.addResources( + ConfigurationCondition.alwaysTrue(), + "\\Qcom/google/cloud/spanner/connection/ITSqlScriptTest_TestQueryOptions.sql\\E"); } } } diff --git a/pom.xml b/pom.xml index 6ecb048483..b25f8c179b 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-core-parent pom - 2.5.10 + 2.5.11 Google Cloud Core Parent https://github.com/googleapis/java-core @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.3.0 + 1.3.2 @@ -151,24 +151,24 @@ UTF-8 github google-cloud-core-parent - 2.12.2 - 2.1.4 - 2.7.4 - 1.2.9 - 1.5.3 - 1.33.2 - 1.41.4 + 2.13.0 + 2.1.5 + 2.8.0 + 1.2.10 + 1.6.0 + 1.33.4 + 1.41.5 22.0.0.2 1.45.0 3.19.4 0.31.0 1.3.2 - 31.0.1-jre + 31.1-jre 4.13.2 1.1.3 4.3 3.0.2 - 1.5.2 + 1.6.0 3.2 2.11.0 2.9.0 diff --git a/versions.txt b/versions.txt index 5e65b1a615..906d83d5ea 100644 --- a/versions.txt +++ b/versions.txt @@ -1,5 +1,5 @@ # Format: # module:released-version:current-version -google-cloud-core:2.5.10:2.5.10 -native-image-support:0.12.10:0.12.10 \ No newline at end of file +google-cloud-core:2.5.11:2.5.11 +native-image-support:0.12.11:0.12.11 \ No newline at end of file