Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines +554 to +556
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify the actual package structure to understand what should be excluded

echo "=== Checking for panama packages ==="
fd -t d -i "panama" java/

echo ""
echo "=== Checking for examples packages ==="
fd -t d "examples" java/

echo ""
echo "=== pom.xml excludePackageNames configuration ==="
rg -n "excludePackageNames" java/cuvs-java/pom.xml

Repository: rapidsai/cuvs

Length of output: 399


Align package exclusions with pom.xml configuration.

The -DexcludePackageNames value here only excludes com.nvidia.cuvs.internal.panama, but java/cuvs-java/pom.xml:201 excludes com.nvidia.cuvs.examples,com.nvidia.cuvs.panama. Since Maven -D properties override pom.xml entirely, building docs via this script will:

  • Include com.nvidia.cuvs.examples in public API docs (likely unintended)
  • Exclude com.nvidia.cuvs.internal.panama instead of com.nvidia.cuvs.panama

Either pass the full exclusion list (com.nvidia.cuvs.examples,com.nvidia.cuvs.internal.panama) or verify that the pom.xml package names match the actual codebase structure.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@build.sh` around lines 554 - 556, The mvn invocation's -DexcludePackageNames
currently sets only com.nvidia.cuvs.internal.panama which conflicts with the
pom.xml exclusions; update the -DexcludePackageNames value in the mvn command
(the line invoking mvn compile javadoc:javadoc-no-fork) to include the full
exclusion list used in the pom (for example:
com.nvidia.cuvs.examples,com.nvidia.cuvs.internal.panama) or change it to match
the actual package names in pom.xml so the Javadoc exclusions are aligned.

rsync -av "${JAVA_BUILD_DIR}"/reports/apidocs/ "${SPHINX_BUILD_DIR}"/build/html/_static/java
fi

################################################################################
Expand Down
16 changes: 16 additions & 0 deletions ci/build_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ files:
- cuda_version
- depends_on_cupy
- docs
- java
- py_version
- rapids_build
- rust
Expand Down
1 change: 1 addition & 0 deletions docs/source/api_docs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ API Reference
cpp_api.rst
python_api.rst
rust_api/index.rst
java_api/index.rst

* :ref:`genindex`
* :ref:`search`
20 changes: 20 additions & 0 deletions docs/source/java_api/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
~~~~~~~~~~~~~~~~~~~~~~
Java API Documentation
~~~~~~~~~~~~~~~~~~~~~~

.. raw:: html

<p style="margin-bottom: 1rem;">
<a href="../_static/java/index.html" target="_blank" rel="noopener noreferrer">
Open Java API documentation in a new tab &#8599;
</a>
</p>
<iframe src="../_static/java/index.html" height="720px" width="100%"></iframe>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add a title to the iframe for accessibility.

The embedded iframe should include a descriptive title so assistive technologies can identify its purpose.

♿ Proposed fix
-    <iframe src="../_static/java/index.html" height="720px" width="100%"></iframe>
+    <iframe
+        src="../_static/java/index.html"
+        title="cuVS Java API documentation"
+        height="720px"
+        width="100%"></iframe>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/source/java_api/index.rst` at line 12, The iframe element in the docs
(the <iframe ...> in the java_api index) lacks an accessible title; update the
iframe tag that currently reads src="../_static/java/index.html" height="720px"
width="100%" to include a descriptive title attribute (e.g., title="Java API
documentation" or similar) so assistive technologies can identify the embedded
content.


<!-- hide the 'view source' section here, since it doesn't work with the iframe
and we want the iframe to use the space -->
<style type="text/css">
.bd-sidebar-secondary {
display: none;
}
</style>
Loading