diff --git a/MODULE.bazel b/MODULE.bazel index 333ef17fd..30399df50 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -63,9 +63,9 @@ maven.install( "com.google.auto.value:auto-value-annotations:1.10.1", "com.google.auto.value:auto-value:1.10.1", "com.google.code.findbugs:jsr305:3.0.2", - "com.google.dagger:dagger-compiler:2.43.2", - "com.google.dagger:dagger-producers:2.43.2", - "com.google.dagger:dagger:2.43.2", + "com.google.dagger:dagger-compiler:2.51", + "com.google.dagger:dagger-producers:2.51", + "com.google.dagger:dagger:2.51", "com.google.guava:guava:27.1-jre", "com.google.protobuf:protobuf-java-util:3.6.0", "com.google.protobuf:protobuf-java:3.6.0", diff --git a/kotlin_rules_maven_install.json b/kotlin_rules_maven_install.json index 77aa35271..93367b3ad 100755 --- a/kotlin_rules_maven_install.json +++ b/kotlin_rules_maven_install.json @@ -1,10 +1,10 @@ { "__AUTOGENERATED_FILE_DO_NOT_MODIFY_THIS_FILE_MANUALLY": "THERE_IS_NO_DATA_ONLY_ZUUL", - "__INPUT_ARTIFACTS_HASH": 2083294935, - "__RESOLVED_ARTIFACTS_HASH": 36101904, + "__INPUT_ARTIFACTS_HASH": 382483370, + "__RESOLVED_ARTIFACTS_HASH": -882325810, "conflict_resolution": { "com.google.auto.service:auto-service-annotations:1.0.1": "com.google.auto.service:auto-service-annotations:1.1.1", - "com.google.guava:guava:27.1-jre": "com.google.guava:guava:32.1.1-jre" + "com.google.guava:guava:27.1-jre": "com.google.guava:guava:33.0.0-jre" }, "artifacts": { "com.google.auto.service:auto-service": { @@ -58,45 +58,45 @@ }, "com.google.dagger:dagger": { "shasums": { - "jar": "c89681f7cbbf8c527bf4ac2748515d617fdb54a1d425c08d914fdc28192b5fe4", - "sources": "f4f7a04037779a2186aba088b1dab8bc465a171f03b2934ecc046de740d4c0c3" + "jar": "a68b07ce740353462b04c9ad5944d9c22831025a4c8fbf282e3708a5684b68f7", + "sources": "29df2bfb27add94601b4f9aabe8c7d66e70634020f5c01666e33d86fe2ab3e83" }, - "version": "2.43.2" + "version": "2.51" }, "com.google.dagger:dagger-compiler": { "shasums": { - "jar": "298c020ee6ed2f4cc651ebbfdb7f8de329b07c44b618d65be117846a850e2a03", - "sources": "0928ecb0157fc2a9ed67d8747d2f518032dd408a2b4d72cf1720a453b378d4f4" + "jar": "bd1eb4fbba2014fca9e2c3a9bab0203e0a69aea131d1623352726dbcb5afd6ef", + "sources": "2540bb3e79dbe5d9c9a0ee3d93f96ea595ab537494e0b5044e25e20d8e8f43a0" }, - "version": "2.43.2" + "version": "2.51" }, "com.google.dagger:dagger-producers": { "shasums": { - "jar": "e7f5d9ffc85d48a49c8e22e02833d418f7ccad5d7512f529964db5127ab915ff", - "sources": "8bcf611b541b4f542c3a69ad89987fd4448aa83a79f336820a6616fc1013dcf1" + "jar": "1ce4fcd9f77dda4f76c707b5e46600ad089d840079e7bf1f18d952b206d6a4ef", + "sources": "441ec1d7d06c580d96660e5df0a39fff7d73d2e1f799efadf3f0069a3b509034" }, - "version": "2.43.2" + "version": "2.51" }, "com.google.dagger:dagger-spi": { "shasums": { - "jar": "3bae8d9dadeaaa5927da6f094389a560c12c05fec3d2711d2fa79292c7a7d7ad", - "sources": "9db725e2cb99139c5a4b982010dad52158cd03aba8aa2749188fa6f515ad2d59" + "jar": "6f55962a99f06f7d13afb3fd7b7164a830c7c12a1c5a41e5f9d5b01dd934a072", + "sources": "ca467ff8cdae8b4f316a0985ec2e00f9d9f8c7a66c31b27f8ae4af85c5ef9a10" }, - "version": "2.43.2" + "version": "2.51" }, "com.google.devtools.ksp:symbol-processing-api": { "shasums": { - "jar": "adc29417be5ca9ff42118105fea4e36d9ef44987abfc41432309371a60198941", - "sources": "008a5e5eee2616937e495856318105a72dda4e6c3642569f162f047bde49a9d0" + "jar": "d0339396f40dc9eb3b3f7bc86257f93869ee23448fa31ec4a1de900c6b7ae6d7", + "sources": "a7cf0b4ea8a85dff6dd9c068f7528f8b076556beccdbd882c86b6abb7239211c" }, - "version": "1.7.0-1.0.6" + "version": "1.9.20-1.0.14" }, "com.google.errorprone:error_prone_annotations": { "shasums": { - "jar": "9e6814cb71816988a4fd1b07a993a8f21bb7058d522c162b1de849e19bea54ae", - "sources": "a2c0783981c8ad48faaa6ea8de6f1926d8e87c125f5df5ce531a9810b943e032" + "jar": "ec6f39f068b6ff9ac323c68e28b9299f8c0a80ca512dccb1d4a70f40ac3ec054", + "sources": "5b4504609bb93d3c24b87cd839cf0bb7d878135d0a917a05081d0dc9b2a9973f" }, - "version": "2.18.0" + "version": "2.23.0" }, "com.google.errorprone:javac-shaded": { "shasums": { @@ -114,17 +114,17 @@ }, "com.google.guava:failureaccess": { "shasums": { - "jar": "a171ee4c734dd2da837e4b16be9df4661afab72a41adaf31eb84dfdaf936ca26", - "sources": "092346eebbb1657b51aa7485a246bf602bb464cc0b0e2e1c7e7201fadce1e98f" + "jar": "8a8f81cf9b359e3f6dfa691a1e776985c061ef2f223c9b2c80753e1b458e8064", + "sources": "dd3bfa5e2ec5bc5397efb2c3cef044c192313ff77089573667ff97a60c6978e0" }, - "version": "1.0.1" + "version": "1.0.2" }, "com.google.guava:guava": { "shasums": { - "jar": "91fbba37f1c8b251cf9ea9e7d3a369eb79eb1e6a5df1d4bbf483dd0380740281", - "sources": "5e7b6cebd2e9087a536c1054bf52a2e6a49c284772421f146640cfadc54ba573" + "jar": "f4d85c3e4d411694337cb873abea09b242b664bb013320be6105327c45991537", + "sources": "0c17d911785e8a606d091aa6740d6d520f307749c2bddf6e35066d52fe0036e5" }, - "version": "32.1.1-jre" + "version": "33.0.0-jre" }, "com.google.guava:listenablefuture": { "shasums": { @@ -331,10 +331,10 @@ }, "org.checkerframework:checker-qual": { "shasums": { - "jar": "e316255bbfcd9fe50d165314b85abb2b33cb2a66a93c491db648e498a82c2de1", - "sources": "443fa6151982bb4c6ce62e2938f53660085b13a7dceb517202777b87d0dea2c7" + "jar": "2f9f245bf68e4259d610894f2406dc1f6363dc639302bd566e8272e4f4541172", + "sources": "8308220bbdd4e12b49fa06a91de685faf9cc1a376464478c80845be3e87b7d4f" }, - "version": "3.33.0" + "version": "3.41.0" }, "org.codehaus.plexus:plexus-classworlds": { "shasums": { @@ -387,31 +387,31 @@ }, "org.jetbrains.kotlin:kotlin-stdlib": { "shasums": { - "jar": "03a5c3965cc37051128e64e46748e394b6bd4c97fa81c6de6fc72bfd44e3421b", - "sources": "e60342da94ab52368157917916775b7f2f03bbd728aad3c9e86c3f02a93dbeec" + "jar": "28a35bcdff46d864f80f346a617e486284b208d17378c41900dfb1de95a90e6c", + "sources": "e159eaf9f42fe4792ead7572ed44752753a9f4b006f5a10f5eefd04b13b6a363" }, - "version": "1.8.22" + "version": "1.9.20" }, "org.jetbrains.kotlin:kotlin-stdlib-common": { "shasums": { - "jar": "d0c2365e2437ef70f34586d50f055743f79716bcfe65e4bc7239cdd2669ef7c5", - "sources": "598996a205da366f31854b818b60da3afacb1302902005988c8826eeb2916532" + "jar": "32010683330a6f31b8d309f10433acaa109b61f2df3d252dae7dade9730074c2", + "sources": "1b6fb61c316787715aa64dd4adc8ed3cd42e0e430525142155f871de982e44b0" }, - "version": "1.8.22" + "version": "1.4.30" }, "org.jetbrains.kotlin:kotlin-stdlib-jdk7": { "shasums": { - "jar": "055f5cb24287fa106100995a7b47ab92126b81e832e875f5fa2cf0bd55693d0b", + "jar": "b7979a7aac94055f0d9f1fd3b47ce5ffe1cb6032a842ba9fbe7186f085289178", "sources": "ea10d3e5e6e695d8a5283cbf116321acae6ba42d0bdd3eda50f7c34a26fa25cb" }, - "version": "1.8.22" + "version": "1.9.0" }, "org.jetbrains.kotlin:kotlin-stdlib-jdk8": { "shasums": { - "jar": "4198b0eaf090a4f25b6f7e5a59581f4314ba8c9f6cd1d13ee9d348e65ed8f707", + "jar": "a59fa24fdf1ffb594baecdbf0fd10010f977cea10236d487fe3464977a7377fa", "sources": "40e9a80f6b953d12389623760d438e69914098d0c4d7053f70f90533ec041259" }, - "version": "1.8.22" + "version": "1.9.0" }, "org.jetbrains.kotlin:kotlin-stdlib-js": { "shasums": { @@ -427,13 +427,6 @@ }, "version": "0.15.2" }, - "org.jetbrains.kotlinx:kotlinx-metadata-jvm": { - "shasums": { - "jar": "ca063a96639b08b9eaa0de4d65e899480740a6efbe28ab9a8681a2ced03055a4", - "sources": "5efce3734e572cef4fc9c7005ced4f4c10ec2fea9daa232ec3cb63cd203bc786" - }, - "version": "0.5.0" - }, "org.jetbrains.kotlinx:kotlinx-serialization-runtime": { "shasums": { "jar": "b8431c786c81cb84713c038bb674c851aba533c89ba9f04f22fd78f2baacd6c4", @@ -562,19 +555,17 @@ "com.google.dagger:dagger-compiler": [ "com.google.code.findbugs:jsr305", "com.google.dagger:dagger", - "com.google.dagger:dagger-producers", "com.google.dagger:dagger-spi", "com.google.devtools.ksp:symbol-processing-api", "com.google.googlejavaformat:google-java-format", "com.google.guava:failureaccess", "com.google.guava:guava", "com.squareup:javapoet", + "com.squareup:kotlinpoet", "javax.inject:javax.inject", "net.ltgt.gradle.incap:incap", "org.checkerframework:checker-compat-qual", - "org.jetbrains.kotlin:kotlin-stdlib", - "org.jetbrains.kotlin:kotlin-stdlib-jdk8", - "org.jetbrains.kotlinx:kotlinx-metadata-jvm" + "org.jetbrains.kotlin:kotlin-stdlib" ], "com.google.dagger:dagger-producers": [ "com.google.dagger:dagger", @@ -586,17 +577,14 @@ "com.google.dagger:dagger-spi": [ "com.google.code.findbugs:jsr305", "com.google.dagger:dagger", - "com.google.dagger:dagger-producers", "com.google.devtools.ksp:symbol-processing-api", "com.google.guava:failureaccess", "com.google.guava:guava", "com.squareup:javapoet", - "javax.inject:javax.inject", - "org.jetbrains.kotlin:kotlin-stdlib", - "org.jetbrains.kotlin:kotlin-stdlib-jdk8" + "javax.inject:javax.inject" ], "com.google.devtools.ksp:symbol-processing-api": [ - "org.jetbrains.kotlin:kotlin-stdlib" + "org.jetbrains.kotlin:kotlin-stdlib-jdk8" ], "com.google.googlejavaformat:google-java-format": [ "com.google.errorprone:javac-shaded", @@ -694,7 +682,6 @@ "org.jetbrains.kotlin:kotlin-stdlib" ], "org.jetbrains.kotlin:kotlin-stdlib": [ - "org.jetbrains.kotlin:kotlin-stdlib-common", "org.jetbrains:annotations" ], "org.jetbrains.kotlin:kotlin-stdlib-jdk7": [ @@ -711,9 +698,6 @@ "org.jetbrains.kotlin:kotlin-stdlib-common", "org.jetbrains.kotlin:kotlin-stdlib-js" ], - "org.jetbrains.kotlinx:kotlinx-metadata-jvm": [ - "org.jetbrains.kotlin:kotlin-stdlib" - ], "org.jetbrains.kotlinx:kotlinx-serialization-runtime": [ "org.jetbrains.kotlin:kotlin-stdlib", "org.jetbrains.kotlin:kotlin-stdlib-common" @@ -890,9 +874,11 @@ "dagger.internal.codegen.javapoet", "dagger.internal.codegen.kotlin", "dagger.internal.codegen.langmodel", + "dagger.internal.codegen.model", "dagger.internal.codegen.processingstep", "dagger.internal.codegen.validation", - "dagger.internal.codegen.writing" + "dagger.internal.codegen.writing", + "dagger.internal.codegen.xprocessing" ], "com.google.dagger:dagger-producers": [ "dagger.producers", @@ -902,18 +888,48 @@ ], "com.google.dagger:dagger-spi": [ "dagger.internal.codegen.extension", - "dagger.internal.codegen.xprocessing", "dagger.model", "dagger.spi", - "dagger.spi.model", - "dagger.spi.shaded.androidx.room.compiler.processing", - "dagger.spi.shaded.androidx.room.compiler.processing.compat", - "dagger.spi.shaded.androidx.room.compiler.processing.javac", - "dagger.spi.shaded.androidx.room.compiler.processing.javac.kotlin", - "dagger.spi.shaded.androidx.room.compiler.processing.ksp", - "dagger.spi.shaded.androidx.room.compiler.processing.ksp.synthetic", - "dagger.spi.shaded.androidx.room.compiler.processing.util", - "dagger.spi.shaded.auto.common" + "dagger.spi.internal.shaded.androidx.room.compiler.codegen", + "dagger.spi.internal.shaded.androidx.room.compiler.codegen.java", + "dagger.spi.internal.shaded.androidx.room.compiler.codegen.kotlin", + "dagger.spi.internal.shaded.androidx.room.compiler.processing", + "dagger.spi.internal.shaded.androidx.room.compiler.processing.compat", + "dagger.spi.internal.shaded.androidx.room.compiler.processing.javac", + "dagger.spi.internal.shaded.androidx.room.compiler.processing.javac.kotlin", + "dagger.spi.internal.shaded.androidx.room.compiler.processing.ksp", + "dagger.spi.internal.shaded.androidx.room.compiler.processing.ksp.synthetic", + "dagger.spi.internal.shaded.androidx.room.compiler.processing.util", + "dagger.spi.internal.shaded.androidx.room.jarjarred.kotlinx.metadata", + "dagger.spi.internal.shaded.androidx.room.jarjarred.kotlinx.metadata.internal", + "dagger.spi.internal.shaded.androidx.room.jarjarred.kotlinx.metadata.internal.common", + "dagger.spi.internal.shaded.androidx.room.jarjarred.kotlinx.metadata.internal.extensions", + "dagger.spi.internal.shaded.androidx.room.jarjarred.kotlinx.metadata.internal.metadata", + "dagger.spi.internal.shaded.androidx.room.jarjarred.kotlinx.metadata.internal.metadata.builtins", + "dagger.spi.internal.shaded.androidx.room.jarjarred.kotlinx.metadata.internal.metadata.deserialization", + "dagger.spi.internal.shaded.androidx.room.jarjarred.kotlinx.metadata.internal.metadata.jvm", + "dagger.spi.internal.shaded.androidx.room.jarjarred.kotlinx.metadata.internal.metadata.jvm.deserialization", + "dagger.spi.internal.shaded.androidx.room.jarjarred.kotlinx.metadata.internal.metadata.jvm.serialization", + "dagger.spi.internal.shaded.androidx.room.jarjarred.kotlinx.metadata.internal.metadata.serialization", + "dagger.spi.internal.shaded.androidx.room.jarjarred.kotlinx.metadata.internal.protobuf", + "dagger.spi.internal.shaded.androidx.room.jarjarred.kotlinx.metadata.jvm", + "dagger.spi.internal.shaded.androidx.room.jarjarred.kotlinx.metadata.jvm.internal", + "dagger.spi.internal.shaded.auto.common", + "dagger.spi.internal.shaded.kotlinx.metadata", + "dagger.spi.internal.shaded.kotlinx.metadata.internal", + "dagger.spi.internal.shaded.kotlinx.metadata.internal.common", + "dagger.spi.internal.shaded.kotlinx.metadata.internal.extensions", + "dagger.spi.internal.shaded.kotlinx.metadata.internal.metadata", + "dagger.spi.internal.shaded.kotlinx.metadata.internal.metadata.builtins", + "dagger.spi.internal.shaded.kotlinx.metadata.internal.metadata.deserialization", + "dagger.spi.internal.shaded.kotlinx.metadata.internal.metadata.jvm", + "dagger.spi.internal.shaded.kotlinx.metadata.internal.metadata.jvm.deserialization", + "dagger.spi.internal.shaded.kotlinx.metadata.internal.metadata.jvm.serialization", + "dagger.spi.internal.shaded.kotlinx.metadata.internal.metadata.serialization", + "dagger.spi.internal.shaded.kotlinx.metadata.internal.protobuf", + "dagger.spi.internal.shaded.kotlinx.metadata.jvm", + "dagger.spi.internal.shaded.kotlinx.metadata.jvm.internal", + "dagger.spi.model" ], "com.google.devtools.ksp:symbol-processing-api": [ "com.google.devtools.ksp", @@ -1439,22 +1455,6 @@ "kotlin.time", "kotlin.time.jdk8" ], - "org.jetbrains.kotlinx:kotlinx-metadata-jvm": [ - "kotlinx.metadata", - "kotlinx.metadata.impl", - "kotlinx.metadata.impl.extensions", - "kotlinx.metadata.internal.common", - "kotlinx.metadata.internal.metadata", - "kotlinx.metadata.internal.metadata.builtins", - "kotlinx.metadata.internal.metadata.deserialization", - "kotlinx.metadata.internal.metadata.jvm", - "kotlinx.metadata.internal.metadata.jvm.deserialization", - "kotlinx.metadata.internal.metadata.jvm.serialization", - "kotlinx.metadata.internal.metadata.serialization", - "kotlinx.metadata.internal.protobuf", - "kotlinx.metadata.jvm", - "kotlinx.metadata.jvm.impl" - ], "org.jetbrains.kotlinx:kotlinx-serialization-runtime": [ "kotlinx.serialization", "kotlinx.serialization.builtins", @@ -1687,8 +1687,6 @@ "org.jetbrains.kotlin:kotlin-stdlib:jar:sources", "org.jetbrains.kotlinx:atomicfu-js", "org.jetbrains.kotlinx:atomicfu-js:jar:sources", - "org.jetbrains.kotlinx:kotlinx-metadata-jvm", - "org.jetbrains.kotlinx:kotlinx-metadata-jvm:jar:sources", "org.jetbrains.kotlinx:kotlinx-serialization-runtime", "org.jetbrains.kotlinx:kotlinx-serialization-runtime:jar:sources", "org.jetbrains:annotations", @@ -1842,8 +1840,6 @@ "org.jetbrains.kotlin:kotlin-stdlib:jar:sources", "org.jetbrains.kotlinx:atomicfu-js", "org.jetbrains.kotlinx:atomicfu-js:jar:sources", - "org.jetbrains.kotlinx:kotlinx-metadata-jvm", - "org.jetbrains.kotlinx:kotlinx-metadata-jvm:jar:sources", "org.jetbrains.kotlinx:kotlinx-serialization-runtime", "org.jetbrains.kotlinx:kotlinx-serialization-runtime:jar:sources", "org.jetbrains:annotations", @@ -1997,8 +1993,6 @@ "org.jetbrains.kotlin:kotlin-stdlib:jar:sources", "org.jetbrains.kotlinx:atomicfu-js", "org.jetbrains.kotlinx:atomicfu-js:jar:sources", - "org.jetbrains.kotlinx:kotlinx-metadata-jvm", - "org.jetbrains.kotlinx:kotlinx-metadata-jvm:jar:sources", "org.jetbrains.kotlinx:kotlinx-serialization-runtime", "org.jetbrains.kotlinx:kotlinx-serialization-runtime:jar:sources", "org.jetbrains:annotations", diff --git a/src/main/starlark/core/repositories/setup.bzl b/src/main/starlark/core/repositories/setup.bzl index b4db8b665..f00e06c45 100644 --- a/src/main/starlark/core/repositories/setup.bzl +++ b/src/main/starlark/core/repositories/setup.bzl @@ -43,9 +43,9 @@ def kt_configure(): "com.google.auto.service:auto-service-annotations:1.0.1", "com.google.auto.value:auto-value:1.10.1", "com.google.auto.value:auto-value-annotations:1.10.1", - "com.google.dagger:dagger:2.43.2", - "com.google.dagger:dagger-compiler:2.43.2", - "com.google.dagger:dagger-producers:2.43.2", + "com.google.dagger:dagger:2.51", + "com.google.dagger:dagger-compiler:2.51", + "com.google.dagger:dagger-producers:2.51", "javax.annotation:javax.annotation-api:1.3.2", "javax.inject:javax.inject:1", "org.pantsbuild:jarjar:1.7.2", diff --git a/src/test/data/jvm/ksp/BUILD b/src/test/data/jvm/ksp/BUILD index b9052e7b7..ac6ea8574 100644 --- a/src/test/data/jvm/ksp/BUILD +++ b/src/test/data/jvm/ksp/BUILD @@ -16,12 +16,18 @@ load("//kotlin:jvm.bzl", "kt_jvm_library") # limitations under the License. package(default_visibility = ["//visibility:private"]) +kt_ksp_plugin( + name = "dagger", + generates_java = True, + processor_class = "dagger.internal.codegen.KspComponentProcessor", + target_embedded_compiler = True, + deps = ["@kotlin_rules_maven//:com_google_dagger_dagger_compiler"], +) + kt_ksp_plugin( name = "autoservice", processor_class = "dev.zacsweers.autoservice.ksp.AutoServiceSymbolProcessor$Provider", - deps = [ - "@kotlin_rules_maven//:dev_zacsweers_autoservice_auto_service_ksp", - ], + deps = ["@kotlin_rules_maven//:dev_zacsweers_autoservice_auto_service_ksp"], ) kt_ksp_plugin( @@ -47,9 +53,18 @@ kt_jvm_library( kt_jvm_library( name = "coffee_lib", - srcs = ["CoffeeAppService.java"], - plugins = [":autoservice"], + srcs = [ + "CoffeeApp.kt", + "CoffeeAppService.java", + "CoffeeMaker.kt", + "DripCoffeeModule.kt", + ], + plugins = [ + ":autoservice", + ":dagger", + ], deps = [ + "@kotlin_rules_maven//:com_google_dagger_dagger", "@kotlin_rules_maven//:dev_zacsweers_autoservice_auto_service_ksp", ], ) diff --git a/src/test/data/jvm/ksp/CoffeeApp.kt b/src/test/data/jvm/ksp/CoffeeApp.kt index 876486649..a5b19b893 100644 --- a/src/test/data/jvm/ksp/CoffeeApp.kt +++ b/src/test/data/jvm/ksp/CoffeeApp.kt @@ -13,17 +13,20 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package coffee +package src.test.data.jvm.ksp -import com.squareup.moshi.Moshi +import dagger.Component +import javax.inject.Singleton class CoffeeApp { - companion object { + @Singleton + @Component(modules = [DripCoffeeModule::class]) + interface CoffeeShop { + fun maker(): CoffeeMaker + } - private val adapter = CoffeeAppModelJsonAdapter(Moshi.Builder().build()) - private val d = AutoValue_CoffeeAppJavaModel.Builder() - .setCoffeeAppModel(CoffeeAppModel("1")) - .build() + companion object { + private val coffeeShop = DaggerCoffeeApp_CoffeeShop.builder().build() } } diff --git a/src/test/data/jvm/ksp/CoffeeMaker.kt b/src/test/data/jvm/ksp/CoffeeMaker.kt new file mode 100644 index 000000000..c404a236b --- /dev/null +++ b/src/test/data/jvm/ksp/CoffeeMaker.kt @@ -0,0 +1,30 @@ +/* + * Copyright 2018 The Bazel Authors. All rights reserved. + * + * 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. + */ +package src.test.data.jvm.ksp + +import dagger.Lazy +import javax.inject.Inject + +class CoffeeMaker @Inject internal constructor( + private val heater: Lazy, +) { + + fun brew() { + heater.get().on() + println(" [_]P coffee! [_]P ") + heater.get().off() + } +} diff --git a/src/test/data/jvm/ksp/DripCoffeeModule.kt b/src/test/data/jvm/ksp/DripCoffeeModule.kt new file mode 100644 index 000000000..40937bc36 --- /dev/null +++ b/src/test/data/jvm/ksp/DripCoffeeModule.kt @@ -0,0 +1,48 @@ +/* + * Copyright 2018 The Bazel Authors. All rights reserved. + * + * 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. + */ +package src.test.data.jvm.ksp + +import dagger.Module +import dagger.Provides +import javax.inject.Singleton + +@Module +internal class DripCoffeeModule { + @Provides + @Singleton + fun provideHeater(): Heater { + return ElectricHeater() + } +} + +internal interface Heater { + val isHot: Boolean + fun on() + fun off() +} + +internal class ElectricHeater : Heater { + override var isHot: Boolean = false + + override fun on() { + println("~ ~ ~ heating ~ ~ ~") + this.isHot = true + } + + override fun off() { + this.isHot = false + } +} diff --git a/src/test/kotlin/io/bazel/kotlin/KotlinJvmKspAssertionTest.kt b/src/test/kotlin/io/bazel/kotlin/KotlinJvmKspAssertionTest.kt index 91dc80f93..9e03f516c 100644 --- a/src/test/kotlin/io/bazel/kotlin/KotlinJvmKspAssertionTest.kt +++ b/src/test/kotlin/io/bazel/kotlin/KotlinJvmKspAssertionTest.kt @@ -11,14 +11,30 @@ class KotlinJvmKspAssertionTest: KotlinAssertionTestCase("src/test/data/jvm/ksp" fun testKSPCopiesAllFilesFromMetaINF() { jarTestCase("coffee_lib.jar", description = "Generated jar with ksp plugin contains meta-inf contents") { assertContainsExactEntries( + "META-INF/", + "META-INF/MANIFEST.MF", + "META-INF/services/", + "META-INF/services/java.lang.Object", + "META-INF/src_test_data_jvm_ksp-coffee_lib.kotlin_module", "src/", "src/test/", "src/test/data/", "src/test/data/jvm/", "src/test/data/jvm/ksp/", + "src/test/data/jvm/ksp/CoffeeApp.class", "src/test/data/jvm/ksp/CoffeeAppService.class", - "META-INF/", - "META-INF/MANIFEST.MF" + "src/test/data/jvm/ksp/CoffeeApp\$CoffeeShop.class", + "src/test/data/jvm/ksp/CoffeeApp\$Companion.class", + "src/test/data/jvm/ksp/CoffeeMaker.class", + "src/test/data/jvm/ksp/CoffeeMaker_Factory.class", + "src/test/data/jvm/ksp/DaggerCoffeeApp_CoffeeShop\$1.class", + "src/test/data/jvm/ksp/DaggerCoffeeApp_CoffeeShop.class", + "src/test/data/jvm/ksp/DaggerCoffeeApp_CoffeeShop\$Builder.class", + "src/test/data/jvm/ksp/DaggerCoffeeApp_CoffeeShop\$CoffeeShopImpl.class", + "src/test/data/jvm/ksp/DripCoffeeModule.class", + "src/test/data/jvm/ksp/DripCoffeeModule_ProvideHeaterFactory.class", + "src/test/data/jvm/ksp/ElectricHeater.class", + "src/test/data/jvm/ksp/Heater.class", ) } }