diff --git a/build.sh b/build.sh index e39f5be5e2..07c46292fd 100755 --- a/build.sh +++ b/build.sh @@ -542,6 +542,19 @@ if hasArg docs; then cd "${REPODIR}"/rust cargo doc -p cuvs --no-deps rsync -av "${RUST_BUILD_DIR}"/doc/ "${SPHINX_BUILD_DIR}"/build/html/_static/rust + cd "${REPODIR}"/java/cuvs-java + # cuvs-java is a Java module (has src/main/java/module-info.java). The + # `javadoc:javadoc` mojo forks a build lifecycle that only runs through + # `generate-sources`, so module-info.java is never compiled during the fork + # and maven-javadoc-plugin (>=3.10) errors with "named and unnamed modules" + # on a fresh checkout. Run `compile` first so module-info.class exists, then + # use `javadoc:javadoc-no-fork` to reuse those compiled classes. + # -Dspotless.apply.skip avoids the spotless plugin (bound to the validate + # phase) from rewriting source license headers during a docs-only build. + mvn compile javadoc:javadoc-no-fork \ + -DexcludePackageNames=com.nvidia.cuvs.internal.panama \ + -Dspotless.apply.skip=true + rsync -av "${JAVA_BUILD_DIR}"/reports/apidocs/ "${SPHINX_BUILD_DIR}"/build/html/_static/java fi ################################################################################ diff --git a/ci/build_docs.sh b/ci/build_docs.sh index 65c8f29f8a..8eafb9fbb5 100755 --- a/ci/build_docs.sh +++ b/ci/build_docs.sh @@ -50,10 +50,26 @@ export LIBCLANG_PATH cargo doc -p cuvs --no-deps popd +rapids-logger "Build Java docs" +pushd java/cuvs-java +# cuvs-java is a Java module (has src/main/java/module-info.java). The +# `javadoc:javadoc` mojo forks a build lifecycle that only runs through +# `generate-sources`, so module-info.java is never compiled during the fork and +# maven-javadoc-plugin (>=3.10) errors with "named and unnamed modules" on a +# fresh checkout. Run `compile` first so module-info.class exists, then use +# `javadoc:javadoc-no-fork` to reuse those compiled classes. +# -Dspotless.apply.skip avoids the spotless plugin (bound to the validate phase) +# from rewriting source license headers during a docs-only build. +mvn compile javadoc:javadoc-no-fork \ + -DexcludePackageNames=com.nvidia.cuvs.internal.panama \ + -Dspotless.apply.skip=true +popd + rapids-logger "Build Python docs" pushd docs make dirhtml mv ../rust/target/doc ./build/dirhtml/_static/rust +mv ../java/cuvs-java/target/reports/apidocs ./build/dirhtml/_static/java mkdir -p "${RAPIDS_DOCS_DIR}/cuvs/"html mv build/dirhtml/* "${RAPIDS_DOCS_DIR}/cuvs/html" popd diff --git a/dependencies.yaml b/dependencies.yaml index 2aae054862..30f0e8814b 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -79,6 +79,7 @@ files: - cuda_version - depends_on_cupy - docs + - java - py_version - rapids_build - rust diff --git a/docs/source/api_docs.rst b/docs/source/api_docs.rst index 68d184c72c..707a5a0c2e 100644 --- a/docs/source/api_docs.rst +++ b/docs/source/api_docs.rst @@ -8,6 +8,7 @@ API Reference cpp_api.rst python_api.rst rust_api/index.rst + java_api/index.rst * :ref:`genindex` * :ref:`search` diff --git a/docs/source/java_api/index.rst b/docs/source/java_api/index.rst new file mode 100644 index 0000000000..fe26bc7d44 --- /dev/null +++ b/docs/source/java_api/index.rst @@ -0,0 +1,20 @@ +~~~~~~~~~~~~~~~~~~~~~~ +Java API Documentation +~~~~~~~~~~~~~~~~~~~~~~ + +.. raw:: html + +
+ + + +