generated from wpilibsuite/vendor-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
138 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
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" | ||
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
} | ||
|
||
// Set this to true to enable desktop support. | ||
def includeDesktopSupport = true | ||
|
||
// Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries. | ||
// Also defines JUnit 5. | ||
dependencies { | ||
implementation 'edu.wpi.first.wpilibj:wpilibj-java:2024.3.2' | ||
implementation 'edu.wpi.first.wpilibNewCommands:wpilibNewCommands-java:2024.3.2' | ||
|
||
implementation wpi.java.deps.wpilib() | ||
implementation wpi.java.vendor.java() | ||
|
||
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 { | ||
useJUnitPlatform() | ||
systemProperty 'junit.jupiter.extensions.autodetection.enabled', 'true' | ||
} | ||
|
||
// Configure string concat to always inline compile | ||
tasks.withType(JavaCompile) { | ||
options.compilerArgs.add '-XDstringConcat=inline' | ||
} | ||
|
||
project.compileJava.dependsOn(createVersionFile) | ||
gversion { | ||
srcDir = "src/main/java/" | ||
classPackage = "frc.robot" | ||
className = "BuildConstants" | ||
dateFormat = "yyyy-MM-dd HH:mm:ss z" | ||
timeZone = "America/New_York" | ||
indent = " " | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
mavenLocal() | ||
maven { | ||
url 'https://frcmaven.wpi.edu/artifactory/release/' | ||
} | ||
gradlePluginPortal() | ||
} | ||
|
||
spotless { | ||
// optional: limit format enforcement to just the files changed by this feature branch | ||
ratchetFrom 'origin/main' | ||
|
||
format 'misc', { | ||
// define the files to apply `misc` to | ||
target '*.gradle', '.gitattributes', '.gitignore' | ||
|
||
// define the steps to apply to those files | ||
trimTrailingWhitespace() | ||
indentWithTabs() // or spaces. Takes an integer argument if you don't like 4 | ||
endWithNewline() | ||
} | ||
java { | ||
// don't need to set target, it is inferred from java | ||
// Allow ignoring certain parts in formatting. | ||
toggleOffOn() | ||
// apply a specific flavor of google-java-format | ||
googleJavaFormat('1.19.2').aosp().reflowLongStrings() | ||
// fix formatting of type annotations | ||
formatAnnotations() | ||
} | ||
} | ||
|
||
// Automatically format code on build. | ||
compileJava.dependsOn 'spotlessApply' |
2 changes: 1 addition & 1 deletion
2
...ce/src/main/java/vision/CameraParams.java → vision/src/main/java/CameraParams.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...e/src/main/java/vision/CameraWrapper.java → vision/src/main/java/CameraWrapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...c/main/java/vision/VisionMeasurement.java → vision/src/main/java/VisionMeasurement.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
package coppercore.wpilib_interface.vision; | ||
package coppercore.vision; | ||
|
||
import edu.wpi.first.math.Matrix; | ||
import edu.wpi.first.math.geometry.Pose2d; | ||
import edu.wpi.first.math.numbers.N1; | ||
import edu.wpi.first.math.numbers.N3; | ||
|
||
/** | ||
* A vision measurement so that the consumer can be typed as a Consumer<VisionMeasurement> | ||
* This is only necessary because java has no class for a consumer with 3 arguments. | ||
* A vision measurement so that the consumer can be typed as a Consumer<VisionMeasurement> This is | ||
* only necessary because java has no class for a consumer with 3 arguments. | ||
*/ | ||
public record VisionMeasurement(Pose2d pose, double timestamp, Matrix<N3, N1> stdDevs) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
] | ||
} | ||
] | ||
} |
File renamed without changes.