Skip to content

Commit

Permalink
docs: generate Javadocs (#1362)
Browse files Browse the repository at this point in the history
In #1357 I'd like to explore hacking Javadocs into Intersphinx for
better cross-linking, but first we have to actually generate the
Javadocs.

Fixes #1361.
  • Loading branch information
lidavidm authored Dec 18, 2023
1 parent 9544887 commit d9490ae
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 90 deletions.
21 changes: 21 additions & 0 deletions ci/conda_env_java.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

maven
# maven javadocs build appears to fail under Java 21
# maven javadocs build appears to emit the wrong stylesheet under Java 8
openjdk=17.*
6 changes: 6 additions & 0 deletions ci/scripts/docs_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ main() {
make doctest
popd

pushd "$source_dir/java"
mvn site
rm -rf "$source_dir/docs/build/java/api"
cp -r target/site/apidocs "$source_dir/docs/build/java/api"
popd

for desc_file in $(find "${source_dir}/r" -name DESCRIPTION); do
local pkg=$(dirname "$desc_file")
local pkg_name=$(basename $pkg)
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ services:
volumes:
- .:/adbc:delegated
command: |
/bin/bash -c 'git config --global --add safe.directory /adbc && source /opt/conda/etc/profile.d/conda.sh && mamba create -y -n adbc -c conda-forge go --file /adbc/ci/conda_env_cpp.txt --file /adbc/ci/conda_env_docs.txt --file /adbc/ci/conda_env_python.txt && conda activate adbc && env ADBC_USE_ASAN=0 ADBC_USE_UBSAN=0 /adbc/ci/scripts/cpp_build.sh /adbc /adbc/build && env CGO_ENABLED=1 /adbc/ci/scripts/go_build.sh /adbc /adbc/build && /adbc/ci/scripts/python_build.sh /adbc /adbc/build && /adbc/ci/scripts/r_build.sh /adbc && /adbc/ci/scripts/docs_build.sh /adbc'
/bin/bash -c 'git config --global --add safe.directory /adbc && source /opt/conda/etc/profile.d/conda.sh && mamba create -y -n adbc -c conda-forge go --file /adbc/ci/conda_env_cpp.txt --file /adbc/ci/conda_env_docs.txt --file /adbc/ci/conda_env_java.txt --file /adbc/ci/conda_env_python.txt && conda activate adbc && env ADBC_USE_ASAN=0 ADBC_USE_UBSAN=0 /adbc/ci/scripts/cpp_build.sh /adbc /adbc/build && env CGO_ENABLED=1 /adbc/ci/scripts/go_build.sh /adbc /adbc/build && /adbc/ci/scripts/python_build.sh /adbc /adbc/build && /adbc/ci/scripts/r_build.sh /adbc && /adbc/ci/scripts/docs_build.sh /adbc'
############################ Java JARs ######################################

Expand Down
79 changes: 0 additions & 79 deletions docs/source/java/api/adbc_driver_manager.rst

This file was deleted.

10 changes: 4 additions & 6 deletions docs/source/java/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@
.. specific language governing permissions and limitations
.. under the License.
====================
==================
Java API Reference
====================
==================

.. toctree::
:maxdepth: 1

adbc_driver_manager
This is a stub page for the Javadocs. If you're seeing this page, it means
that the actual Javadocs were not generated.
2 changes: 1 addition & 1 deletion docs/source/java/driver_manager.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ To include the ADBC Driver Manager in your Maven project, add the following depe
API Reference
=============

See the API reference: :doc:`./api/adbc_driver_manager`.
See the `API reference <./api/org/apache/arrow/adbc/drivermanager/package-summary.html>`_.
9 changes: 6 additions & 3 deletions java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -219,17 +219,20 @@
<reporting>
<plugins>
<plugin>
<!-- Will only work with JDK 17 (JDK 21 is broken and JDK 8 emits the
wrong stylesheet) -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.4.1</version>
<version>3.6.3</version>
<configuration>
<!-- Stop it from trying to document the tests -->
<additionalOptions>-package</additionalOptions>
<!-- Ignore missing @return, @throws -->
<doclint>all,-missing</doclint>
<links>
<link>https://arrow.apache.org/docs/java/reference/</link>
</links>
<!-- Stop it from trying to document the tests -->
<release>8</release>
<show>public</show>
<source>1.8</source>
</configuration>
<reportSets>
Expand Down

0 comments on commit d9490ae

Please sign in to comment.