File tree Expand file tree Collapse file tree 3 files changed +16
-9
lines changed
dagger-compiler/main/java/dagger/internal/codegen/xprocessing Expand file tree Collapse file tree 3 files changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,8 @@ INCAP_VERSION = "0.2"
5050
5151KOTLIN_VERSION = "2.2.20"
5252
53+ KOTLINPOET_VERSION = "1.11.0"
54+
5355KSP_VERSION = KOTLIN_VERSION + "-2.0.3"
5456
5557MAVEN_VERSION = "3.3.3"
@@ -141,8 +143,8 @@ maven.install(
141143 "com.google.guava:guava-beta-checker:1.0" ,
142144 "com.google.protobuf:protobuf-java:4.32.1" ,
143145 "com.squareup:javapoet:1.13.0" ,
144- "com.squareup:kotlinpoet:1.11.0" ,
145- "com.squareup:kotlinpoet-javapoet:1.11.0" ,
146+ "com.squareup:kotlinpoet:%s" % KOTLINPOET_VERSION ,
147+ "com.squareup:kotlinpoet-javapoet:%s" % KOTLINPOET_VERSION ,
146148 "io.github.java-diff-utils:java-diff-utils:4.11" ,
147149 "io.grpc:grpc-context:%s" % GRPC_VERSION ,
148150 "io.grpc:grpc-core:%s" % GRPC_VERSION ,
Original file line number Diff line number Diff line change 4141
4242/** Static factories to create {@link AnnotationSpec}s. */
4343public final class XAnnotationSpecs {
44+ public static XAnnotationSpec of (XClassName className ) {
45+ return builder (className ).build ();
46+ }
47+
4448 public static XAnnotationSpec of (XAnnotation annotation ) {
49+ return of (annotation , /* includeDefaultValues= */ false );
50+ }
51+
52+ public static XAnnotationSpec of (XAnnotation annotation , boolean includeDefaultValues ) {
4553 return toXPoet (
46- JavaPoetExtKt .toAnnotationSpec (annotation , /* includeDefaultValues= */ false ),
54+ JavaPoetExtKt .toAnnotationSpec (annotation , includeDefaultValues ),
4755 // TODO(b/411661393): Add support for annotation values. For now, the KotlinPoet
4856 // implementation only copies the class name and ignores the annotation values.
4957 com .squareup .kotlinpoet .AnnotationSpec
5058 .builder (toKotlinPoet (XAnnotations .asClassName (annotation )))
5159 .build ());
5260 }
5361
54- public static XAnnotationSpec of (XClassName className ) {
55- return builder (className ).build ();
56- }
57-
5862 /** Values for an {@link SuppressWarnings} annotation. */
5963 public enum Suppression {
6064 RAWTYPES ("rawtypes" ),
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ junit = "4.13"
1515jvmTarget = " 1.8"
1616kotlin = " 2.2.20"
1717kotlinTarget = " 1.9"
18+ kotlinPoet = " 1.11.0"
1819ksp = " 2.2.20-2.0.3"
1920publish = " 0.30.0"
2021shadow = " 8.3.5"
@@ -64,8 +65,8 @@ kotlin-compilerEmbeddable = { module = "org.jetbrains.kotlin:kotlin-compiler-emb
6465kotlin-gradlePlugin = { module = " org.jetbrains.kotlin:kotlin-gradle-plugin" , version.ref = " kotlin" }
6566kotlin-metadataJvm = { module = " org.jetbrains.kotlin:kotlin-metadata-jvm" , version.ref = " kotlin" }
6667kotlin-stdlib = { module = " org.jetbrains.kotlin:kotlin-stdlib" , version.ref = " kotlin" }
67- kotlinPoet = { module = " com.squareup:kotlinpoet" , version = " 1.11.0 " }
68- kotlinPoet-javaPoet = { module = " com.squareup:kotlinpoet-javapoet" , version = " 1.11.0 " }
68+ kotlinPoet = { module = " com.squareup:kotlinpoet" , version.ref = " kotlinPoet " }
69+ kotlinPoet-javaPoet = { module = " com.squareup:kotlinpoet-javapoet" , version.ref = " kotlinPoet " }
6970ksp = { module = " com.google.devtools.ksp:symbol-processing" , version.ref = " ksp" }
7071ksp-api = { module = " com.google.devtools.ksp:symbol-processing-api" , version.ref = " ksp" }
7172ksp-common = { module = " com.google.devtools.ksp:symbol-processing-common-deps" , version.ref = " ksp" }
You can’t perform that action at this time.
0 commit comments