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

feat: update golden tests for usage with Java17 #244

Merged
merged 5 commits into from
Feb 21, 2024
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
14 changes: 7 additions & 7 deletions third_party/docfx-doclet-143274/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -38,7 +38,7 @@ To cut a new release of the doclet for updated Cloud RAD content, do the followi

`git push origin v1.<minor>.<patch>`

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

Expand All @@ -50,7 +50,7 @@ When there is an existing java project where Maven is used as a build tool, one
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.1</version>
<version>3.5.0</version>
<configuration>
<doclet>com.microsoft.doclet.DocFxDoclet</doclet>
<docletArtifact>
Expand Down Expand Up @@ -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 <list of jar with dependencies> \
-sourcepath ./src/test/java \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ items:
- "java.lang.Enum.<T>valueOf(java.lang.Class<T>,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()"
Expand Down Expand Up @@ -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()"
Expand Down Expand Up @@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ items:
- "java.lang.Enum.<T>valueOf(java.lang.Class<T>,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()"
Expand Down Expand Up @@ -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()"
Expand Down Expand Up @@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ items:
- "java.lang.Enum.<T>valueOf(java.lang.Class<T>,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()"
Expand Down Expand Up @@ -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()"
Expand Down