Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mess around more with Javadoc and Maven toolchains: #7591

Merged
merged 1 commit into from
Jan 3, 2025
Merged
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
37 changes: 22 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,24 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# When we specify multiple JDKs, the final one becomes the default, which is used to execute Maven itself.
# Our Maven configuration then specifies different JDKs to use for some of the steps:
# - 11 for building Javadoc
# - 11 (sometimes) to *download* to support anyone who runs JDiff or our Gradle integration tests (including our doc snapshots and our Java 11 CI test run) but not to use directly
# - 21 for building Javadoc
# - 23 for running javac (to help people who build Guava locally and might not use a recent JDK to run Maven)
# (Note that we also use Java 11 for running our Gradle integration tests. But we run those only when we are already going to run tests under Java 11.)
- name: 'Set up JDKs'
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
with:
java-version: |
${{ matrix.java }}
11
21
23
distribution: 'zulu'
distribution: 'temurin'
cache: 'maven'
- name: 'Install'
shell: bash
run: ./mvnw -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn install -U -DskipTests=true -f $ROOT_POM
run: ./mvnw -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -Dtoolchain.skip install -U -DskipTests=true -f $ROOT_POM
- name: 'Test'
shell: bash
run: ./mvnw -B -P!standard-with-extra-repos verify -U -Dmaven.javadoc.skip=true -Dsurefire.toolchain.version=${{ matrix.java }} -f $ROOT_POM
run: ./mvnw -B -P!standard-with-extra-repos -Dtoolchain.skip verify -U -Dmaven.javadoc.skip=true -Dsurefire.toolchain.version=${{ matrix.java }} -f $ROOT_POM
- name: 'Print Surefire reports'
# Note: Normally a step won't run if the job has failed, but this causes it to
if: ${{ failure() }}
Expand All @@ -75,14 +75,15 @@ jobs:
steps:
- name: 'Check out repository'
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 'Set up JDK 21'
- name: 'Set up JDKs'
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
with:
java-version: 21
distribution: 'zulu'
server-id: sonatype-nexus-snapshots
server-username: CI_DEPLOY_USERNAME
server-password: CI_DEPLOY_PASSWORD
# For discussion, see the first setup-java block.
# The publish-snapshot workflow doesn't run tests, so we don't have to care which version Maven would select for that step.
java-version: |
21
23
distribution: 'temurin'
cache: 'maven'
- name: 'Publish'
env:
Expand All @@ -100,11 +101,17 @@ jobs:
steps:
- name: 'Check out repository'
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 'Set up JDK 11'
- name: 'Set up JDKs'
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
with:
java-version: 11
distribution: 'zulu'
# For discussion, see the first setup-java block.
# The generate-docs workflow doesn't run tests, so we don't have to care which version Maven would select for that step.
# But we need Java 11 for JDiff.
java-version: |
11
21
23
distribution: 'temurin'
cache: 'maven'
- name: 'Generate latest docs'
env:
Expand Down
1 change: 1 addition & 0 deletions android/guava/src/com/google/common/graph/ValueGraph.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package com.google.common.graph;

import com.google.common.annotations.Beta;
import java.util.Collection;
import java.util.Set;
import org.jspecify.annotations.Nullable;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* <ul>
* <li>{@link ImmutableDoubleArray}
* <li>{@link ImmutableIntArray}
* <li>{@link ImmutableLongrray}
* <li>{@link ImmutableLongArray}
* <li>{@link UnsignedInteger}
* <li>{@link UnsignedLong}
* </ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.google.errorprone.annotations.concurrent.LazyInit;
import java.util.concurrent.Callable;
import java.util.concurrent.Executor;
import java.util.concurrent.Future;
import java.util.concurrent.atomic.AtomicReference;
import org.jspecify.annotations.Nullable;

