Skip to content

Commit

Permalink
build(bumpup-gradle): upgrade gradle and code for it.
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkWeird committed Jul 6, 2023
1 parent 023571e commit 5a08176
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 24 deletions.
4 changes: 2 additions & 2 deletions build-logic/src/main/kotlin/terasology-module.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ apply(from = "$rootDir/config/gradle/publish.gradle")
// Handle some logic related to where what is
configure<SourceSetContainer> {
main {
java.outputDir = buildDir.resolve("classes")
java.destinationDirectory.set(buildDir.resolve("classes"))
}
test {
java.outputDir = buildDir.resolve("testClasses")
java.destinationDirectory.set(buildDir.resolve("testClasses"))
}
}

Expand Down
14 changes: 7 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ import static org.gradle.internal.logging.text.StyledTextOutput.Style

// Test for right version of Java in use for running this script
assert org.gradle.api.JavaVersion.current().isJava11Compatible()
if(!(JavaVersion.current() == JavaVersion.VERSION_11)) {
if (!(JavaVersion.current() == JavaVersion.VERSION_11)) {
def out = services.get(StyledTextOutputFactory).create("an-ouput")
out.withStyle(Style.FailureHeader).println("""
WARNING: Compiling with a JDK of not version 11. While some other Javas may be
Expand Down Expand Up @@ -102,7 +102,7 @@ configurations {
dependencies {
// For the "natives" configuration make it depend on the native files from LWJGL
natives platform("org.lwjgl:lwjgl-bom:$LwjglVersion")
["natives-linux","natives-windows","natives-macos"].forEach {
["natives-linux", "natives-windows", "natives-macos"].forEach {
natives "org.lwjgl:lwjgl::$it"
natives "org.lwjgl:lwjgl-assimp::$it"
natives "org.lwjgl:lwjgl-glfw::$it"
Expand Down Expand Up @@ -158,12 +158,12 @@ task extractJNLuaNatives(type: Copy) {
into("$dirNatives")
}

task extractNativeBulletNatives(type:Copy) {
task extractNativeBulletNatives(type: Copy) {
description = "Extracts the JNBullet natives from the downloaded zip"
from {
configurations.natives.collect { it.getName().contains('JNBullet') ? zipTree(it) : [] }
}
into ("$dirNatives")
into("$dirNatives")
}


Expand Down Expand Up @@ -202,8 +202,8 @@ clean.doLast {
allprojects {
configurations.all {
resolutionStrategy.dependencySubstitution {
substitute module("org.terasology.engine:engine") because "we have sources!" with project(":engine")
substitute module("org.terasology.engine:engine-tests") because "we have sources!" with project(":engine-tests")
substitute module("org.terasology.engine:engine") using project(":engine") because "we have sources!"
substitute module("org.terasology.engine:engine-tests") using project(":engine-tests") because "we have sources!"
}
}
}
Expand All @@ -214,7 +214,7 @@ project(":modules").subprojects.forEach { proj ->
project(":modules").subprojects {
configurations.all {
resolutionStrategy.dependencySubstitution {
substitute module("org.terasology.modules:${proj.name}") because "we have sources!" with project(":modules:${proj.name}")
substitute module("org.terasology.modules:${proj.name}") using project(":modules:${proj.name}") because "we have sources!"
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions config/gradle/common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ test {
// showStandardStreams: makes the standard streams (err and out) visible at console when running tests
testLogging.showStandardStreams = true
reports {
junitXml.enabled = true
// junitXml.enabled = true
}
// Arguments to include while running tests
jvmArgs '-Xms512m', '-Xmx1024m'
Expand All @@ -80,9 +80,9 @@ jacocoTestReport {
dependsOn test // Despite doc saying this should be automatic we need to explicitly add it anyway :-(
reports {
// Used to be exec, but that had a binary incompatibility between JaCoCo 0.7.4 and 0.7.5 and issues with some plugins
xml.enabled true
csv.enabled false
html.enabled true
// xml.enabled true
// csv.enabled false
// html.enabled true
}
}

Expand Down
4 changes: 2 additions & 2 deletions engine-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ println "Version for $project.name loaded as $version for group $group"

sourceSets {
// Adjust output path (changed with the Gradle 6 upgrade, this puts it back)
main.java.outputDir = new File("$buildDir/classes")
test.java.outputDir = new File("$buildDir/testClasses")
main.java.destinationDirectory = new File("$buildDir/classes")
test.java.destinationDirectory = new File("$buildDir/testClasses")
}

// Primary dependencies definition
Expand Down
6 changes: 1 addition & 5 deletions engine/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ sourceSets {
}
java {
// Adjust output path (changed with the Gradle 6 upgrade, this puts it back)
outputDir = new File("$buildDir/classes")
destinationDirectory = new File("$buildDir/classes")
}
}
}
Expand Down Expand Up @@ -263,10 +263,6 @@ task copyResourcesToClasses(type: Copy) {
mustRunAfter compileJava
}

tasks.named("classes") {
dependsOn(tasks.named("copyResourcesToClasses"))
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// General IDE customization //
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 2 additions & 2 deletions facades/TeraEd/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ group = 'org.terasology.facades'

sourceSets {
// Adjust output path (changed with the Gradle 6 upgrade, this puts it back)
main.java.outputDir = new File("$buildDir/classes")
test.java.outputDir = new File("$buildDir/testClasses")
main.java.destinationDirectory = new File("$buildDir/classes")
test.java.destinationDirectory = new File("$buildDir/testClasses")
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion subsystems/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ subprojects {
def sourceSets = project.getConvention().getPlugin(JavaPluginConvention.class).sourceSets


sourceSets.main.java.outputDir = new File("$buildDir/classes")
sourceSets.main.java.destinationDirectory = new File("$buildDir/classes")
idea {
module {
// Change around the output a bit
Expand Down

0 comments on commit 5a08176

Please sign in to comment.