Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@ plugins {
id "java"
id "edu.wpi.first.GradleRIO" version "2026.2.1"
id "com.diffplug.spotless" version "8.2.1"
id 'com.github.node-gradle.node' version '7.1.0'
}

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

node {
download = true
version = '24.13.0'
workDir = file("${buildDir}/nodejs")
}

def ROBOT_MAIN_CLASS = "org.team340.robot.Main"

// Define my targets (RoboRIO) and artifacts (deployable files)
Expand Down Expand Up @@ -92,6 +99,11 @@ dependencies {
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

def npmExec = "bin/npm"
if (System.properties['os.name'].toLowerCase().contains('windows')) {
npmExec = "npm.cmd"
}

// Code formatting via spotless
spotless {
java {
Expand All @@ -104,7 +116,8 @@ spotless {
endWithNewline()
removeUnusedImports()
trimTrailingWhitespace()
prettier(['prettier': '3.8.1', 'prettier-plugin-java': '2.8.1'])
prettier(['prettier': '3.8.0', 'prettier-plugin-java': '2.8.1'])
.npmExecutable("${tasks.named('npmSetup').get().npmDir.get()}${File.separator}${npmExec}")
.config([
parser: 'java',
plugins: ['prettier-plugin-java'],
Expand Down Expand Up @@ -149,3 +162,7 @@ tasks.withType(JavaCompile) {
options.compilerArgs.add '-XDstringConcat=inline'
dependsOn 'spotlessApply'
}

tasks.matching { it.name.startsWith("spotless")}.all {
dependsOn 'nodeSetup', 'npmSetup'
}
Empty file modified gradlew
100644 → 100755
Empty file.