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
6 changes: 5 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
* text=auto eol=lf
*.java eol=lf
*.java eol=lf

# Gradle dependency lockfiles are generated with LF and are hash-sensitive:
# a CRLF checkout would change every line and invalidate the lock.
gradle.lockfile text eol=lf
26 changes: 26 additions & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,29 @@ jobs:
run: xvfb-run -s '-screen 0 1024x768x24' ./gradlew test



# Catch dependency changes that would make the lockfile inconsistent.
# Regenerate after a dependency change and commit the result:
# ./gradlew --write-locks lockClasspaths
lockfile-drift:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up JDK 25
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: '25'

- name: Regenerate lockfile
run: ./gradlew --no-daemon --write-locks lockClasspaths

- name: Fail if lockfile changed
run: |
if ! git diff --exit-code -- gradle.lockfile; then
echo "::error::gradle.lockfile is out of date. Regenerate it and commit the result:"
echo " ./gradlew --write-locks lockClasspaths"
exit 1
fi
38 changes: 37 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,40 @@ publishing {

signing {
sign publishing.publications.mavenJava
}
}

// Regenerate after any dependency change:
// ./gradlew --write-locks lockClasspaths
dependencyLocking {
lockAllConfigurations()
}

def lockedConfigurations = [
'annotationProcessor',
'compileClasspath',
'runtimeClasspath',
'testCompileClasspath',
'testRuntimeClasspath',
]

// Registered only if absent: parent builds register a task of this name on
// every project they contain, and a second registration fails the build.
if (tasks.findByName('lockClasspaths') == null) {
tasks.register('lockClasspaths') {
group = 'build'
description = 'Resolve the locked configurations so --write-locks records them'
doLast {
lockedConfigurations.each { n ->
def c = configurations.findByName(n)
if (c != null && c.canBeResolved) {
try {
c.resolve()
} catch (Throwable ignored) {
// A configuration that cannot resolve is still recorded by
// --write-locks; failure here must not abort the task.
}
}
}
}
}
}
22 changes: 22 additions & 0 deletions gradle.lockfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This is a Gradle generated file for dependency locking.
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
com.google.code.gson:gson:2.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.miglayout:miglayout-core:4.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.miglayout:miglayout-swing:4.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.neuronrobotics:nrjavaserial:5.1.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
commons-net:commons-net:3.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
gov.nist.math:jama:1.0.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
io.ultreia:bluecove:2.1.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
javax.usb:usb-api:1.0.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
junit:junit:4.12=testCompileClasspath,testRuntimeClasspath
net.sf.bluecove:bluecove-gpl:2.1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.apache.commons:commons-lang3:3.2.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.apache.commons:commons-math3:3.6.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.hamcrest:hamcrest-core:1.3=testCompileClasspath,testRuntimeClasspath
org.igniterealtime.smack:smack:3.2.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.igniterealtime.smack:smackx:3.2.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.usb4java:libusb4java:1.2.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.usb4java:usb4java-javax:1.2.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.usb4java:usb4java:1.2.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
empty=annotationProcessor
13 changes: 13 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// build.gradle applies com.diffplug.spotless by id without a version; the
// parent build supplies it, but standalone it must come from pluginManagement.
pluginManagement {
plugins {
id 'com.diffplug.spotless' version '6.25.0'
}
repositories {
gradlePluginPortal()
mavenCentral()
}
}

rootProject.name = 'java-bowler'
Loading