Expand Down
55 changes: 34 additions & 21 deletions android/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@
<plugin>
<groupId>org.mvnsearch</groupId>
<artifactId>toolchains-maven-plugin</artifactId>
<version>4.5.0</version>
<executions>
<!--
We can apparently have only one <jdk> per execution: Others are silently ignored :(
Expand All @@ -203,15 +202,15 @@
(But don't run that if you have put something into ~/.m2/toolchains.xml yourself.)
-->
<execution>
<id>download-11</id>
<id>download-21</id>
<goals>
<goal>toolchain</goal>
</goals>
<configuration>
<toolchains>
<jdk>
<version>11</version>
<vendor>zulu</vendor>
<version>21</version>
<vendor>temurin</vendor>
</jdk>
</toolchains>
</configuration>
Expand All @@ -225,11 +224,11 @@
<toolchains>
<jdk>
<version>23</version>
<vendor>zulu</vendor>
<vendor>temurin</vendor>
</jdk>
<testJdk>
<version>${surefire.toolchain.version}</version>
<vendor>zulu</vendor>
<vendor>temurin</vendor>
</testJdk>
</toolchains>
</configuration>
Expand All @@ -250,7 +249,6 @@
<toolchains>
<jdk>
<version>23</version>
<vendor>zulu</vendor>
</jdk>
</toolchains>
</configuration>
Expand Down Expand Up @@ -332,10 +330,9 @@
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.11.1</version>
<configuration>
<!-- TODO: b/286965322 - Use a newer version (probably the default javac toolchain we set up?) if it doesn't break Javadoc (including causing trouble for our later run of JDiff, which we do outside Maven, during snapshots/releases). At that point, we'll likely want to remove the no-module-directories additionalJOption, as documented below. -->
<jdkToolchain>
<version>11</version>
<vendor>zulu</vendor>
<version>21</version>
<vendor>temurin</vendor>
</jdkToolchain>
<quiet>true</quiet>
<notimestamp>true</notimestamp>
Expand All @@ -348,14 +345,6 @@
</additionalOptions>
<linksource>true</linksource>
<source>8</source>
<!--
Required to make symbol search work correctly in the generated pages under JDK 11-12.

This flag does not exist on 9-10 and 13+ (https://bugs.openjdk.java.net/browse/JDK-8215582).

Consider removing it once our Javadoc generation is migrated to a recent JDK.
-->
<additionalJOption>--no-module-directories</additionalJOption>
</configuration>
<executions>
<execution>
Expand All @@ -378,7 +367,6 @@
<configuration>
<jdkToolchain>
<version>${surefire.toolchain.version}</version>
<vendor>zulu</vendor>
</jdkToolchain>
<includes>
<include>${test.include}</include>
Expand Down Expand Up @@ -420,6 +408,11 @@
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.4.0</version>
</plugin>
<plugin>
<groupId>org.mvnsearch</groupId>
<artifactId>toolchains-maven-plugin</artifactId>
<version>4.5.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>
Expand Down Expand Up @@ -511,11 +504,32 @@
<test.add.opens></test.add.opens>
</properties>
</profile>
<!-- The Gradle integration tests need to set JAVA_HOME to the location of Java 11. The following profile extracts that location. -->
<!-- JDiff and the Gradle integration tests need Java 11 to be installed, and they need to know where it's located so that they can set JAVA_HOME to point to it. The following profile downloads a temurin Java 11 (if one isn't already available) and writes its location to target/java_11_home. This lets our JDiff and Gradle-integration-test scripts invoke the `print-java-11-home` profile and then read that file. -->
<profile>
<id>print-java-11-home</id>
<build>
<plugins>
<plugin>
<groupId>org.mvnsearch</groupId>
<artifactId>toolchains-maven-plugin</artifactId>
<executions>
<execution>
<id>download-11</id>
<phase>initialize</phase>
<goals>
<goal>toolchain</goal>
</goals>
<configuration>
<toolchains>
<jdk>
<version>11</version>
<vendor>temurin</vendor>
</jdk>
</toolchains>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-toolchains-plugin</artifactId>
<executions>
Expand All @@ -531,7 +545,6 @@
<toolchains>
<jdk>
<version>11</version>
<vendor>zulu</vendor>
</jdk>
</toolchains>
</configuration>
Expand Down
1 change: 1 addition & 0 deletions guava/src/com/google/common/graph/ValueGraph.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package com.google.common.graph;

import com.google.common.annotations.Beta;
import java.util.Collection;
import java.util.Optional;
import java.util.Set;
import org.jspecify.annotations.Nullable;
Expand Down
2 changes: 1 addition & 1 deletion guava/src/com/google/common/primitives/package-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* <ul>
* <li>{@link ImmutableDoubleArray}
* <li>{@link ImmutableIntArray}
* <li>{@link ImmutableLongrray}
* <li>{@link ImmutableLongArray}
* <li>{@link UnsignedInteger}
* <li>{@link UnsignedLong}
* </ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.google.errorprone.annotations.concurrent.LazyInit;
import java.util.concurrent.Callable;
import java.util.concurrent.Executor;
import java.util.concurrent.Future;
import java.util.concurrent.atomic.AtomicReference;
import org.jspecify.annotations.Nullable;

Expand Down
Loading
Loading