From c7848593583d445dd56350e8253b83dc76bf9f31 Mon Sep 17 00:00:00 2001 From: Ruthie Date: Sat, 13 Dec 2025 17:21:11 -0600 Subject: [PATCH 1/3] Fix ExecStart command for battery tracking service --- batteryTracking.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/batteryTracking.service b/batteryTracking.service index 4af871b..d9c6193 100644 --- a/batteryTracking.service +++ b/batteryTracking.service @@ -3,7 +3,7 @@ Description=Service that runs Battery Tracking [Service] WorkingDirectory=/opt/batteryTracking -ExecStart=/usr/bin/java /opt/batteryTracking/BatteryTracking.jar +ExecStart=/usr/bin/java -jar /opt/batteryTracking/BatteryTracking.jar ExecStop=/bin/systemctl kill BatteryTracking Type=simple Restart=on-failure From c30d8f5ef2187d01869372f5aea478fb383bdc3b Mon Sep 17 00:00:00 2001 From: Ruthie Date: Sat, 13 Dec 2025 17:22:02 -0600 Subject: [PATCH 2/3] Fix byte comparison and remove unnecessary semicolons --- .../java/org/team5892/BatteryTracking/BatteryTracking.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/org/team5892/BatteryTracking/BatteryTracking.java b/src/main/java/org/team5892/BatteryTracking/BatteryTracking.java index b93c9e2..05f6aa8 100644 --- a/src/main/java/org/team5892/BatteryTracking/BatteryTracking.java +++ b/src/main/java/org/team5892/BatteryTracking/BatteryTracking.java @@ -637,7 +637,7 @@ private static ByteBuffer dumpCard() throws CardException, NoSuchAlgorithmExcept } System.out.printf("Took %d ns \n", System.nanoTime() - startTime); bytes.position(0); - if (!(bytes.get() == (byte) 0x03)) + if (bytes.get() != (byte) 0x03) return bytes; // If it doesn't have these proprietary bytes were done byte length = bytes.get(); if (length == (byte) 0xFF) { @@ -938,7 +938,6 @@ private static String parseData(ByteBuffer data) throws NDEFException { ByteBuffer payload = data.slice(); // get only the payload data, after the header payload.limit((int) length); // discard the rest of the card // actually decode - ; CharBuffer chars = CHARSET.decode(payload); return chars.toString(); } @@ -1112,7 +1111,6 @@ public void consumeError(String message, Exception e) { public void consumeError(String message) { System.out.printf("Battery Tracking Error: %s \n", message); (new RuntimeException(message)).printStackTrace(); - ; } /** From 50efe4d1667d985bdefd19c0ac6f2e0996622581 Mon Sep 17 00:00:00 2001 From: Ruthie Date: Mon, 22 Dec 2025 16:31:27 -0600 Subject: [PATCH 3/3] Fix formatting and spacing in build.yml --- .github/workflows/build.yml | 50 +++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 176f12c..474cefa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,7 +1,7 @@ # Workflow by Photon Vision: https://github.com/PhotonVision/photonvision/blob/main/.github/workflows/build.yml # Licensed under the GNU General Public License: https://www.gnu.org/licenses/ -# Copyright (C) Photon Vision. +# Copyright (C) Photon Vision. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,11 +20,11 @@ name: Build on: # Run on pushes to main and pushed tags, and on pull requests against main, but ignore the docs folder - push: + push: pull_request: -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} +concurrency: + group: ${{ github. workflow }}-${{ github.head_ref || github.ref }} cancel-in-progress: true env: @@ -38,15 +38,24 @@ jobs: # Checkout code. - name: Checkout code uses: actions/checkout@v4 - with: + with: fetch-depth: 0 - name: Fetch tags run: git fetch --tags --force - name: Install Java 17 uses: actions/setup-java@v4 with: - java-version: 17 + java-version: 17 distribution: temurin + - name: Cache Gradle + uses: actions/cache@v3 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- - name: Gradle Build run: ./gradlew compileJava @@ -54,7 +63,7 @@ jobs: needs: [build-gradle] strategy: - fail-fast: false + fail-fast: false matrix: include: - os: windows-latest @@ -67,12 +76,12 @@ jobs: arch-override: macx64 - os: macos-latest artifact-name: macOSArm - architecture: x64 - arch-override: macarm64 - - os: ubuntu-22.04 + architecture: x64 + arch-override: macarm64 + - os: ubuntu-22.04 artifact-name: Linux - architecture: x64 - arch-override: linuxx64 + architecture: x64 + arch-override: linuxx64 - os: ubuntu-22.04 artifact-name: LinuxArm64 architecture: x64 @@ -81,17 +90,26 @@ jobs: runs-on: ${{ matrix.os }} name: "Build JAR - ${{ matrix.artifact-name }}" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 with: - fetch-depth: 0 + fetch-depth: 0 - name: Install Java 17 uses: actions/setup-java@v4 with: java-version: 17 distribution: temurin architecture: ${{ matrix.architecture }} + - name: Cache Gradle + uses: actions/cache@v3 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*. gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- - run: ./gradlew build -PArchOverride=${{ matrix.arch-override }} - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v4 with: - name: jar-${{ matrix.artifact-name }} + name: jar-${{ matrix.artifact-name }} path: build/libs/BatteryTracking-${{ matrix.arch-override }}.jar