diff --git a/gradle-projects/dagger-compiler/build.gradle.kts b/gradle-projects/dagger-compiler/build.gradle.kts new file mode 100644 index 00000000000..6cb0ba0ce94 --- /dev/null +++ b/gradle-projects/dagger-compiler/build.gradle.kts @@ -0,0 +1,62 @@ +import dagger.gradle.build.daggerSources + +plugins { + alias(libs.plugins.dagger.kotlinJvm) + alias(libs.plugins.dagger.publish) +} + +daggerSources { + main.setPackages( + listOf( + "dagger/internal/codegen", + "dagger/internal/codegen/base", + "dagger/internal/codegen/binding", + "dagger/internal/codegen/bindinggraphvalidation", + "dagger/internal/codegen/compileroption", + "dagger/internal/codegen/componentgenerator", + "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/xprocessing", + ) + ) +} + +dependencies { + implementation(project(":dagger")) + implementation(project(":dagger-spi")) + + implementation(libs.auto.common) + implementation(libs.auto.value.annotations) + annotationProcessor(libs.auto.value.compiler) + implementation(libs.auto.service.annotations) + annotationProcessor(libs.auto.service.compiler) + implementation(libs.checkerFramework) + implementation(libs.findBugs) + implementation(libs.javaFormatter) + implementation(libs.javaPoet) + implementation(libs.javax.inject) + implementation(libs.gradleIncap.annotations) + annotationProcessor(libs.gradleIncap.compiler) + implementation(libs.guava.failureAccess) + implementation(libs.guava.jre) + implementation(libs.kotlin.stdlib) + implementation(libs.kotlin.metadataJvm) + implementation(libs.kotlinPoet) + implementation(libs.ksp.api) + + annotationProcessor( + files(project.rootProject.layout.projectDirectory + .dir("java/dagger/internal/codegen/bootstrap") + .file("bootstrap_compiler_deploy.jar")) + ) + implementation( + files(project.rootProject.layout.projectDirectory + .dir("java/dagger/internal/codegen/xprocessing") + .file("xprocessing.jar")) + ) +} \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 1ba180db4e8..8f687aa9643 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,8 @@ [versions] autoValue = "1.9" +autoService = "1.0" guava = "33.0.0-jre" +gradleIncap = "0.2" jdk = "18" junit = "4.13" jvmTarget = "1.8" @@ -14,16 +16,24 @@ truth = "1.4.0" auto-common = { module = "com.google.auto:auto-common", version = "1.2.1" } auto-value-annotations = { module = "com.google.auto.value:auto-value-annotations", version.ref = "autoValue" } auto-value-compiler = { module = "com.google.auto.value:auto-value", version.ref = "autoValue" } +auto-service-annotations = { module = "com.google.auto.service:auto-service-annotations", version.ref = "autoService" } +auto-service-compiler = { module = "com.google.auto.service:auto-service", version.ref = "autoService" } +checkerFramework = { module = "org.checkerframework:checker-compat-qual", version = "2.5.3" } findBugs = { module = "com.google.code.findbugs:jsr305", version = "3.0.1" } +javaFormatter = { module = "com.google.googlejavaformat:google-java-format", version = "1.5" } guava-jre = { module = "com.google.guava:guava", version.ref = "guava" } guava-failureAccess = { module = "com.google.guava:failureaccess", version = "1.0.1" } +gradleIncap-annotations = { module = "net.ltgt.gradle.incap:incap", version.ref = "gradleIncap" } +gradleIncap-compiler = { module = "net.ltgt.gradle.incap:incap-processor", version.ref = "gradleIncap" } jakarta-inject = { module = "jakarta.inject:jakarta.inject-api", version = "2.0.1" } javaPoet = { module = "com.squareup:javapoet", version = "1.13.0" } javax-inject = { module = "javax.inject:javax.inject", version = "1" } jspecify = { module = "org.jspecify:jspecify", version = "1.0.0" } junit = { module = "junit:junit", version.ref = "junit" } kotlin-gradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } +kotlin-metadataJvm = { module = "org.jetbrains.kotlin:kotlin-metadata-jvm", version.ref = "kotlin" } kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" } +kotlinPoet = { module = "com.squareup:kotlinpoet", version = "1.11.0" } ksp-api = { module = "com.google.devtools.ksp:symbol-processing-api", version.ref = "ksp" } publishPlugin = { module = "com.vanniktech:gradle-maven-publish-plugin", version.ref = "publish" } truth = { module = "com.google.truth:truth", version.ref = "truth" } diff --git a/settings.gradle.kts b/settings.gradle.kts index d185ed1843d..6fd27ddb033 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -22,3 +22,4 @@ fun includeProject(name: String, path: String) { includeProject(":dagger", "gradle-projects/dagger-runtime") includeProject(":dagger-spi", "gradle-projects/dagger-spi") +includeProject(":dagger-compiler", "gradle-projects/dagger-compiler")