Skip to content

Commit de4305b

Browse files
Merge branch 'develop' into main
2 parents 7d59638 + 518a878 commit de4305b

116 files changed

Lines changed: 697 additions & 11408 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/pull_request_template.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
## Pull Request Summary
22

3+
Closes #xxx
4+
35
<!-- Enter a brief description/summary of your PR here. What does it add, and why is it necessary? Does this new feature solve any problems or bugs? How was it tested — automated or manual software tests, physical hardware tests, or some other method or combination of testing techniques? -->
46

57
## PR Checklist
68

7-
- [ ] Closes #xxx
89
- [ ] Tests pass
910
- [ ] Any related documentation has been updated, if necessary
1011

1112
## Detailed Description
1213

13-
<!-- Provide a more detailed description and any additional information. -->
14+
<!-- Provide a more detailed description and any additional information. -->

.github/workflows/build-reusable.yml

Lines changed: 63 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,23 @@ jobs:
2222
run: chmod +x pi4micronaut-utils/gradlew
2323
- name: Setup Gradle
2424
uses: gradle/actions/setup-gradle@v4
25+
with:
26+
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop' }}
27+
- name: Bump version (nebula final)
28+
if: github.ref == 'refs/heads/main'
29+
working-directory: .
30+
run: ./gradlew final
2531
- name: Execute Gradle build with info logging
2632
working-directory: pi4micronaut-utils
2733
run: ./gradlew build --info
2834
- name: Execute Gradle shadowJar
2935
working-directory: pi4micronaut-utils
3036
run: ./gradlew shadowJar
37+
- name: Upload built JAR as artifact
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: micronaut-jar
41+
path: pi4micronaut-utils/build/libs/pi4micronaut-utils-*-all.jar
3142

3243
publish-jar:
3344
runs-on: ubuntu-latest
@@ -39,17 +50,65 @@ jobs:
3950
with:
4051
java-version: '17'
4152
distribution: 'temurin'
42-
cache: 'gradle'
4353
- name: Change wrapper permissions
4454
run: chmod +x pi4micronaut-utils/gradlew
55+
- name: Setup Gradle
56+
uses: gradle/actions/setup-gradle@v4
57+
with:
58+
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop' }}
4559
- name: Publish Library
4660
working-directory: pi4micronaut-utils
4761
env:
48-
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
49-
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
62+
PORTAL_USERNAME: ${{ vars.PORTAL_USERNAME }}
63+
PORTAL_PASSWORD: ${{ secrets.PORTAL_PASSWORD }}
5064
GPG_KEY: ${{ secrets.GPG_KEY }}
5165
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
5266
run: ./gradlew clean publish --info
67+
- name: POST to Maven
68+
uses: fjogeleit/http-request-action@v1
69+
with:
70+
url: 'https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/io.github.oss-slu'
71+
method: 'POST'
5372
- uses: actions/attest-build-provenance@v1
5473
with:
55-
subject-path: 'pi4micronaut-utils/build/libs/**/*.jar'
74+
subject-path: 'pi4micronaut-utils/build/libs/**/*.jar'
75+
create-release:
76+
runs-on: ubuntu-latest
77+
needs: [build-library, publish-jar]
78+
defaults:
79+
run:
80+
working-directory: pi4micronaut-utils
81+
env:
82+
GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
83+
steps:
84+
- uses: actions/checkout@v4
85+
with:
86+
fetch-depth: 0
87+
- name: Set up JDK 17
88+
uses: actions/setup-java@v4
89+
with:
90+
java-version: '17'
91+
distribution: 'adopt'
92+
- name: Change wrapper permissions
93+
run: chmod +x pi4micronaut-utils/gradlew
94+
- name: Setup Gradle
95+
uses: gradle/actions/setup-gradle@v4
96+
with:
97+
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop' }}
98+
- name: Read library version
99+
id: read_version
100+
working-directory: .
101+
run: |
102+
VERSION=$(./gradlew properties | grep "^version:" | awk '{print $2}')
103+
echo "version=$VERSION" >> $GITHUB_OUTPUT
104+
- name: Download built JAR
105+
uses: actions/download-artifact@v4
106+
with:
107+
name: micronaut-jar
108+
path: pi4micronaut-utils/build/libs
109+
- name: Create GitHub Release
110+
run: |
111+
gh release create "${{ steps.read_version.outputs.version }}" \
112+
--verify-tag \
113+
--generate-notes \
114+
"pi4micronaut-utils/build/libs/pi4micronaut-utils-${{ steps.read_version.outputs.version }}-all.jar"

