From 3bc4154df703386dbfcde311b4cd7cc7cd03d4ec Mon Sep 17 00:00:00 2001 From: Ruthvik Mannem <116761292+ruthvikm@users.noreply.github.com> Date: Mon, 26 Feb 2024 21:15:34 -0600 Subject: [PATCH] Adding Javadocs to build (#180) --- .../{build-adoc-javadoc.yml => asciidoc-build.yml} | 7 +++---- pi4micronaut-utils/build.gradle | 13 +++++++++++++ .../inputdevices/PhotoResistorHelper.java | 4 +++- .../outputdevices/ActiveBuzzerHelper.java | 4 +++- 4 files changed, 22 insertions(+), 6 deletions(-) rename .github/workflows/{build-adoc-javadoc.yml => asciidoc-build.yml} (81%) diff --git a/.github/workflows/build-adoc-javadoc.yml b/.github/workflows/asciidoc-build.yml similarity index 81% rename from .github/workflows/build-adoc-javadoc.yml rename to .github/workflows/asciidoc-build.yml index 48d2588a..c7a550d1 100644 --- a/.github/workflows/build-adoc-javadoc.yml +++ b/.github/workflows/asciidoc-build.yml @@ -1,4 +1,4 @@ -name: Build Adocs and Javadocs +name: build adocs on: push: @@ -9,7 +9,7 @@ on: jobs: adoc_build: runs-on: ubuntu-latest - name: Build Adocs and Javadocs + name: ASCII DOC build steps: - name: Checkout code uses: actions/checkout@v2 @@ -17,8 +17,7 @@ jobs: id: adocbuild uses: tonynv/asciidoctor-action@master with: - program: "./gradlew asciidoctor javadoc" - + program: "./gradlew asciidoctor" - name: Deploy docs to ghpages uses: peaceiris/actions-gh-pages@v3 with: diff --git a/pi4micronaut-utils/build.gradle b/pi4micronaut-utils/build.gradle index 076fdb80..01c0554f 100644 --- a/pi4micronaut-utils/build.gradle +++ b/pi4micronaut-utils/build.gradle @@ -35,6 +35,14 @@ java { targetCompatibility = JavaVersion.toVersion("17") } +tasks.named('build').configure { + dependsOn 'javadoc' + copy { + from tasks.javadoc.destinationDir + into "src/docs/javadoc" + } +} + asciidoctor { attributes 'stylesheet': "style.css" baseDirFollowsSourceDir() @@ -58,6 +66,11 @@ tasks.register('javadocJar', Jar) { from javadoc.destinationDir } +tasks.named('javadocJar').configure { + dependsOn 'javadoc' +} + + artifacts { archives sourcesJar, javadocJar } diff --git a/pi4micronaut-utils/src/main/java/com/opensourcewithslu/inputdevices/PhotoResistorHelper.java b/pi4micronaut-utils/src/main/java/com/opensourcewithslu/inputdevices/PhotoResistorHelper.java index 263eafa7..48e63e8d 100644 --- a/pi4micronaut-utils/src/main/java/com/opensourcewithslu/inputdevices/PhotoResistorHelper.java +++ b/pi4micronaut-utils/src/main/java/com/opensourcewithslu/inputdevices/PhotoResistorHelper.java @@ -42,7 +42,9 @@ public PhotoResistorHelper(DigitalInput sensorInput, DigitalOutput sensorOutput) photoResistorOutput.high(); this.isDark = photoResistorInput.isHigh(); } - + /** + * @return current darknessValue. + */ public int getDark() { return darknessValue; } diff --git a/pi4micronaut-utils/src/main/java/com/opensourcewithslu/outputdevices/ActiveBuzzerHelper.java b/pi4micronaut-utils/src/main/java/com/opensourcewithslu/outputdevices/ActiveBuzzerHelper.java index ddc3f03b..dec8349a 100644 --- a/pi4micronaut-utils/src/main/java/com/opensourcewithslu/outputdevices/ActiveBuzzerHelper.java +++ b/pi4micronaut-utils/src/main/java/com/opensourcewithslu/outputdevices/ActiveBuzzerHelper.java @@ -16,7 +16,9 @@ public class ActiveBuzzerHelper { private static final Logger log = LoggerFactory.getLogger(ActiveBuzzerHelper.class); private final Pwm activeBuzzer; - + /** + * To check if the buzzer is active or not + */ protected boolean actBuzzCheck;