From e59dadc4cabb7d09dbfbe6f7c1832496f29b85c7 Mon Sep 17 00:00:00 2001 From: Alice Li Date: Wed, 21 Feb 2024 11:31:36 -0500 Subject: [PATCH 1/3] feat: update golden tests for usage with Java17 --- third_party/docfx-doclet-143274/README.md | 14 +++++++------- .../com/microsoft/doclet/DocletRunnerTest.java | 4 ++-- ...es.ExceptionHandler.Interceptor.RetryResult.yml | 8 +++++++- ...les.google.RecognitionAudio.AudioSourceCase.yml | 8 +++++++- ...subpackage.Person.IdentificationInfo.Gender.yml | 6 ++++++ 5 files changed, 29 insertions(+), 11 deletions(-) diff --git a/third_party/docfx-doclet-143274/README.md b/third_party/docfx-doclet-143274/README.md index 4d88be6a..f1c9131a 100644 --- a/third_party/docfx-doclet-143274/README.md +++ b/third_party/docfx-doclet-143274/README.md @@ -1,15 +1,15 @@ ## JavaDoc Doclet for DocFX -[![Build status](https://apidrop.visualstudio.com/Toolshed/_apis/build/status/Toolshed-Maven-CI)](https://apidrop.visualstudio.com/Toolshed/_build/latest?definitionId=1633) - This doclet is designed to produce a YAML representation of the Javadoc-generated documentation, that can be integrated into [DocFX](https://dotnet.github.io/docfx/). +It contains some Google-specific configurations to render pages on cloud.google.com. +The latest version of this doclet has been updated to be run with Java 17. It should work with Java 11 to generate Yaml files; however, the unit tests within this repo will fail. ## Getting started -The easiest way is to just get the JAR files directly from our [releases](https://github.com/dendeli-msft/docfx-doclet/releases). +This repo is a fork off of: [https://github.com/docascode/docfx-doclet](https://github.com/dendeli-msft/docfx-doclet/releases). -Alternatively, you can clone the repository and build it with the help of Maven. You can do so by calling: +You can clone this repository and build it with the help of Maven. You can do so by calling: ```bash mvn compile @@ -38,7 +38,7 @@ To cut a new release of the doclet for updated Cloud RAD content, do the followi `git push origin v1..` -3) Update the `publish_javadoc11.sh` script within g3 to use the latest version of the doclet. +3) Update the `publish_javadoc17.sh` script within g3 to use the latest version of the doclet. ## Usage @@ -50,7 +50,7 @@ When there is an existing java project where Maven is used as a build tool, one org.apache.maven.plugins maven-javadoc-plugin - 3.0.1 + 3.5.0 com.microsoft.doclet.DocFxDoclet @@ -97,7 +97,7 @@ One can execute the `javadoc` command with the command line parameters: ```bash javadoc \ -encoding UTF-8 \ --docletpath ./target/docfx-doclet-1.0-SNAPSHOT-jar-with-dependencies.jar \ +-docletpath ./target/docfx-doclet-1.0-SNAPSHOT-jar-with-dependencies.jar \ # Update the version here to the doclet version you want to use -doclet com.microsoft.doclet.DocFxDoclet \ -classpath \ -sourcepath ./src/test/java \ diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/doclet/DocletRunnerTest.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/doclet/DocletRunnerTest.java index cfd29039..e4c9b46c 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/doclet/DocletRunnerTest.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/doclet/DocletRunnerTest.java @@ -93,8 +93,8 @@ public void testFilesGeneration() throws IOException { assertEquals( "Unexpected amount of lines in file " + generatedFilePath, - generatedFileLines.length, - expectedFileLines.length); + expectedFileLines.length, + generatedFileLines.length); for (int i = 0; i < generatedFileLines.length; i++) { assertEquals( diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.yml index 96e630fa..80ec1aed 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.yml @@ -25,6 +25,7 @@ items: - "java.lang.Enum.valueOf(java.lang.Class,java.lang.String)" - "java.lang.Enum.clone()" - "java.lang.Enum.compareTo(E)" + - "java.lang.Enum.describeConstable()" - "java.lang.Enum.equals(java.lang.Object)" - "java.lang.Enum.finalize()" - "java.lang.Enum.getDeclaringClass()" @@ -195,6 +196,11 @@ references: name: "Enum.finalize()" nameWithType: "Enum.finalize()" fullName: "java.lang.Enum.finalize()" +- uid: "java.lang.Enum.describeConstable()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#describeConstable--" + name: "Enum.describeConstable()" + nameWithType: "Enum.describeConstable()" + fullName: "java.lang.Enum.describeConstable()" - uid: "java.lang.Object.notifyAll()" href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--" name: "Object.notifyAll()" @@ -267,4 +273,4 @@ references: - uid: "T>valueOf(java.lang.Class" name: "T>valueOf(Class" nameWithType: "T>valueOf(Class" - fullName: "T>valueOf(java.lang.Class" + fullName: "T>valueOf(java.lang.Class" \ No newline at end of file diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.RecognitionAudio.AudioSourceCase.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.RecognitionAudio.AudioSourceCase.yml index 3ceed122..3f3224c4 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.RecognitionAudio.AudioSourceCase.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.RecognitionAudio.AudioSourceCase.yml @@ -31,6 +31,7 @@ items: - "java.lang.Enum.valueOf(java.lang.Class,java.lang.String)" - "java.lang.Enum.clone()" - "java.lang.Enum.compareTo(E)" + - "java.lang.Enum.describeConstable()" - "java.lang.Enum.equals(java.lang.Object)" - "java.lang.Enum.finalize()" - "java.lang.Enum.getDeclaringClass()" @@ -287,6 +288,11 @@ references: name: "Enum.finalize()" nameWithType: "Enum.finalize()" fullName: "java.lang.Enum.finalize()" +- uid: "java.lang.Enum.describeConstable()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#describeConstable--" + name: "Enum.describeConstable()" + nameWithType: "Enum.describeConstable()" + fullName: "java.lang.Enum.describeConstable()" - uid: "java.lang.Object.notifyAll()" href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--" name: "Object.notifyAll()" @@ -359,4 +365,4 @@ references: - uid: "T>valueOf(java.lang.Class" name: "T>valueOf(Class" nameWithType: "T>valueOf(Class" - fullName: "T>valueOf(java.lang.Class" + fullName: "T>valueOf(java.lang.Class" \ No newline at end of file diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.Person.IdentificationInfo.Gender.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.Person.IdentificationInfo.Gender.yml index ede81fa9..1fb375dd 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.Person.IdentificationInfo.Gender.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.Person.IdentificationInfo.Gender.yml @@ -25,6 +25,7 @@ items: - "java.lang.Enum.valueOf(java.lang.Class,java.lang.String)" - "java.lang.Enum.clone()" - "java.lang.Enum.compareTo(E)" + - "java.lang.Enum.describeConstable()" - "java.lang.Enum.equals(java.lang.Object)" - "java.lang.Enum.finalize()" - "java.lang.Enum.getDeclaringClass()" @@ -179,6 +180,11 @@ references: name: "Enum.finalize()" nameWithType: "Enum.finalize()" fullName: "java.lang.Enum.finalize()" +- uid: "java.lang.Enum.describeConstable()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#describeConstable--" + name: "Enum.describeConstable()" + nameWithType: "Enum.describeConstable()" + fullName: "java.lang.Enum.describeConstable()" - uid: "java.lang.Object.notifyAll()" href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--" name: "Object.notifyAll()" From 9dd2c9c283b717d49a2bd07365001de910ea8c88 Mon Sep 17 00:00:00 2001 From: Alice Li Date: Wed, 21 Feb 2024 11:37:26 -0500 Subject: [PATCH 2/3] update ci.yml to run with java17 --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 32c9fac6..092bb6e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 with: - java-version: 11 + java-version: 17 distribution: temurin - run: mvn -B -ntp install -DskipTests @@ -28,7 +28,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 with: - java-version: 11 + java-version: 17 distribution: temurin - run: mvn -B -ntp test @@ -38,7 +38,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 with: - java-version: 11 + java-version: 17 distribution: temurin - run: mvn --version - run: mvn -B -ntp fmt:check From bac90f795ed66e247d3591757c6e952ec8d73f74 Mon Sep 17 00:00:00 2001 From: Alice Li Date: Wed, 21 Feb 2024 11:47:12 -0500 Subject: [PATCH 3/3] revert lint to use java 11 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 092bb6e6..ea531de5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 with: - java-version: 17 + java-version: 11 distribution: temurin - run: mvn --version - run: mvn -B -ntp fmt:check