Skip to content

Commit

Permalink
fix: upgrade to full java 17 support
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Java 17 is now mandatory
  • Loading branch information
Silthus committed Nov 20, 2024
1 parent 894d592 commit 8fe652e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
17 changes: 15 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ compileJava {
options.compilerArgs += ["-parameters"]
options.fork = true
options.forkOptions.executable = 'javac'
options.compilerArgs += [
'--release', '17',
'-Xlint:deprecation'
]
}

archivesBaseName = project.property("pluginName")
Expand Down Expand Up @@ -77,10 +81,15 @@ dependencies {
implementation vaultAll()

// Test dependencies
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.2'
testImplementation 'org.mockito:mockito-core:4.11.0'
testImplementation 'com.github.seeseemelk:MockBukkit-v1.19:2.144.3'
testImplementation 'org.assertj:assertj-core:3.24.1'

// Add these for test compilation
testImplementation project.shadow
testImplementation project.configurations.shadow
}

shadowJar {
Expand All @@ -98,8 +107,12 @@ test {
useJUnitPlatform()
testLogging {
events "skipped", "failed"
exceptionFormat = 'full'
showStandardStreams = true
}
ignoreFailures = false

// Add this to ensure test dependencies are available
systemProperty 'java.class.path', sourceSets.test.runtimeClasspath.asPath
}

processResources {
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ author = Silthus
mcVersion = 1.19.3
apiVersion = 1.13
version = 4.5.3
sourceCompatibility=17
targetCompatibility=17
1 change: 1 addition & 0 deletions src/main/java/net/silthus/template/TemplatePlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public TemplatePlugin() {
instance = this;
}

@SuppressWarnings("removal")
public TemplatePlugin(
JavaPluginLoader loader, PluginDescriptionFile description, File dataFolder, File file) {
super(loader, description, dataFolder, file);
Expand Down

0 comments on commit 8fe652e

Please sign in to comment.