Skip to content

Commit a5398f7

Browse files
bcorsoDagger Team
authored andcommitted
Shade Dagger's javapoet-kotlinpoet dependency.
This is a transitive dependency from the XProcessing jar which we already shade into Dagger. # Fixes #4624: Shade Dagger's javapoet-kotlinpoet dependency. RELNOTES=N/A PiperOrigin-RevId: 739559428
1 parent 3ddaaad commit a5398f7

File tree

10 files changed

+43
-7
lines changed

10 files changed

+43
-7
lines changed

dagger-android-processor/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ gen_maven_artifact(
4646
"com.google.dagger:dagger-spi",
4747
"com.google.guava:failureaccess",
4848
"com.squareup:kotlinpoet",
49-
"com.squareup:kotlinpoet-javapoet",
5049
"net.ltgt.gradle.incap:incap",
5150
"org.jetbrains.kotlin:kotlin-stdlib",
5251
],

dagger-compiler/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ gen_maven_artifact(
5959
"com.google.guava:guava",
6060
"com.squareup:javapoet",
6161
"com.squareup:kotlinpoet",
62-
"com.squareup:kotlinpoet-javapoet",
6362
"javax.inject:javax.inject",
6463
"net.ltgt.gradle.incap:incap",
6564
"org.checkerframework:checker-compat-qual",

dagger-compiler/main/java/dagger/internal/codegen/xprocessing/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ java_import(
5757
jars = ["xprocessing-internal.jar"],
5858
deps = [
5959
"//third_party/kotlin/kotlinpoet",
60+
"//third_party/kotlin/kotlinpoet/javapoet",
6061
"@maven//:com_google_devtools_ksp_symbol_processing_api",
61-
"@maven//:com_squareup_kotlinpoet_javapoet",
6262
],
6363
)
6464

dagger-spi/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ gen_maven_artifact(
8080
shaded_deps = [
8181
"//third_party/java/auto:common",
8282
"//third_party/kotlin/kotlin_metadata_jvm",
83+
"//third_party/kotlin/kotlinpoet/javapoet",
8384
"//dagger-compiler/main/java/dagger/internal/codegen/xprocessing:xprocessing-jar",
8485
],
8586
)

hilt-compiler/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ _ARTIFACT_TARGET_MAVEN_DEPS = [
9494
"com.google.guava:guava",
9595
"com.squareup:javapoet",
9696
"com.squareup:kotlinpoet",
97-
"com.squareup:kotlinpoet-javapoet",
9897
"javax.inject:javax.inject",
9998
"net.ltgt.gradle.incap:incap",
10099
"org.jetbrains.kotlin:kotlin-stdlib",
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright (C) 2025 The Dagger Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# BUILD rules for https://github.com/square/kotlinpoet/javapoet
16+
17+
package(default_visibility = ["//:src"])
18+
19+
alias(
20+
name = "javapoet",
21+
actual = "@maven//:com_squareup_kotlinpoet_javapoet",
22+
)

tools/maven/maven.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ load(":pom_file.bzl", "pom_file")
2222

2323
SHADED_MAVEN_DEPS = [
2424
"com.google.auto:auto-common",
25+
"com.squareup:kotlinpoet-javapoet",
2526
"org.jetbrains.kotlin:kotlin-metadata-jvm",
2627
]
2728

util/deploy-dagger.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@ readonly MVN_GOAL="$1"
66
readonly VERSION_NAME="$2"
77
shift 2
88
readonly EXTRA_MAVEN_ARGS=("$@")
9-
readonly _SHADED_RULES="com.google.auto.common,dagger.spi.internal.shaded.auto.common;androidx.room.compiler,dagger.spi.internal.shaded.androidx.room.compiler;kotlin.metadata,dagger.spi.internal.shaded.kotlin.metadata;androidx.room,dagger.spi.internal.shaded.androidx.room"
9+
10+
function shaded_rule() {
11+
echo "$1,dagger.spi.internal.shaded.$1"
12+
}
13+
readonly _SHADED_RULES="\
14+
$(shaded_rule com.google.auto.common);\
15+
$(shaded_rule androidx.room);\
16+
$(shaded_rule kotlin.metadata);\
17+
$(shaded_rule com.squareup.kotlinpoet.javapoet)"
1018

1119
# Builds and deploys the given artifacts to a configured maven goal.
1220
# @param {string} library the library to deploy.

util/deploy-hilt.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@ readonly MVN_GOAL="$1"
66
readonly VERSION_NAME="$2"
77
shift 2
88
readonly EXTRA_MAVEN_ARGS=("$@")
9-
readonly _SHADED_RULES="com.google.auto.common,dagger.spi.internal.shaded.auto.common;androidx.room.compiler,dagger.spi.internal.shaded.androidx.room.compiler;kotlin.metadata,dagger.spi.internal.shaded.kotlin.metadata;androidx.room,dagger.spi.internal.shaded.androidx.room"
9+
10+
function shaded_rule() {
11+
echo "$1,dagger.spi.internal.shaded.$1"
12+
}
13+
readonly _SHADED_RULES="\
14+
$(shaded_rule com.google.auto.common);\
15+
$(shaded_rule androidx.room);\
16+
$(shaded_rule kotlin.metadata);\
17+
$(shaded_rule com.squareup.kotlinpoet.javapoet)"
1018

1119
# Builds and deploys the given artifacts to a configured maven goal.
1220
# @param {string} library the library to deploy.

util/validate-jar-language-level.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ def is_shaded_class(filename):
9797
# Ignore the shaded deps because we don't really control these classes.
9898
shaded_prefixes = [
9999
'dagger/spi/internal/shaded/',
100-
'dagger/grpc/shaded/',
101100
]
102101
for shaded_prefix in shaded_prefixes:
103102
if filename.startswith(shaded_prefix):

0 commit comments

Comments
 (0)