From cb32cf1ae569ab5ae2ee37254dc08b7736f15cb6 Mon Sep 17 00:00:00 2001 From: Brad Corso Date: Thu, 12 Sep 2024 13:02:42 -0700 Subject: [PATCH] Update Kotlin Metadata dependency to 2.0.0-Beta5 RELNOTES=N/A PiperOrigin-RevId: 673971090 --- WORKSPACE | 2 +- .../hilt/processor/internal/kotlin/BUILD | 2 +- .../internal/kotlin/KotlinMetadata.java | 22 +++++++++---------- java/dagger/internal/codegen/kotlin/BUILD | 2 +- .../codegen/kotlin/KotlinMetadata.java | 20 ++++++++--------- java/dagger/spi/BUILD | 2 +- third_party/kotlin/kotlin_metadata_jvm/BUILD | 22 +++++++++++++++++++ tools/maven/maven.bzl | 2 +- 8 files changed, 48 insertions(+), 26 deletions(-) create mode 100644 third_party/kotlin/kotlin_metadata_jvm/BUILD diff --git a/WORKSPACE b/WORKSPACE index de0560c9402..8ba89d24ea4 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -291,7 +291,7 @@ maven_install( "org.jetbrains.kotlin:kotlin-compiler-embeddable:%s" % KOTLIN_VERSION, "org.jetbrains.kotlin:kotlin-daemon-embeddable:%s" % KOTLIN_VERSION, "org.jetbrains.kotlin:kotlin-stdlib:%s" % KOTLIN_VERSION, - "org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.6.2", + "org.jetbrains.kotlin:kotlin-metadata-jvm:2.0.0-Beta5", "org.jspecify:jspecify:1.0.0", "org.mockito:mockito-core:2.28.2", "org.pantsbuild:jarjar:1.7.2", diff --git a/java/dagger/hilt/processor/internal/kotlin/BUILD b/java/dagger/hilt/processor/internal/kotlin/BUILD index 437ea0f3452..5fe9052c14e 100644 --- a/java/dagger/hilt/processor/internal/kotlin/BUILD +++ b/java/dagger/hilt/processor/internal/kotlin/BUILD @@ -33,7 +33,7 @@ java_library( "//third_party/java/javapoet", "//third_party/java/jsr305_annotations", "//third_party/java/jsr330_inject", + "//third_party/kotlin/kotlin_metadata_jvm", "@maven//:org_jetbrains_kotlin_kotlin_stdlib", - "@maven//:org_jetbrains_kotlinx_kotlinx_metadata_jvm", ], ) diff --git a/java/dagger/hilt/processor/internal/kotlin/KotlinMetadata.java b/java/dagger/hilt/processor/internal/kotlin/KotlinMetadata.java index e98b2b363f8..67b2177a089 100644 --- a/java/dagger/hilt/processor/internal/kotlin/KotlinMetadata.java +++ b/java/dagger/hilt/processor/internal/kotlin/KotlinMetadata.java @@ -17,7 +17,7 @@ package dagger.hilt.processor.internal.kotlin; import static dagger.internal.codegen.extension.DaggerStreams.toImmutableMap; -import static kotlinx.metadata.Flag.ValueParameter.DECLARES_DEFAULT_VALUE; +import static kotlin.metadata.Flag.ValueParameter.DECLARES_DEFAULT_VALUE; import androidx.room.compiler.processing.XAnnotation; import androidx.room.compiler.processing.XFieldElement; @@ -38,16 +38,16 @@ import java.util.function.Function; import javax.annotation.Nullable; import kotlin.Metadata; -import kotlinx.metadata.Flag; -import kotlinx.metadata.KmClass; -import kotlinx.metadata.KmConstructor; -import kotlinx.metadata.KmFunction; -import kotlinx.metadata.KmProperty; -import kotlinx.metadata.jvm.JvmExtensionsKt; -import kotlinx.metadata.jvm.JvmFieldSignature; -import kotlinx.metadata.jvm.JvmMetadataUtil; -import kotlinx.metadata.jvm.JvmMethodSignature; -import kotlinx.metadata.jvm.KotlinClassMetadata; +import kotlin.metadata.Flag; +import kotlin.metadata.KmClass; +import kotlin.metadata.KmConstructor; +import kotlin.metadata.KmFunction; +import kotlin.metadata.KmProperty; +import kotlin.metadata.jvm.JvmExtensionsKt; +import kotlin.metadata.jvm.JvmFieldSignature; +import kotlin.metadata.jvm.JvmMetadataUtil; +import kotlin.metadata.jvm.JvmMethodSignature; +import kotlin.metadata.jvm.KotlinClassMetadata; /** Data class of a TypeElement and its Kotlin metadata. */ @AutoValue diff --git a/java/dagger/internal/codegen/kotlin/BUILD b/java/dagger/internal/codegen/kotlin/BUILD index 054ec89ef31..41b82ab5078 100644 --- a/java/dagger/internal/codegen/kotlin/BUILD +++ b/java/dagger/internal/codegen/kotlin/BUILD @@ -36,7 +36,7 @@ java_library( "//third_party/java/javapoet", "//third_party/java/jsr305_annotations", "//third_party/java/jsr330_inject", + "//third_party/kotlin/kotlin_metadata_jvm", "@maven//:org_jetbrains_kotlin_kotlin_stdlib", - "@maven//:org_jetbrains_kotlinx_kotlinx_metadata_jvm", ], ) diff --git a/java/dagger/internal/codegen/kotlin/KotlinMetadata.java b/java/dagger/internal/codegen/kotlin/KotlinMetadata.java index b27ae91eb7b..ef8f9a08e98 100644 --- a/java/dagger/internal/codegen/kotlin/KotlinMetadata.java +++ b/java/dagger/internal/codegen/kotlin/KotlinMetadata.java @@ -38,16 +38,16 @@ import java.util.function.Function; import javax.annotation.Nullable; import kotlin.Metadata; -import kotlinx.metadata.Flag; -import kotlinx.metadata.KmClass; -import kotlinx.metadata.KmConstructor; -import kotlinx.metadata.KmFunction; -import kotlinx.metadata.KmProperty; -import kotlinx.metadata.jvm.JvmExtensionsKt; -import kotlinx.metadata.jvm.JvmFieldSignature; -import kotlinx.metadata.jvm.JvmMetadataUtil; -import kotlinx.metadata.jvm.JvmMethodSignature; -import kotlinx.metadata.jvm.KotlinClassMetadata; +import kotlin.metadata.Flag; +import kotlin.metadata.KmClass; +import kotlin.metadata.KmConstructor; +import kotlin.metadata.KmFunction; +import kotlin.metadata.KmProperty; +import kotlin.metadata.jvm.JvmExtensionsKt; +import kotlin.metadata.jvm.JvmFieldSignature; +import kotlin.metadata.jvm.JvmMetadataUtil; +import kotlin.metadata.jvm.JvmMethodSignature; +import kotlin.metadata.jvm.KotlinClassMetadata; /** Data class of a TypeElement and its Kotlin metadata. */ @AutoValue diff --git a/java/dagger/spi/BUILD b/java/dagger/spi/BUILD index c155dd261d7..9624019a13a 100644 --- a/java/dagger/spi/BUILD +++ b/java/dagger/spi/BUILD @@ -80,7 +80,7 @@ gen_maven_artifact( # util/deploy-dagger.sh shaded_deps = [ "//third_party/java/auto:common", - "@maven//:org_jetbrains_kotlinx_kotlinx_metadata_jvm", + "//third_party/kotlin/kotlin_metadata_jvm", "//java/dagger/internal/codegen/xprocessing:xprocessing-jar", ], ) diff --git a/third_party/kotlin/kotlin_metadata_jvm/BUILD b/third_party/kotlin/kotlin_metadata_jvm/BUILD new file mode 100644 index 00000000000..6f19a2d3297 --- /dev/null +++ b/third_party/kotlin/kotlin_metadata_jvm/BUILD @@ -0,0 +1,22 @@ +# Copyright (C) 2024 The Dagger Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# BUILD rules for https://github.com/square/kotlinpoet + +package(default_visibility = ["//:src"]) + +alias( + name = "kotlin_metadata_jvm", + actual = "@maven//:org_jetbrains_kotlin_kotlin_metadata_jvm", +) diff --git a/tools/maven/maven.bzl b/tools/maven/maven.bzl index 29036550e48..3177344e59e 100644 --- a/tools/maven/maven.bzl +++ b/tools/maven/maven.bzl @@ -22,7 +22,7 @@ load(":pom_file.bzl", "pom_file") SHADED_MAVEN_DEPS = [ "com.google.auto:auto-common", - "org.jetbrains.kotlinx:kotlinx-metadata-jvm", + "org.jetbrains.kotlin:kotlin-metadata-jvm", ] def dagger_pom_file(name, targets, artifact_name, artifact_id, packaging = None, **kwargs):