From aaef2ce6a081b5dd03e90b793a10969b762554cd Mon Sep 17 00:00:00 2001 From: aidnem <99768676+aidnem@users.noreply.github.com> Date: Tue, 20 Aug 2024 21:09:01 -0400 Subject: [PATCH] Fix build errors and enable publishing to build jar artifacts. --- build.gradle | 20 +++++++++ settings.gradle | 2 +- wpi_interface/build.gradle | 6 ++- .../src/main/java/ControllerJSONReader.java | 2 +- .../main/java/frc/robot/BuildConstants.java | 17 ++++++++ wpi_interface/vendordeps/AdvantageKit.json | 42 +++++++++++++++++++ .../vendordeps/WPILibNewCommands.json | 38 +++++++++++++++++ 7 files changed, 124 insertions(+), 3 deletions(-) create mode 100644 build.gradle create mode 100644 wpi_interface/src/main/java/frc/robot/BuildConstants.java create mode 100644 wpi_interface/vendordeps/AdvantageKit.json create mode 100644 wpi_interface/vendordeps/WPILibNewCommands.json diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..022f9ad --- /dev/null +++ b/build.gradle @@ -0,0 +1,20 @@ +allprojects { + version = '0.0' + group = 'com.github.team401' +} + +subprojects { + apply plugin: 'java' + apply plugin: 'maven-publish' + + publishing { + publications { + maven(MavenPublication) { + groupId project.group + artifactId project.name + version project.version + from components.java + } + } + } +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index e8d3b71..0d6bf5b 100644 --- a/settings.gradle +++ b/settings.gradle @@ -11,4 +11,4 @@ plugins { } rootProject.name = 'coppercore' -include('geometry, wpi_interface') +include('geometry', 'wpi_interface') diff --git a/wpi_interface/build.gradle b/wpi_interface/build.gradle index 7d94fb1..43c7405 100644 --- a/wpi_interface/build.gradle +++ b/wpi_interface/build.gradle @@ -2,6 +2,7 @@ import java.text.SimpleDateFormat plugins { id "java" + id "maven-publish" id "edu.wpi.first.GradleRIO" version "2024.3.2" id "com.peterabeles.gversion" version "1.10" id "com.diffplug.spotless" version "6.24.0" @@ -91,6 +92,8 @@ dependencies { testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1' testRuntimeOnly 'org.junit.platform:junit-platform-launcher' + + implementation 'com.googlecode.json-simple:json-simple:1.1.1' } test { @@ -140,6 +143,7 @@ repositories { 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() } @@ -199,4 +203,4 @@ task (commitOnDeploy, dependsOn: "spotlessApply") { } } -// compileJava.dependsOn commitOnDeploy \ No newline at end of file +// compileJava.dependsOn commitOnDeploy diff --git a/wpi_interface/src/main/java/ControllerJSONReader.java b/wpi_interface/src/main/java/ControllerJSONReader.java index 334717a..7be9b94 100644 --- a/wpi_interface/src/main/java/ControllerJSONReader.java +++ b/wpi_interface/src/main/java/ControllerJSONReader.java @@ -277,4 +277,4 @@ public static HashMap getPOVs() { return pov; } } -} \ No newline at end of file +} diff --git a/wpi_interface/src/main/java/frc/robot/BuildConstants.java b/wpi_interface/src/main/java/frc/robot/BuildConstants.java new file mode 100644 index 0000000..93b3a5d --- /dev/null +++ b/wpi_interface/src/main/java/frc/robot/BuildConstants.java @@ -0,0 +1,17 @@ +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 new file mode 100644 index 0000000..d4bf7dd --- /dev/null +++ b/wpi_interface/vendordeps/AdvantageKit.json @@ -0,0 +1,42 @@ +{ + "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 diff --git a/wpi_interface/vendordeps/WPILibNewCommands.json b/wpi_interface/vendordeps/WPILibNewCommands.json new file mode 100644 index 0000000..4143e09 --- /dev/null +++ b/wpi_interface/vendordeps/WPILibNewCommands.json @@ -0,0 +1,38 @@ +{ + "fileName": "WPILibNewCommands.json", + "name": "WPILib-New-Commands", + "version": "1.0.0", + "uuid": "111e20f7-815e-48f8-9dd6-e675ce75b266", + "frcYear": "2024", + "mavenUrls": [], + "jsonUrl": "", + "javaDependencies": [ + { + "groupId": "edu.wpi.first.wpilibNewCommands", + "artifactId": "wpilibNewCommands-java", + "version": "wpilib" + } + ], + "jniDependencies": [], + "cppDependencies": [ + { + "groupId": "edu.wpi.first.wpilibNewCommands", + "artifactId": "wpilibNewCommands-cpp", + "version": "wpilib", + "libName": "wpilibNewCommands", + "headerClassifier": "headers", + "sourcesClassifier": "sources", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "linuxathena", + "linuxarm32", + "linuxarm64", + "windowsx86-64", + "windowsx86", + "linuxx86-64", + "osxuniversal" + ] + } + ] +} \ No newline at end of file