diff --git a/java/dagger/android/BUILD b/java/dagger/android/BUILD index fc94fc8739c..686e6aef5a3 100644 --- a/java/dagger/android/BUILD +++ b/java/dagger/android/BUILD @@ -17,14 +17,14 @@ load( "//:build_defs.bzl", - "DOCLINT_HTML_AND_SYNTAX", - "DOCLINT_REFERENCES", - "JAVA_RELEASE_MIN", "POM_VERSION", ) load("//tools:dejetify.bzl", "dejetified_library") -load("//tools:maven.bzl", "pom_file") -load("@google_bazel_common//tools/javadoc:javadoc.bzl", "javadoc_library") +load( + "//tools:maven.bzl", + "gen_maven_artifact", + "pom_file", +) package(default_visibility = ["//:src"]) @@ -43,8 +43,6 @@ filegroup( android_library( name = "android", srcs = SRCS, - javacopts = JAVA_RELEASE_MIN + DOCLINT_HTML_AND_SYNTAX + DOCLINT_REFERENCES, - manifest = "AndroidManifest.xml", plugins = [ "//java/dagger/android/internal/proguard:plugin", ], @@ -60,17 +58,28 @@ android_library( ], ) -pom_file( - name = "pom", - artifact_id = "dagger-android", +gen_maven_artifact( + name = "artifact", + artifact_coordinates = "com.google.dagger:dagger-android:" + POM_VERSION, artifact_name = "Dagger Android", + artifact_target = ":android", + artifact_target_maven_deps = [ + "androidx.annotation:annotation", + "com.google.dagger:dagger", + "com.google.dagger:dagger-lint-aar", + ], + javadoc_android_api_level = 32, + javadoc_root_packages = [ + "dagger.android", + ], + javadoc_srcs = [":android-srcs"], + manifest = "AndroidManifest.xml", packaging = "aar", - targets = [":android"], ) dejetified_library( name = "dejetified-android", - input = ":android.aar", + input = ":artifact.aar", output = "android-legacy.aar", ) @@ -92,12 +101,3 @@ pom_file( packaging = "aar", targets = [":legacy-deps"], ) - -javadoc_library( - name = "android-javadoc", - srcs = [":android-srcs"], - android_api_level = 31, - exclude_packages = ["dagger.android.internal"], - root_packages = ["dagger.android"], - deps = [":android"], -) diff --git a/java/dagger/android/processor/BUILD b/java/dagger/android/processor/BUILD index d5bb083125b..eb3fdf6433e 100644 --- a/java/dagger/android/processor/BUILD +++ b/java/dagger/android/processor/BUILD @@ -15,7 +15,6 @@ # Description: # Public Dagger API for Android -load("@google_bazel_common//tools/javadoc:javadoc.bzl", "javadoc_library") load("@rules_java//java:defs.bzl", "java_library", "java_plugin") load( "//:build_defs.bzl", @@ -23,7 +22,7 @@ load( "DOCLINT_REFERENCES", "POM_VERSION", ) -load("//tools:maven.bzl", "pom_file") +load("//tools:maven.bzl", "gen_maven_artifact") package(default_visibility = ["//:src"]) @@ -52,11 +51,30 @@ java_library( ], ) -pom_file( - name = "pom", - artifact_id = "dagger-android-processor", +gen_maven_artifact( + name = "artifact", + artifact_coordinates = "com.google.dagger:dagger-android-processor:" + POM_VERSION, artifact_name = "Dagger Android Processor", - targets = [":processor"], + artifact_target = ":processor", + artifact_target_libs = [ + "//java/dagger/internal/codegen/xprocessing", + ], + artifact_target_maven_deps = [ + "com.google.dagger:dagger", + "com.google.devtools.ksp:symbol-processing-api", + "com.google.guava:guava", + "com.squareup:javapoet", + "com.google.code.findbugs:jsr305", + "com.google.dagger:dagger-spi", + "com.google.guava:failureaccess", + "com.squareup:kotlinpoet", + "net.ltgt.gradle.incap:incap", + "org.jetbrains.kotlin:kotlin-stdlib", + ], + javadoc_root_packages = [ + "dagger.android.processor", + ], + javadoc_srcs = [":srcs"], ) java_plugin( @@ -65,10 +83,3 @@ java_plugin( processor_class = "dagger.android.processor.AndroidProcessor", deps = [":processor"], ) - -javadoc_library( - name = "processor-javadoc", - srcs = [":srcs"], - root_packages = ["dagger.android.processor"], - deps = [":processor"], -) diff --git a/java/dagger/android/support/BUILD b/java/dagger/android/support/BUILD index 2fc9e2eb75f..2f4c407b87a 100644 --- a/java/dagger/android/support/BUILD +++ b/java/dagger/android/support/BUILD @@ -17,12 +17,14 @@ load( "//:build_defs.bzl", - "JAVA_RELEASE_MIN", "POM_VERSION", ) load("//tools:dejetify.bzl", "dejetified_library") -load("//tools:maven.bzl", "pom_file") -load("@google_bazel_common//tools/javadoc:javadoc.bzl", "javadoc_library") +load( + "//tools:maven.bzl", + "gen_maven_artifact", + "pom_file", +) package(default_visibility = ["//:src"]) @@ -34,8 +36,6 @@ filegroup( android_library( name = "support", srcs = glob(["*.java"]), - javacopts = JAVA_RELEASE_MIN, - manifest = "AndroidManifest.xml", tags = ["maven_coordinates=com.google.dagger:dagger-android-support:" + POM_VERSION], deps = [ "//:dagger_with_compiler", @@ -51,17 +51,34 @@ android_library( ], ) -pom_file( - name = "pom", - artifact_id = "dagger-android-support", +gen_maven_artifact( + name = "artifact", + artifact_coordinates = "com.google.dagger:dagger-android-support:" + POM_VERSION, artifact_name = "Dagger Android Support", + artifact_target = ":support", + artifact_target_maven_deps = [ + "androidx.activity:activity", + "androidx.annotation:annotation", + "androidx.appcompat:appcompat", + "androidx.fragment:fragment", + "androidx.lifecycle:lifecycle-common", + "androidx.lifecycle:lifecycle-viewmodel", + "androidx.lifecycle:lifecycle-viewmodel-savedstate", + "com.google.dagger:dagger", + "com.google.dagger:dagger-android", + ], + javadoc_android_api_level = 32, + javadoc_root_packages = [ + "dagger.android.support", + ], + javadoc_srcs = [":support-srcs"], + manifest = "AndroidManifest.xml", packaging = "aar", - targets = [":support"], ) dejetified_library( name = "dejetified-support", - input = ":support.aar", + input = ":artifact.aar", output = "support-legacy.aar", ) @@ -85,11 +102,3 @@ pom_file( packaging = "aar", targets = [":legacy-deps"], ) - -javadoc_library( - name = "support-javadoc", - srcs = [":support-srcs"], - android_api_level = 32, - root_packages = ["dagger.android.support"], - deps = [":support"], -) diff --git a/util/deploy-dagger.sh b/util/deploy-dagger.sh index 726cf63b7ab..f024325bb44 100755 --- a/util/deploy-dagger.sh +++ b/util/deploy-dagger.sh @@ -77,10 +77,10 @@ _deploy \ _deploy \ "" \ - java/dagger/android/android.aar \ + java/dagger/android/artifact.aar \ java/dagger/android/pom.xml \ - java/dagger/android/libandroid-src.jar \ - java/dagger/android/android-javadoc.jar \ + java/dagger/android/artifact-src.jar \ + java/dagger/android/artifact-javadoc.jar \ "" _deploy \ @@ -93,10 +93,10 @@ _deploy \ _deploy \ "" \ - java/dagger/android/support/support.aar \ + java/dagger/android/support/artifact.aar \ java/dagger/android/support/pom.xml \ - java/dagger/android/support/libsupport-src.jar \ - java/dagger/android/support/support-javadoc.jar \ + java/dagger/android/support/artifact-src.jar \ + java/dagger/android/support/artifact-javadoc.jar \ "" _deploy \ @@ -109,10 +109,10 @@ _deploy \ _deploy \ "com.google.auto.common,dagger.spi.internal.shaded.auto.common;androidx.room.compiler,dagger.spi.internal.shaded.androidx.room.compiler;kotlinx.metadata,dagger.spi.internal.shaded.kotlinx.metadata;androidx.room,dagger.spi.internal.shaded.androidx.room" \ - java/dagger/android/processor/libprocessor.jar \ + java/dagger/android/processor/artifact.jar \ java/dagger/android/processor/pom.xml \ - java/dagger/android/processor/libprocessor-src.jar \ - java/dagger/android/processor/processor-javadoc.jar \ + java/dagger/android/processor/artifact-src.jar \ + java/dagger/android/processor/artifact-javadoc.jar \ "" _deploy \