From a0ba969c7b8c6fcf5b2d2fc3a224218ae309ace5 Mon Sep 17 00:00:00 2001 From: Justin Kleiber Date: Wed, 21 Aug 2024 00:19:56 -0400 Subject: [PATCH] Removes unnecessary AdvantageKit dependency, updates CI and gitignore --- .github/workflows/ci.yml | 77 ++++++------------- .gitignore | 9 ++- wpi_interface/build.gradle | 17 ---- .../main/java/frc/robot/BuildConstants.java | 17 ---- wpi_interface/vendordeps/AdvantageKit.json | 42 ---------- 5 files changed, 28 insertions(+), 134 deletions(-) delete mode 100644 wpi_interface/src/main/java/frc/robot/BuildConstants.java delete mode 100644 wpi_interface/vendordeps/AdvantageKit.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9a3ffeb..8f93711 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,12 +11,6 @@ jobs: - container: wpilib/roborio-cross-ubuntu:2024-22.04 artifact-name: Athena build-options: "-Ponlylinuxathena" - # - container: wpilib/raspbian-cross-ubuntu:bullseye-22.04 - # artifact-name: Arm32 - # build-options: "-Ponlylinuxarm32" - # - container: wpilib/aarch64-cross-ubuntu:bullseye-22.04 - # artifact-name: Arm64 - # build-options: "-Ponlylinuxarm64" - container: wpilib/ubuntu-base:22.04 artifact-name: Linux build-options: "" @@ -25,12 +19,10 @@ jobs: container: ${{ matrix.container }} steps: - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: - submodules: true - fetch-depth: 0 - - name: Fetch all history and metadata - run: | - git config --global --add safe.directory /__w/${{ github.event.repository.name }}/${{ github.event.repository.name }} + java-version: '17' + distribution: 'temurin' - name: Build with Gradle run: ./gradlew build --max-workers 1 ${{ matrix.build-options }} - uses: actions/upload-artifact@v3 @@ -45,66 +37,41 @@ jobs: fail-fast: false matrix: include: - - os: windows-2022 + - os: windows-latest artifact-name: Win64 architecture: x64 - os: macos-12 artifact-name: macOS architecture: x64 + - os: ubuntu-latest + artifact-name: ubuntu + architecture: x64 name: "Build - ${{ matrix.artifact-name }}" runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 with: submodules: true + - name: Fetch all history and metadata run: git fetch --prune --unshallow - - uses: actions/setup-java@v3 + + - uses: actions/setup-java@v4 with: - distribution: 'zulu' - java-version: 17 + java-version: '17' + distribution: 'temurin' architecture: ${{ matrix.architecture }} + - name: Build with Gradle run: ./gradlew build -Pbuildalldesktop - - uses: actions/upload-artifact@v3 - with: - name: ${{ matrix.artifact-name }} - path: build/allOutputs - combine: - name: Combine - needs: [build-docker, build-host] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - repository: wpilibsuite/build-tools - - uses: actions/download-artifact@v3 - with: - path: combiner/products/build/allOutputs - - name: Flatten Artifacts - run: rsync -a --delete combiner/products/build/allOutputs/*/* combiner/products/build/allOutputs/ - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 17 - - name: Combine - # if: | - # !startsWith(github.ref, 'refs/tags/v') - run: ./gradlew publish -Pthirdparty - working-directory: combiner - # - name: Combine (Release) - # if: | - # github.repository_owner == 'wpilibsuite' && - # startsWith(github.ref, 'refs/tags/v') - # run: | - # ./gradlew publish -Pthirdparty - # working-directory: combiner - # env: - # RUN_AZURE_ARTIFACTORY_RELEASE: 'TRUE' - # ARTIFACTORY_PUBLISH_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} - # ARTIFACTORY_PUBLISH_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} - - uses: actions/upload-artifact@v3 + - name: Update Maven Snapshots + run: mvn --batch-mode --update-snapshots verify + + - name: Create Staging Area + run: mkdir staging && cp target/*.jar staging + + - uses: actions/upload-artifact@v4 with: - name: Maven - path: ~/releases + name: Package + path: staging diff --git a/.gitignore b/.gitignore index 8576f18..2c62aa2 100644 --- a/.gitignore +++ b/.gitignore @@ -158,6 +158,9 @@ bin/ # End of https://www.gitignore.io/api/c++,java,linux,macos,gradle,windows,visualstudiocode - -# Ignore Gradle build output directory -build + +# Ignore Gradle build output directory +build + +# Ignore auto-generated WPILib stuff. +wpi_interface/src/main/java/frc/robot/BuildConstants.java diff --git a/wpi_interface/build.gradle b/wpi_interface/build.gradle index f64c699..d918ff9 100644 --- a/wpi_interface/build.gradle +++ b/wpi_interface/build.gradle @@ -67,10 +67,6 @@ def includeDesktopSupport = true // Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries. // Also defines JUnit 5. dependencies { - // ... - def akitJson = new groovy.json.JsonSlurper().parseText(new File(projectDir.getAbsolutePath() + "/vendordeps/AdvantageKit.json").text) - annotationProcessor "org.littletonrobotics.akit.junction:junction-autolog:$akitJson.version" - implementation wpi.java.deps.wpilib() implementation wpi.java.vendor.java() @@ -115,13 +111,6 @@ indent = " " } repositories { - maven { - url = uri("https://maven.pkg.github.com/Mechanical-Advantage/AdvantageKit") - credentials { - username = "Mechanical-Advantage-Bot" - password = "\u0067\u0068\u0070\u005f\u006e\u0056\u0051\u006a\u0055\u004f\u004c\u0061\u0079\u0066\u006e\u0078\u006e\u0037\u0051\u0049\u0054\u0042\u0032\u004c\u004a\u006d\u0055\u0070\u0073\u0031\u006d\u0037\u004c\u005a\u0030\u0076\u0062\u0070\u0063\u0051" - } - } mavenCentral() mavenLocal() } @@ -157,12 +146,6 @@ configurations.all { exclude group: "edu.wpi.first.wpilibj" } -task(checkAkitInstall, dependsOn: "classes", type: JavaExec) { - mainClass = "org.littletonrobotics.junction.CheckInstall" - classpath = sourceSets.main.runtimeClasspath -} -compileJava.finalizedBy checkAkitInstall - task (commitOnDeploy, dependsOn: "spotlessApply") { description = 'Commits when deployed.' doLast { diff --git a/wpi_interface/src/main/java/frc/robot/BuildConstants.java b/wpi_interface/src/main/java/frc/robot/BuildConstants.java deleted file mode 100644 index 93b3a5d..0000000 --- a/wpi_interface/src/main/java/frc/robot/BuildConstants.java +++ /dev/null @@ -1,17 +0,0 @@ -package frc.robot; - -/** Automatically generated file containing build version information. */ -public final class BuildConstants { - public static final String MAVEN_GROUP = "com.github.team401"; - public static final String MAVEN_NAME = "wpi_interface"; - public static final String VERSION = "0.0"; - public static final int GIT_REVISION = 14; - public static final String GIT_SHA = "18aeea1d8ec130e803b61501a67f53881c126435"; - public static final String GIT_DATE = "2024-08-19 19:21:49 EDT"; - public static final String GIT_BRANCH = "9-enable-publishing"; - public static final String BUILD_DATE = "2024-08-20 21:08:15 EDT"; - public static final long BUILD_UNIX_TIME = 1724202495398L; - public static final int DIRTY = 1; - - private BuildConstants() {} -} diff --git a/wpi_interface/vendordeps/AdvantageKit.json b/wpi_interface/vendordeps/AdvantageKit.json deleted file mode 100644 index d4bf7dd..0000000 --- a/wpi_interface/vendordeps/AdvantageKit.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "fileName": "AdvantageKit.json", - "name": "AdvantageKit", - "version": "3.2.0", - "uuid": "d820cc26-74e3-11ec-90d6-0242ac120003", - "frcYear": "2024", - "mavenUrls": [], - "jsonUrl": "https://github.com/Mechanical-Advantage/AdvantageKit/releases/latest/download/AdvantageKit.json", - "javaDependencies": [ - { - "groupId": "org.littletonrobotics.akit.junction", - "artifactId": "wpilib-shim", - "version": "3.2.0" - }, - { - "groupId": "org.littletonrobotics.akit.junction", - "artifactId": "junction-core", - "version": "3.2.0" - }, - { - "groupId": "org.littletonrobotics.akit.conduit", - "artifactId": "conduit-api", - "version": "3.2.0" - } - ], - "jniDependencies": [ - { - "groupId": "org.littletonrobotics.akit.conduit", - "artifactId": "conduit-wpilibio", - "version": "3.2.0", - "skipInvalidPlatforms": false, - "isJar": false, - "validPlatforms": [ - "linuxathena", - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ] - } - ], - "cppDependencies": [] -} \ No newline at end of file