diff --git a/.vscode/settings.json b/.vscode/settings.json index c015f19..ff01b1c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -70,5 +70,9 @@ }, "java.diagnostic.filter": [ "**build/generated**" - ] + ], + "files.associations": { + "*.json": "json", + "*.gradle": "groovy" + } } diff --git a/README.md b/README.md index 7595a63..2228c5a 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,4 @@ This repository is the source code for 1425's offseason testing of the new 2027 ## Important! -This is using pre-release versions of vendor dependencies, WPILib, and all tools involved. To use this, you must have the 2027 WPILib Alpha 7 installed. +This is using pre-release versions of vendor dependencies, WPILib, and all tools involved. To use this, you must have the 2027 WPILib Alpha 8 installed. diff --git a/build.gradle b/build.gradle index a673fce..d3e80a6 100755 --- a/build.gradle +++ b/build.gradle @@ -1,9 +1,9 @@ plugins { id "java" id "application" - id "org.wpilib.GradleRIO" version "2027.0.0-alpha-7" + id "org.wpilib.GradleRIO" version "2027.0.0-alpha-8" id "com.peterabeles.gversion" version "1.10" - id "com.diffplug.spotless" version "8.6.0" + id "com.diffplug.spotless" version "8.10.4" } java { @@ -58,7 +58,7 @@ wpi.java.runSimWithDebugJni = false def includeDesktopSupport = true // Configuration for AdvantageKit -task(replayWatch, type: JavaExec) { +tasks.register("replayWatch", JavaExec) { mainClass = "org.littletonrobotics.junction.ReplayWatch" classpath = sourceSets.main.runtimeClasspath } @@ -133,22 +133,24 @@ gversion { indent = " " } +def projectDirectory = projectDir +def isDeployTaskIncluded = project.gradle.startParameter.taskNames.any({it.toLowerCase().contains("deploy")}) + // Create commit with working changes on event branches -task(eventDeploy) { +tasks.register("eventDeploy") { doLast { - if (project.gradle.startParameter.taskNames.any({ it.toLowerCase().contains("deploy") })) { + if (isDeployTaskIncluded) { def branchPrefix = "event" def branch = 'git branch --show-current'.execute().text.trim() def commitMessage = "Update at '${new Date().toString()}'" - if (branch.startsWith(branchPrefix)) { - exec { - workingDir(projectDir) + execOperations.exec { + workingDir(projectDirectory) executable 'git' args 'add', '-A' } - exec { - workingDir(projectDir) + execOperations.exec { + workingDir(projectDirectory) executable 'git' args 'commit', '-m', commitMessage ignoreExitValue = true @@ -171,7 +173,21 @@ def onlyOurHeaders = '(?is)\\A(?:(?!(?:(?!package ).)*(?:copyright|license|\\u00 // Spotless formatting project.compileJava.dependsOn(spotlessApply) + +spotlessPredeclare { + groovyGradle { + greclipse('4.31') + } + java { + googleJavaFormat('1.36.1') + } + json { + gson().version('2.14.0') + } +} + spotless { + predeclareDepsFromBuildscript() java { target fileTree(".") { include "**/*.java" @@ -189,7 +205,7 @@ spotless { include "**/*.gradle" exclude "**/build/**", "**/build-*/**", "/.direnv" } - greclipse() + greclipse('4.31') leadingTabsToSpaces(4) trimTrailingWhitespace() endWithNewline() @@ -211,3 +227,7 @@ spotless { endWithNewline() } } + +tasks.withType(com.diffplug.gradle.spotless.SpotlessTask).configureEach { + notCompatibleWithConfigurationCache("Spotless Equo engine relies on execution-time state unpacking") +}