.github/workflows/github-actions.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,16 @@ jobs:
2020
steps:
2121
- uses: actions/checkout@v3
2222
- name: Set up JDK 17
23-
uses: actions/setup-java@v3
23+
uses: actions/setup-java@v4
2424
with:
2525
java-version: '17'
2626
distribution: 'adopt'
2727
- name: Change wrapper permissions
2828
run: chmod +x pi4micronaut-utils/gradlew
2929
- name: Setup Gradle
30-
uses: gradle/gradle-build-action@v2
30+
uses: gradle/actions/setup-gradle@v4
3131
with:
32-
arguments: build
33-
build-root-directory: pi4micronaut-utils/
32+
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop' }}
3433
- name: Execute Gradle build
3534
working-directory: pi4micronaut-utils
3635
run: ./gradlew build
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Deploy Javadocs to GitHub Pages
2+
permissions:
3+
contents: write
4+
pages: write
5+
id-token: write
6+
on:
7+
push:
8+
branches:
9+
- main
10+
- develop
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
- name: Set up JDK 17
19+
uses: actions/setup-java@v4
20+
with:
21+
java-version: '17'
22+
distribution: 'adopt'
23+
- name: Change wrapper permissions
24+
run: chmod +x pi4micronaut-utils/gradlew
25+
- name: Setup Gradle
26+
uses: gradle/actions/setup-gradle@v4
27+
with:
28+
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop' }}
29+
- name: Generate Javadocs
30+
working-directory: pi4micronaut-utils
31+
run: ./gradlew javadoc
32+
- name: Upload javadoc artifact
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: javadoc
36+
path: pi4micronaut-utils/build/docs/javadoc
37+
deploy:
38+
runs-on: ubuntu-latest
39+
needs: build
40+
steps:
41+
- name: Download javadoc artifact
42+
uses: actions/download-artifact@v4
43+
with:
44+
name: javadoc
45+
path: ./javadoc
46+
retention-days: 1
47+
- name: Deploy
48+
uses: peaceiris/actions-gh-pages@v4
49+
if: github.ref == 'refs/heads/develop'
50+
with:
51+
github_token: ${{ secrets.GITHUB_TOKEN }}
52+
publish_dir: ./javadoc
53+
destination_dir: javadoc
54+
keep_files: true
55+
user_name: 'github-actions[bot]'
56+
user_email: 'github-actions[bot]@users.noreply.github.com'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ out/
1717
*@*
1818
Workflow_Diagram.png
1919
Pi4Micronaut_logo.png
20+
javadoc/

CITATION.cff

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
title: Pi4Micronaut
2+
authors:
3+
- given-names: Ruthvik
4+
family-names: Mannem
5+
- given-names: Sinuo
6+
family-names: Liu
7+
- given-names: Traison
8+
family-names: Diedrich
9+
- given-names: Austin
10+
family-names: Howard
11+
- given-names: Greih
12+
family-names: Murray
13+
- given-names: John
14+
family-names: Yanev
15+
- given-names: Joe
16+
family-names: Folen
17+
- given-names: Alex
18+
family-names: Delgado
19+
- given-names: Adrian
20+
family-names: Swindle
21+
- given-names: Yenkatarajalaxmimanohar
22+
family-names: Meda
23+
- given-names: Thomas
24+
family-names: Macas
25+
- given-names: Seyun
26+
family-names: Jeong
27+
- given-names: Ralph
28+
family-names: Tan
29+
- given-names: Ava
30+
family-names: Enke
31+
- given-names: Leandru
32+
family-names: Martin
33+
- given-names: Joey Heitzler
34+
- given-names: Thomas
35+
family-names: Pautler
36+
cff-version: 1.2.0
37+
message: If you use this software, please cite it using the metadata from this file.
38+
type: software
39+
abstract: " A Java library combining Micronaut and Pi4j to streamline hardware
40+
connectivity to Raspberry Pis"
41+
keywords:
42+
- Raspberry Pi
43+
- Java
44+
- Pi4J
45+
- Micronaut
46+
license: Apache-2.0
47+
repository-code: https://github.com/oss-slu/Pi4Micronaut
48+
date-released: 2024-05-10
49+
version: "1.1"

