diff --git a/.github/workflows/javadoc.yml b/.github/workflows/javadoc.yml new file mode 100644 index 00000000..fcb38e62 --- /dev/null +++ b/.github/workflows/javadoc.yml @@ -0,0 +1,31 @@ +name: Generate JavaDoc and deploy to GitHub Pages + +on: + push: + branches: + [ "main" ] + +jobs: + build: + permissions: + contents: write + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v5 + + - name: Set up JDK + uses: actions/setup-java@v5 + with: + distribution: 'temurin' + java-version: '17' + + - name: Generate JavaDoc + run: ./gradlew javadoc + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./build/docs/javadoc diff --git a/build.gradle b/build.gradle index f1f5f841..73efe7b9 100644 --- a/build.gradle +++ b/build.gradle @@ -1,9 +1,9 @@ plugins { id "java" id "edu.wpi.first.GradleRIO" version "2025.3.1" - id 'com.diffplug.spotless' version '6.12.0' + id 'com.diffplug.spotless' version "6.12.0" id "com.peterabeles.gversion" version "1.10" - id "io.freefair.lombok" version "6.6.1" + id "io.freefair.lombok" version "6.6.2" id("com.github.spotbugs") version "6.0.24" } @@ -147,7 +147,7 @@ spotless { exclude '**/build/**', '**/build-*/**' } toggleOffOn() - googleJavaFormat("1.7").aosp() + googleJavaFormat("1.15.0").aosp() removeUnusedImports() trimTrailingWhitespace() endWithNewline() @@ -201,3 +201,10 @@ tasks.spotbugsMain { setStylesheet("fancy-hist.xsl") } } + +//Javadoc Gradle task configuation +javadoc { + options.addStringOption('Xdoclint:none', '-quiet') + failOnError = false + exclude '**/*.md' +} diff --git a/src/main/java/frc/reefscape/offsets/StateChampsOffsets.java b/src/main/java/frc/reefscape/offsets/StateChampsOffsets.java index d29f84ae..3ebea1a8 100644 --- a/src/main/java/frc/reefscape/offsets/StateChampsOffsets.java +++ b/src/main/java/frc/reefscape/offsets/StateChampsOffsets.java @@ -68,7 +68,9 @@ private static double meterConverter(double offsetInches) { return meterConversion + halfRobotLength; } - /** @param degrees */ + /** + * @param degrees + */ private static double radianConverter(double offsetDegrees) { double radianConversion = Units.degreesToRadians(offsetDegrees); diff --git a/src/main/java/frc/spectrumLib/util/ExpCurve.java b/src/main/java/frc/spectrumLib/util/ExpCurve.java index 37e14f4a..a77dcaac 100644 --- a/src/main/java/frc/spectrumLib/util/ExpCurve.java +++ b/src/main/java/frc/spectrumLib/util/ExpCurve.java @@ -43,7 +43,9 @@ public ExpCurve(double expVal, double offset, double scalar, double deadzone) { setDeadzone(deadzone); } - /** @param input value to be mapped */ + /** + * @param input value to be mapped + */ @Override public double calculate(double input) { double val = calculateOffset(calculateScalar(calculateExpVal(calculateDeadzone(input)))); diff --git a/src/main/java/frc/spectrumLib/util/Trio.java b/src/main/java/frc/spectrumLib/util/Trio.java index c2089443..df81daed 100644 --- a/src/main/java/frc/spectrumLib/util/Trio.java +++ b/src/main/java/frc/spectrumLib/util/Trio.java @@ -59,7 +59,6 @@ public C getThird() { * @param The third object's type. * @param a The first object. * @param b The second object. - * @param b The second object. * @return A trio comprised of the three given objects. */ public static Trio of(A a, B b, C c) { diff --git a/src/main/java/frc/spectrumLib/vision/Limelight.java b/src/main/java/frc/spectrumLib/vision/Limelight.java index de8f285d..4864d6c1 100644 --- a/src/main/java/frc/spectrumLib/vision/Limelight.java +++ b/src/main/java/frc/spectrumLib/vision/Limelight.java @@ -125,7 +125,9 @@ public double getVerticalOffset() { return LimelightHelpers.getTY(config.getName()); } - /** @return Whether the LL has any valid targets (April tags or other vision targets) */ + /** + * @return Whether the LL has any valid targets (April tags or other vision targets) + */ public boolean targetInView() { if (!isAttached()) { return false; @@ -133,7 +135,9 @@ public boolean targetInView() { return LimelightHelpers.getTV(config.getName()); } - /** @return whether the LL sees multiple tags or not */ + /** + * @return whether the LL sees multiple tags or not + */ public boolean multipleTagsInView() { if (!isAttached()) { return false; @@ -172,7 +176,9 @@ public double getTargetSize() { /* ::: Pose Retrieval ::: */ - /** @return the corresponding LL Pose3d (MEGATAG1) for the alliance in DriverStation.java */ + /** + * @return the corresponding LL Pose3d (MEGATAG1) for the alliance in DriverStation.java + */ public Pose3d getMegaTag1_Pose3d() { if (!isAttached()) { return new Pose3d(); @@ -184,7 +190,9 @@ public Pose3d getMegaTag1_Pose3d() { return pose3d; } - /** @return the corresponding LL Pose3d (MEGATAG2) for the alliance in DriverStation.java */ + /** + * @return the corresponding LL Pose3d (MEGATAG2) for the alliance in DriverStation.java + */ public Pose2d getMegaTag2_Pose2d() { if (!isAttached()) { return new Pose2d(); @@ -229,7 +237,9 @@ public boolean hasAccuratePose() { return multipleTagsInView() && getTargetSize() > 0.1; } - /** @return the distance of the 2d vector from the camera to closest apriltag */ + /** + * @return the distance of the 2d vector from the camera to closest apriltag + */ public double getDistanceToTagFromCamera() { if (!isAttached()) { return 0; @@ -316,13 +326,17 @@ public void sendInvalidStatus(String message) { * Utility Wrappers */ - /** @return The latest LL results as a LimelightResults object. */ + /** + * @return The latest LL results as a LimelightResults object. + */ @SuppressWarnings("unused") private LimelightResults retrieveJSON() { return LimelightHelpers.getLatestResults(config.name); } - /** @param pipelineIndex use pipeline indexes in {@link VisionConfig} */ + /** + * @param pipelineIndex use pipeline indexes in {@link VisionConfig} + */ public void setLimelightPipeline(int pipelineIndex) { if (!isAttached()) { return;