diff --git a/docs/api.md b/docs/api.md index 2c6e2e459..daf6d9a4c 100644 --- a/docs/api.md +++ b/docs/api.md @@ -34,7 +34,7 @@ Generate a javadoc from all the `deps` | doc_deps | `javadoc` targets referenced by the current target.

Use this to automatically add appropriate `-linkoffline` javadoc options to resolve references to packages documented by the given javadoc targets that have `url` specified. | List of labels | optional | `[]` | | doc_url | The URL at which this documentation will be hosted.

This information is only used by javadoc targets depending on this target. | String | optional | `""` | | excluded_workspaces | A list of bazel workspace names to exclude from the generated jar | List of strings | optional | `["com_google_protobuf", "protobuf"]` | -| javadocopts | javadoc options. Note sources and classpath are derived from the deps. Any additional options can be passed here. | List of strings | optional | `[]` | +| javadocopts | javadoc options. Note sources and classpath are derived from the deps. Any additional options can be passed here. If nothing is passed, a default list of options is used: ["-notimestamp", "-use", "-quiet", "-Xdoclint:-missing", "-encoding", "UTF8"] | List of strings | optional | `["-notimestamp", "-use", "-quiet", "-Xdoclint:-missing", "-encoding", "UTF8"]` | diff --git a/private/rules/java_export.bzl b/private/rules/java_export.bzl index 4bc33f839..f4a096553 100644 --- a/private/rules/java_export.bzl +++ b/private/rules/java_export.bzl @@ -199,7 +199,6 @@ def maven_export( manifest_entries = manifest_entries if manifest_entries else {} deploy_env = deploy_env if deploy_env else [] excluded_workspaces = excluded_workspaces if excluded_workspaces else {} - javadocopts = javadocopts if javadocopts else [] doc_url = doc_url if doc_url else "" doc_deps = doc_deps if doc_deps else [] tags = tags if tags else [] diff --git a/private/rules/javadoc.bzl b/private/rules/javadoc.bzl index c683dc4fe..ca85f1d4c 100644 --- a/private/rules/javadoc.bzl +++ b/private/rules/javadoc.bzl @@ -8,6 +8,15 @@ _JavadocInfo = provider( }, ) +_DEFAULT_JAVADOCOPTS = [ + "-notimestamp", + "-use", + "-quiet", + "-Xdoclint:-missing", + "-encoding", + "UTF8", +] + def generate_javadoc( ctx, javadoc, @@ -64,7 +73,6 @@ def _javadoc_impl(ctx): # from dep[JavaInfo].compilation_info (which, FWIW, always returns # `None` https://github.com/bazelbuild/bazel/issues/10170). For this # reason we allow people to set javadocopts via the rule attrs. - generate_javadoc( ctx, ctx.executable._javadoc, @@ -107,8 +115,10 @@ javadoc = rule( "javadocopts": attr.string_list( doc = """javadoc options. Note sources and classpath are derived from the deps. Any additional - options can be passed here. - """, + options can be passed here. If nothing is passed, a default list of options is used: + %s + """ % _DEFAULT_JAVADOCOPTS, + default = _DEFAULT_JAVADOCOPTS, ), "doc_deps": attr.label_list( doc = """`javadoc` targets referenced by the current target. diff --git a/private/rules/kt_jvm_export.bzl b/private/rules/kt_jvm_export.bzl index 0f7fe8bb0..82c0d9f3c 100644 --- a/private/rules/kt_jvm_export.bzl +++ b/private/rules/kt_jvm_export.bzl @@ -68,7 +68,7 @@ def kt_jvm_export( maven_coordinates_tags = ["maven_coordinates=%s" % maven_coordinates] lib_name = "%s-lib" % name - javadocopts = kwargs.pop("javadocopts", []) + javadocopts = kwargs.pop("javadocopts", None) # ensure that the kotlin-stdlib is included in deploy_env if KOTLIN_STDLIB not in deploy_env: diff --git a/private/tools/java/com/github/bazelbuild/rules_jvm_external/javadoc/JavadocJarMaker.java b/private/tools/java/com/github/bazelbuild/rules_jvm_external/javadoc/JavadocJarMaker.java index 1f83a2b88..1dca1c416 100644 --- a/private/tools/java/com/github/bazelbuild/rules_jvm_external/javadoc/JavadocJarMaker.java +++ b/private/tools/java/com/github/bazelbuild/rules_jvm_external/javadoc/JavadocJarMaker.java @@ -155,10 +155,6 @@ public static void main(String[] args) throws IOException { } Version version = Runtime.version(); - options.addAll( - Arrays.asList( - "-notimestamp", "-use", "-quiet", "-Xdoclint:-missing", "-encoding", "UTF8")); - // Generate frames if we can. Java prior to v9 generates frames automatically. // In Java 13, the flag was removed. if (version.compareTo(JAVA_9) > 0 && version.compareTo(JAVA_13) < 0) { diff --git a/tests/custom_maven_install/regression_testing_coursier_install.json b/tests/custom_maven_install/regression_testing_coursier_install.json index 1a55bfa81..485d317a4 100644 --- a/tests/custom_maven_install/regression_testing_coursier_install.json +++ b/tests/custom_maven_install/regression_testing_coursier_install.json @@ -1,7 +1,7 @@ { "__AUTOGENERATED_FILE_DO_NOT_MODIFY_THIS_FILE_MANUALLY": "THERE_IS_NO_DATA_ONLY_ZUUL", "__INPUT_ARTIFACTS_HASH": 827556415, - "__RESOLVED_ARTIFACTS_HASH": -147300579, + "__RESOLVED_ARTIFACTS_HASH": -1895536858, "artifacts": { "android.arch.core:common": { "shasums": { @@ -267,15 +267,15 @@ }, "version": "2.9.8" }, - "com.fasterxml.jackson:jackson-bom": { + "com.fasterxml.jackson:jackson-bom:pom": { "shasums": { - "jar": null + "jar": "417043dbe6445aa3f733d1bb8fbab1e7e1dfcd18cd9fb290101b03131b7d3a6c" }, "version": "2.9.10" }, - "com.github.fommil.netlib:all": { + "com.github.fommil.netlib:all:pom": { "shasums": { - "jar": null + "jar": "cced6c7973b2f43c84944f21e45f292c94af566f1d6b45915264acb080dd6b67" }, "version": "1.1.2" }, @@ -387,9 +387,9 @@ }, "version": "3.4.0" }, - "com.github.oshi:oshi-parent": { + "com.github.oshi:oshi-parent:pom": { "shasums": { - "jar": null + "jar": "45222f5de9771661c5409ff49f1436586b0ad2a067200c263ae86c64b8a7e057" }, "version": "3.4.0" }, @@ -606,9 +606,9 @@ }, "com.nimbusds:nimbus-jose-jwt": { "shasums": { - "jar": "615999721e15da4078bd26baf7efee155c142784a6248a64d7d8797c2bf16bd0" + "jar": "77128ed53756421bf59d2fc7f31554da29ea81cad8a5345977275adb7c5254c8" }, - "version": "9.39.3" + "version": "9.40" }, "com.nimbusds:oauth2-oidc-sdk": { "shasums": { @@ -664,9 +664,9 @@ }, "version": "2.3.6" }, - "com.sun.xml.bind:jaxb-ri": { + "com.sun.xml.bind:jaxb-ri:pom": { "shasums": { - "jar": null + "jar": "1836527e8453a70d4eba8a01e79c706611d87b166f63882997c55eafaea04f14" }, "version": "2.3.6" }, @@ -1282,9 +1282,9 @@ }, "version": "0.5.0" }, - "org.apache.zookeeper:zookeeper": { + "org.apache.zookeeper:zookeeper:pom": { "shasums": { - "jar": "5f82a2d9ddadaa67a165fabc3488484cf3c2e26c0cc48138ace1fddd30f6e562" + "jar": "61e821facd8010e33803fbe9301be3f3328eb3e80746af78455ad2b578b8514c" }, "version": "3.4.13" }, @@ -1450,9 +1450,9 @@ }, "version": "1.2" }, - "org.junit:junit-bom": { + "org.junit:junit-bom:pom": { "shasums": { - "jar": null + "jar": "f783d2f3d2b56d743ff345e40a397461e2b6bad3dfa2a29b7ba7afb705ebe148" }, "version": "5.3.1" }, @@ -1650,7 +1650,7 @@ "org.scala-sbt:util-interface" ], "com.101tec:zkclient": [ - "org.apache.zookeeper:zookeeper", + "org.apache.zookeeper:zookeeper:pom", "org.slf4j:slf4j-api" ], "com.android.support:animated-vector-drawable:aar": [ @@ -1787,7 +1787,7 @@ "com.fasterxml.jackson.core:jackson-annotations", "com.fasterxml.jackson.core:jackson-core" ], - "com.github.fommil.netlib:all": [ + "com.github.fommil.netlib:all:pom": [ "com.github.fommil.netlib:core", "com.github.fommil.netlib:netlib-native_ref-linux-armhf:jar:natives", "com.github.fommil.netlib:netlib-native_ref-linux-i686:jar:natives", @@ -1868,7 +1868,7 @@ "net.java.dev.jna:jna-platform", "org.slf4j:slf4j-api" ], - "com.github.oshi:oshi-parent": [ + "com.github.oshi:oshi-parent:pom": [ "org.slf4j:slf4j-api" ], "com.github.scopt:scopt_2.11": [ @@ -1978,7 +1978,7 @@ "com.sun.xml.bind:jaxb-jxc": [ "com.sun.xml.bind:jaxb-xjc" ], - "com.sun.xml.bind:jaxb-ri": [ + "com.sun.xml.bind:jaxb-ri:pom": [ "com.sun.xml.bind:jaxb-impl", "com.sun.xml.bind:jaxb-jxc", "com.sun.xml.bind:jaxb-xjc", @@ -2020,7 +2020,7 @@ ], "io.confluent:common-utils": [ "com.101tec:zkclient", - "org.apache.zookeeper:zookeeper", + "org.apache.zookeeper:zookeeper:pom", "org.slf4j:slf4j-api" ], "io.confluent:kafka-avro-serializer": [ @@ -2199,7 +2199,7 @@ ], "org.apache.curator:curator-test": [ "com.google.guava:guava", - "org.apache.zookeeper:zookeeper", + "org.apache.zookeeper:zookeeper:pom", "org.javassist:javassist" ], "org.apache.flink:flink-annotations": [ @@ -2365,7 +2365,7 @@ "com.yammer.metrics:metrics-core", "net.sf.jopt-simple:jopt-simple", "org.apache.kafka:kafka-clients", - "org.apache.zookeeper:zookeeper", + "org.apache.zookeeper:zookeeper:pom", "org.scala-lang:scala-library", "org.scala-lang:scala-reflect", "org.slf4j:slf4j-api" @@ -2383,7 +2383,7 @@ "org.apache.maven:maven-model", "org.eclipse.sisu:org.eclipse.sisu.plexus" ], - "org.apache.zookeeper:zookeeper": [ + "org.apache.zookeeper:zookeeper:pom": [ "io.netty:netty", "jline:jline", "org.apache.yetus:audience-annotations", @@ -4932,29 +4932,6 @@ "org.apache.yetus.audience", "org.apache.yetus.audience.tools" ], - "org.apache.zookeeper:zookeeper": [ - "org.apache.jute", - "org.apache.jute.compiler", - "org.apache.jute.compiler.generated", - "org.apache.zookeeper", - "org.apache.zookeeper.client", - "org.apache.zookeeper.common", - "org.apache.zookeeper.data", - "org.apache.zookeeper.jmx", - "org.apache.zookeeper.proto", - "org.apache.zookeeper.server", - "org.apache.zookeeper.server.auth", - "org.apache.zookeeper.server.persistence", - "org.apache.zookeeper.server.quorum", - "org.apache.zookeeper.server.quorum.auth", - "org.apache.zookeeper.server.quorum.flexible", - "org.apache.zookeeper.server.upgrade", - "org.apache.zookeeper.server.util", - "org.apache.zookeeper.txn", - "org.apache.zookeeper.util", - "org.apache.zookeeper.version", - "org.apache.zookeeper.version.util" - ], "org.bouncycastle:bcpkix-jdk15on": [ "org.bouncycastle.cert", "org.bouncycastle.cert.bc", @@ -5855,6 +5832,8 @@ "com.fasterxml.jackson.core:jackson-annotations", "com.fasterxml.jackson.core:jackson-core", "com.fasterxml.jackson.core:jackson-databind", + "com.fasterxml.jackson:jackson-bom:pom", + "com.github.fommil.netlib:all:pom", "com.github.fommil.netlib:core", "com.github.fommil.netlib:native_ref-java", "com.github.fommil.netlib:native_system-java", @@ -5873,6 +5852,7 @@ "com.github.fommil:jniloader", "com.github.luben:zstd-jni", "com.github.oshi:oshi-core", + "com.github.oshi:oshi-parent:pom", "com.github.scopt:scopt_2.11", "com.github.scopt:scopt_2.12", "com.github.seancfoley:ipaddress", @@ -5919,6 +5899,7 @@ "com.sun.activation:jakarta.activation", "com.sun.xml.bind:jaxb-impl", "com.sun.xml.bind:jaxb-jxc", + "com.sun.xml.bind:jaxb-ri:pom", "com.sun.xml.bind:jaxb-xjc", "com.thoughtworks.paranamer:paranamer", "com.twitter:chill-java", @@ -6026,7 +6007,7 @@ "org.apache.maven:maven-model", "org.apache.maven:maven-plugin-api", "org.apache.yetus:audience-annotations", - "org.apache.zookeeper:zookeeper", + "org.apache.zookeeper:zookeeper:pom", "org.bouncycastle:bcpkix-jdk15on", "org.bouncycastle:bcprov-ext-jdk15on", "org.bouncycastle:bcprov-jdk15on", @@ -6054,6 +6035,7 @@ "org.jetbrains.kotlin:kotlin-test-common", "org.jetbrains:annotations", "org.joda:joda-convert", + "org.junit:junit-bom:pom", "org.lz4:lz4-java", "org.mockito:mockito-core", "org.objenesis:objenesis", @@ -6124,6 +6106,8 @@ "com.fasterxml.jackson.core:jackson-annotations", "com.fasterxml.jackson.core:jackson-core", "com.fasterxml.jackson.core:jackson-databind", + "com.fasterxml.jackson:jackson-bom:pom", + "com.github.fommil.netlib:all:pom", "com.github.fommil.netlib:core", "com.github.fommil.netlib:native_ref-java", "com.github.fommil.netlib:native_system-java", @@ -6142,6 +6126,7 @@ "com.github.fommil:jniloader", "com.github.luben:zstd-jni", "com.github.oshi:oshi-core", + "com.github.oshi:oshi-parent:pom", "com.github.scopt:scopt_2.11", "com.github.scopt:scopt_2.12", "com.github.seancfoley:ipaddress", @@ -6188,6 +6173,7 @@ "com.sun.activation:jakarta.activation", "com.sun.xml.bind:jaxb-impl", "com.sun.xml.bind:jaxb-jxc", + "com.sun.xml.bind:jaxb-ri:pom", "com.sun.xml.bind:jaxb-xjc", "com.thoughtworks.paranamer:paranamer", "com.twitter:chill-java", @@ -6295,7 +6281,7 @@ "org.apache.maven:maven-model", "org.apache.maven:maven-plugin-api", "org.apache.yetus:audience-annotations", - "org.apache.zookeeper:zookeeper", + "org.apache.zookeeper:zookeeper:pom", "org.bouncycastle:bcpkix-jdk15on", "org.bouncycastle:bcprov-ext-jdk15on", "org.bouncycastle:bcprov-jdk15on", @@ -6323,6 +6309,7 @@ "org.jetbrains.kotlin:kotlin-test-common", "org.jetbrains:annotations", "org.joda:joda-convert", + "org.junit:junit-bom:pom", "org.lz4:lz4-java", "org.mockito:mockito-core", "org.objenesis:objenesis", @@ -6393,6 +6380,8 @@ "com.fasterxml.jackson.core:jackson-annotations", "com.fasterxml.jackson.core:jackson-core", "com.fasterxml.jackson.core:jackson-databind", + "com.fasterxml.jackson:jackson-bom:pom", + "com.github.fommil.netlib:all:pom", "com.github.fommil.netlib:core", "com.github.fommil.netlib:native_ref-java", "com.github.fommil.netlib:native_system-java", @@ -6411,6 +6400,7 @@ "com.github.fommil:jniloader", "com.github.luben:zstd-jni", "com.github.oshi:oshi-core", + "com.github.oshi:oshi-parent:pom", "com.github.scopt:scopt_2.11", "com.github.scopt:scopt_2.12", "com.github.seancfoley:ipaddress", @@ -6457,6 +6447,7 @@ "com.sun.activation:jakarta.activation", "com.sun.xml.bind:jaxb-impl", "com.sun.xml.bind:jaxb-jxc", + "com.sun.xml.bind:jaxb-ri:pom", "com.sun.xml.bind:jaxb-xjc", "com.thoughtworks.paranamer:paranamer", "com.twitter:chill-java", @@ -6564,7 +6555,7 @@ "org.apache.maven:maven-model", "org.apache.maven:maven-plugin-api", "org.apache.yetus:audience-annotations", - "org.apache.zookeeper:zookeeper", + "org.apache.zookeeper:zookeeper:pom", "org.bouncycastle:bcpkix-jdk15on", "org.bouncycastle:bcprov-ext-jdk15on", "org.bouncycastle:bcprov-jdk15on", @@ -6592,6 +6583,7 @@ "org.jetbrains.kotlin:kotlin-test-common", "org.jetbrains:annotations", "org.joda:joda-convert", + "org.junit:junit-bom:pom", "org.lz4:lz4-java", "org.mockito:mockito-core", "org.objenesis:objenesis", @@ -6808,12 +6800,5 @@ ] } }, - "skipped": [ - "com.fasterxml.jackson:jackson-bom", - "com.github.fommil.netlib:all", - "com.github.oshi:oshi-parent", - "com.sun.xml.bind:jaxb-ri", - "org.junit:junit-bom" - ], "version": "2" }