Skip to content

Commit

Permalink
Merge branch 'robototes:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
kirbt authored Jan 17, 2024
2 parents d12f7ff + e35ae11 commit 74915be
Show file tree
Hide file tree
Showing 13 changed files with 261 additions and 180 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
java-version: 17
cache: gradle

- name: Check
Expand Down
32 changes: 14 additions & 18 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# This gitignore has been specially created by the WPILib team.
# If you remove items from this file, intellisense might break.

.Glass

### C++ ###
# Prerequisites
*.d
Expand Down Expand Up @@ -106,13 +104,11 @@ Temporary Items
.apdisk

### VisualStudioCode ###
.factorypath
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.factorypath

### Windows ###
# Windows thumbnail cache files
Expand Down Expand Up @@ -162,21 +158,21 @@ gradle-app.setting
.settings/
bin/

# Simulation GUI and other tools window save file
*-window.json
simgui*.json
.wpilog
# IntelliJ
*.iml
*.ipr
*.iws
.idea/
out/

# Vim :)
Session.vim
.undodir
# Fleet
.fleet

# Intellij IDEA platform
.idea
local.properties
# Simulation GUI and other tools window save file
*-window.json

# WPILib datalog tool config files
.DataLogTool/
# Simulation data log directory
logs/

# Don't know what's creating this
.project
# Folder that has CTRE Phoenix Sim device config storage
ctre_sim/
21 changes: 21 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [

{
"type": "wpilib",
"name": "WPILib Desktop Debug",
"request": "launch",
"desktop": true,
},
{
"type": "wpilib",
"name": "WPILib roboRIO Debug",
"request": "launch",
"desktop": false,
}
]
}
28 changes: 27 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
{
"java.configuration.updateBuildConfiguration": "automatic"
"java.configuration.updateBuildConfiguration": "automatic",
"java.server.launchMode": "Standard",
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"bin/": true,
"**/.classpath": true,
"**/.project": true,
"**/.settings": true,
"**/.factorypath": true,
"**/*~": true
},
"java.test.config": [
{
"name": "WPIlibUnitTests",
"workingDirectory": "${workspaceFolder}/build/jni/release",
"vmargs": [ "-Djava.library.path=${workspaceFolder}/build/jni/release" ],
"env": {
"LD_LIBRARY_PATH": "${workspaceFolder}/build/jni/release" ,
"DYLD_LIBRARY_PATH": "${workspaceFolder}/build/jni/release"
}
},
],
"java.test.defaultConfig": "WPIlibUnitTests"
}
10 changes: 5 additions & 5 deletions .wpilib/wpilib_preferences.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"enableCppIntellisense": false,
"currentLanguage": "java",
"projectYear": "2024",
"teamNumber": 2412
}
"enableCppIntellisense": false,
"currentLanguage": "java",
"projectYear": "2024",
"teamNumber": 2412
}
18 changes: 9 additions & 9 deletions WPILib-License.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
Copyright (c) 2009-2021 FIRST and other WPILib contributors
Copyright (c) 2009-2023 FIRST and other WPILib contributors
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of FIRST, WPILib, nor the names of other WPILib
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of FIRST, WPILib, nor the names of other WPILib
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY FIRST AND OTHER WPILIB CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
Expand Down
45 changes: 29 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
plugins {
id "java"
id "com.diffplug.spotless" version "6.15.0"
id "edu.wpi.first.GradleRIO" version "2023.4.3"
id "net.ltgt.errorprone"
id "edu.wpi.first.GradleRIO" version "2024.1.1"
id "net.ltgt.errorprone" version "3.1.0"
}

repositories {
mavenCentral()
maven { url "https://jitpack.io" }
}

sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

def getProjectBooleanProperty(String name, boolean defaultValue = false) {
if (!project.hasProperty(name)) {
Expand All @@ -28,7 +30,7 @@ def ROBOT_MAIN_CLASS = getProjectBooleanProperty('automatedTest') ? "frc.team241
// This is added by GradleRIO's backing project DeployUtils.
deploy {
targets {
roborio(getTargetTypeClass("RoboRIO")) {
roborio(getTargetTypeClass('RoboRIO')) {
// Team number is loaded either from the .wpilib/wpilib_preferences.json
// or from command line. If not found an exception will be thrown.
// You can use getTeamOrDefault(team) instead of getTeamNumber if you
Expand All @@ -40,13 +42,13 @@ deploy {
// First part is artifact name, 2nd is artifact type
// getTargetTypeClass is a shortcut to get the class type using a string

frcJava(getArtifactTypeClass("FRCJavaArtifact")) {
frcJava(getArtifactTypeClass('FRCJavaArtifact')) {
}

// Static files artifact
frcStaticFileDeploy(getArtifactTypeClass("FileTreeArtifact")) {
files = project.fileTree("src/main/deploy")
directory = "/home/lvuser/deploy"
frcStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) {
files = project.fileTree('src/main/deploy')
directory = '/home/lvuser/deploy'
}
}
}
Expand All @@ -62,10 +64,9 @@ wpi.java.debugJni = false
def includeDesktopSupport = true

// Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries.
// Also defines JUnit 4.
// Also defines JUnit 5.
dependencies {
implementation 'org.jetbrains:annotations:19.0.0'
compileOnly group: "com.google.errorprone", name: "error_prone_annotations", version: "2.10.0"
compileOnly group: "com.google.errorprone", name: "error_prone_annotations", version: "2.24.1"

implementation wpi.java.deps.wpilib()
implementation wpi.java.vendor.java()
Expand All @@ -84,27 +85,34 @@ dependencies {
nativeRelease wpi.java.vendor.jniRelease(wpi.platforms.desktop)
simulationRelease wpi.sim.enableRelease()

testImplementation "junit:junit:4.12"
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

errorprone group: "com.google.errorprone", name: "error_prone_core", version: "2.10.0"
errorprone group: "com.google.errorprone", name: "error_prone_core", version: "2.24.1"
}

tasks.withType(JavaCompile).configureEach {
options.errorprone.disableWarningsInGeneratedCode = true
}

test {
useJUnitPlatform()
systemProperty 'junit.jupiter.extensions.autodetection.enabled', 'true'
}

// Simulation configuration (e.g. environment variables).

if (!getProjectBooleanProperty('automatedTest')) {
wpi.sim.addGui().defaultEnabled = true
wpi.sim.addDriverstation()
}

// Setting up my Jar File. In this case, adding all libraries into the main jar ("fat jar")
// Setting up my Jar File. In this case, adding all libraries into the main jar ('fat jar')
// in order to make them all available at runtime. Also adding the manifest so WPILib
// knows where to look for our Robot Class.
jar {
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
from sourceSets.main.allSource
manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS)
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
Expand All @@ -114,11 +122,16 @@ deployArtifact.jarTask = jar
wpi.java.configureExecutableTasks(jar)
wpi.java.configureTestTasks(test)

// Configure string concat to always inline compile
tasks.withType(JavaCompile) {
options.compilerArgs.add '-XDstringConcat=inline'
}

// Spotless
spotless {
format "misc", {
target "*"
targetExclude "simgui*.json", "**/build/**", "**/build-*/**", "**/bin/**", "/.*"
targetExclude "simgui*.json", "**/build/**", "**/build-*/**", "**/bin/**", "/.*", "WPILib-License.md", "gradlew"
toggleOffOn()
indentWithTabs()
endWithNewline()
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=permwrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=permwrapper/dists
Loading

0 comments on commit 74915be

Please sign in to comment.