CONTRIBUTING.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@
66

77
* Before making contributions, understand the purpose and functionality of the Pi4Micronaut library.
88

9-
* Review the library documentation, any related articles, or tutorials.
10-
11-
Our documentation can be found online at [oss-slu.github.io/Pi4Micronaut](https://oss-slu.github.io/Pi4Micronaut/). Good information and tutorials on Raspberry Pis and electronic components can be found online from [Sunfounder](https://docs.sunfounder.com/en/latest/), [SparkFun](https://learn.sparkfun.com/), or others.
12-
13-
This file will go over some quick information about our library, but please refer to our documentation webpage for more complete information.
9+
* Review the library documentation, any related articles, or tutorials.
10+
* Our documentation can be found online at [oss-slu.github.io/Pi4Micronaut](https://oss-slu.github.io/Pi4Micronaut/). Good information and tutorials on Raspberry Pis and electronic components can be found online from [Sunfounder](https://docs.sunfounder.com/en/latest/), [SparkFun](https://learn.sparkfun.com/), or others.
11+
* This file will go over some quick information about our library, but please refer to our documentation webpage for more complete information.
1412

1513
### Set Up Your Development Environment
1614

@@ -62,6 +60,8 @@ This file will go over some quick information about our library, but please refe
6260

6361
* Note: A test suite will be developed in future to test the components without the use of external hardware
6462

63+
* To run tests, use the command `./gradlew test`
64+
6565
### Signing the Contributor License Agreement
6666

6767
* While creating a pull request, you’ll be prompted to sign a Contributor License Agreement. Please do so by logging in with your GitHub account.
@@ -96,6 +96,13 @@ This file will go over some quick information about our library, but please refe
9696

9797
Thanks for considering a contribution to the Pi4Micronaut library! Your involvement helps make the project better for everyone.
9898

99+
## Commands and Gradle Tasks
100+
101+
Here are some useful commands and Gradle tasks for working with the Pi4Micronaut library:
102+
* **Build the Project:** `./gradlew build` - Compiles the code and builds the project.
103+
* **Run Tests:** `./gradlew test` - Executes the test suite.
104+
* **Compile AsciiDoc Documentation:** `./gradlew asciidoctor` - Generates the documentation from AsciiDoc files. The output can be found in `pi4micronaut-utils/build/docs/asciidoc`.
105+
99106
## How to Create a New Component
100107

101108
If it's compatible with a Raspberry Pi, then it should work well with Pi4Micronaut. The following steps should encompass in brief how most components are added to the library; further details can be found on our documentation webpage. Start by creating a new issue to suggest changes.
@@ -122,7 +129,7 @@ All controllers should be kept here: `components/src/main/java/com/opensourcewit
122129

123130
### Thoroughly test
124131

125-
Contributors should thoroughly test their integrations. Software unit tests should be written in `pi4micronaut-utils/src/test/java/com/opensourcewithslu/(inputdevices or outputdevices)`.
132+
Contributors should thoroughly test their integrations. Software unit tests should be written in `pi4micronaut-utils/src/test/java/com/opensourcewithslu/(inputdevices or outputdevices)`. They can be run with `./gradlew test`.
126133

127134
Hardware testing should also be done. When submitting a pull request, make sure to include how you tested the component, any circuits that you may have used, and how to run any examples you may have created. Instructions for how to conduct hardware testing, including how to send the files over to the Raspberry Pi device, are on our online documentation.
128135

@@ -133,3 +140,6 @@ It is important that reviewers are able to replicate your work in order to prope
133140
We write documentation files for each component, which are compiled and hosted on our online documentation webpage. Create an .adoc file with the component name as the file name. Make sure to include all the information that the other components include. Simply copy/paste an existing component's documentation and edit as needed. Add the file here: `pi4micronaut-utils/src/docs/asciidoc/components/(inputComponents or outputComponents)`.
134141

135142
Also ensure that the classes you have written have appropriate Javadoc comments.
143+
144+
### Workflow Diagram
145+
![Workflow_Diagram.png](Workflow_Diagram.png)

README.md

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
![Pi4Micronaut-Header](Pi4Micronaut_logo.png)
22

3+
[![Java CI](https://github.com/oss-slu/Pi4Micronaut/actions/workflows/github-actions.yml/badge.svg)](https://github.com/oss-slu/Pi4Micronaut/actions/workflows/github-actions.yml)
4+
[![Maven Central Version](https://img.shields.io/maven-central/v/io.github.oss-slu/pi4micronaut-utils?logo=sonatype&logoColor=%23F18900&labelColor=%231B1C30&color=%23F18900)](https://central.sonatype.com/artifact/io.github.oss-slu/pi4micronaut-utils)
5+
![GitHub License](https://img.shields.io/github/license/oss-slu/Pi4Micronaut)
6+
[![Documentation](https://img.shields.io/badge/Documentation-8D021F)](https://oss-slu.github.io/Pi4Micronaut/)
7+
8+
9+
[![Chat on Slack](https://img.shields.io/badge/Chat_on-Slack-4A154B?logo=slack)](https://join.slack.com/t/oswslu/shared_invite/zt-24f0qhjbo-NkSfQ4LOg5wXxBdxP4vzfA)
10+
[![Donate to OSS](https://img.shields.io/badge/Donate_to-OSS-003AA6)](https://oss-slu.github.io/connect_with/donate)
11+
[![Unity Foundation](https://img.shields.io/badge/Unity_Foundation-unityfoundation.io-blue)](https://unityfoundation.io)
12+
313
## Overview
414

515
Pi4Micronaut is an innovative Java library crafted for developers who aim to build Internet of Things (IoT) applications leveraging the Raspberry Pi platform. This software is designed to run directly on the Raspberry Pi, providing an interface between the high-level Micronaut framework and the low-level hardware control provided by Pi4J. It serves as a vital tool for Java developers who wish to create sophisticated IoT solutions that interact with various sensors and electronic components. By abstracting the complexity of hardware interactions, Pi4Micronaut allows developers to focus on crafting business logic and features, making it easier to bring IoT applications from concept to deployment rapidly.
616

717
The existence of Pi4Micronaut is justified by the need for a robust, scalable, and efficient way to bridge the gap between enterprise-grade software and the physical world of hardware. It is particularly valuable for projects that demand both the high-performance, microservices-oriented capabilities of the Micronaut framework and the versatile hardware interaction that the Raspberry Pi offers. Whether it's for home automation, industrial monitoring, or educational purposes, Pi4Micronaut empowers developers to deliver reliable and sophisticated IoT applications that can run headless on a Raspberry Pi or be managed remotely, providing convenience, control, and customization to the end-users.
818

9-
**Note:** Pi4Micronaut doesn't work with the latest Raspberry Pi 5 because of its whole new architecture. Pi4J and pigpio libraries doesn't provide support for Pi 5 yet. Look out for the latest version of Pi4J to work with Pi5's in the future.
19+
**Note:** Pi4Micronaut doesn't work with the latest Raspberry Pi 5 because of its whole new architecture. The Pi4J and pigpio libraries doesn't provide support for Pi 5 yet. Look out for the latest version of Pi4J to work with Pi 5 in the future.
1020

1121
### Information
1222

@@ -16,29 +26,29 @@ The existence of Pi4Micronaut is justified by the need for a robust, scalable, a
1626
- **Developers:**
1727
- [Joey Heitzler](https://github.com/j-heitz) (capstone)
1828
- [Thomas Pautler](https://github.com/ThomasPautler952194) (capstone)
19-
- [Yenkatarajalaxmimanohar Meda](https://github.com/yrlmanoharreddy) (alumni, prior tech lead)
20-
- [Ava Enke](https://github.com/avaenk) (alumni)
21-
- [Seyun Jeong](https://github.com/Ed0827) (alumni)
22-
- [Ralph Tan](https://github.com/RalphTan37) (alumni)
23-
- [Thomas Macas](https://github.com/tmacas) (alumni)
24-
- [Leandru Martin](https://github.com/leandrumartin) (alumni)
25-
- [Ruthvik Mannem](https://github.com/ruthvikm) (alumni, prior tech lead)
26-
- [Adrian Swindle](https://github.com/SwindleA) (alumni)
27-
- [Alex Delgado](https://github.com/adelgadoj3) (alumni)
28-
- [Joe Folen](https://github.com/joefol) (alumni)
29-
- [John Yanev](https://github.com/jyanev) (alumni)
30-
- [Greih Murray](https://github.com/GreihMurray) (alumni)
31-
- [Austin Howard](https://github.com/austinjhoward) (alumni)
32-
- [Traison Diedrich](https://github.com/traison-diedrich) (alumni)
33-
- [Sinuo Liu](https://github.com/liusinuo2000) (alumni)
29+
- [Yenkatarajalaxmimanohar Meda](https://github.com/yrlmanoharreddy) (alum, prior tech lead)
30+
- [Ava Enke](https://github.com/avaenk) (alum)
31+
- [Seyun Jeong](https://github.com/Ed0827) (alum)
32+
- [Ralph Tan](https://github.com/RalphTan37) (alum)
33+
- [Thomas Macas](https://github.com/tmacas) (alum)
34+
- [Leandru Martin](https://github.com/leandrumartin) (alum)
35+
- [Ruthvik Mannem](https://github.com/ruthvikm) (alum, prior tech lead)
36+
- [Adrian Swindle](https://github.com/SwindleA) (alum)
37+
- [Alex Delgado](https://github.com/adelgadoj3) (alum)
38+
- [Joe Folen](https://github.com/joefol) (alum)
39+
- [John Yanev](https://github.com/jyanev) (alum)
40+
- [Greih Murray](https://github.com/GreihMurray) (alum)
41+
- [Austin Howard](https://github.com/austinjhoward) (alum)
42+
- [Traison Diedrich](https://github.com/traison-diedrich) (alum)
43+
- [Sinuo Liu](https://github.com/liusinuo2000) (alum)
3444

3545
- **Start Date:** August 2022
3646
- **Adoption Date:** August 2022
3747
- **Technologies Used:**
3848
- Java
3949
- Micronaut Framework with Gradle
4050
- Pi4J Library
41-
- **Type:** IOT (Raspberry Pi)
51+
- **Type:** IoT (Raspberry Pi)
4252
- **License:** [Apache License 2.0](https://opensource.org/license/apache-2-0/)
4353

4454

@@ -49,20 +59,20 @@ The existence of Pi4Micronaut is justified by the need for a robust, scalable, a
4959
- [Maven Artifacts](https://repo1.maven.org/maven2/io/github/oss-slu/pi4micronaut-utils/)
5060

5161
### Architecture Diagram
52-
![Pi4Micronaut.png](Workflow_Diagram.png)
62+
![System_Design_Diagram.png](System_Design_Diagram.png)
5363

5464
## Example Projects using Pi4Micronaut Library
55-
- [Home Automation](https://github.com/oss-slu/Pi4Micronaut/tree/Home_Automation)
56-
- [Lab Automation](https://github.com/oss-slu/Pi4Micronaut/tree/Lab_Automation)
65+
- [Home Automation](https://github.com/oss-slu/home_automation_rpi)
66+
- [Lab Automation](https://github.com/oss-slu/lab_automation_rpi)
5767
- [OSS SLU Checkin](https://github.com/oss-slu/SLU_OSS_CheckIn)
5868

59-
## Micronaut 3.7.3
60-
- [Micronaut 3.7.3 User Guide](https://micronaut-projects.github.io/micronaut-docs-mn3/3.7.3/guide/index.html)
69+
## Micronaut 4.7.6
70+
- [Micronaut 4.7.6 User Guide](https://micronaut-projects.github.io/micronaut-docs-mn4/4.7.6/guide/)
6171
- [Micronaut Guides](https://docs.micronaut.io/latest/guide/index.html)
6272
- [Micronaut HTTP Client documentation](https://docs.micronaut.io/latest/guide/index.html#httpClient)
6373

6474
## Pi4J 2.4.0
65-
- [Pi4j Documenttion](https://pi4j.com/documentation/)
75+
- [Pi4j Documentation](https://pi4j.com/documentation/)
6676

6777
## Shadow Gradle 7.1.2
6878
- [Shadow Gradle Plugin](https://plugins.gradle.org/plugin/com.github.johnrengelman.shadow)

System_Design_Diagram.png

191 KB
Loading

0 commit comments

Comments
 (0)