Skip to content

Commit bbe8527

Browse files
committed
release: version 4.1.0
2 parents fc7c4e1 + b3a9aa1 commit bbe8527

File tree

492 files changed

+15412
-11185
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

492 files changed

+15412
-11185
lines changed

.idea/.gitignore

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/TerasologyPC.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/TerasologyPC__2nd_client_for_mac.xml

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/TerasologyPC_for_mac.xml

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Jenkinsfile

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
1-
// Needed due to the Copy Artifact plugin deciding to implement an obnoxious security feature that can't simply be turned off
1+
// Minor housekeeping logic
2+
boolean specialBranch = env.BRANCH_NAME.equals("master") || env.BRANCH_NAME.equals("develop")
3+
4+
// String to use in a property that determines artifact pruning (has to be a String not a number)
5+
String artifactBuildsToKeep = "1"
6+
if (specialBranch) {
7+
artifactBuildsToKeep = "10"
8+
}
9+
210
properties([
3-
copyArtifactPermission('*')
4-
]);
11+
// Needed due to the Copy Artifact plugin deciding to implement an obnoxious security feature that can't simply be turned off
12+
copyArtifactPermission('*'),
13+
// Flag for Jenkins to discard attached artifacts after x builds
14+
buildDiscarder(logRotator(artifactNumToKeepStr: artifactBuildsToKeep))
15+
])
516

6-
node ("default-java || heavy-java") {
17+
// Main pipeline definition
18+
node ("heavy-java") {
719
stage('Checkout') {
820
echo "Going to check out the things !"
921
checkout scm
@@ -15,7 +27,7 @@ node ("default-java || heavy-java") {
1527
archiveArtifacts 'gradlew, gradle/wrapper/*, templates/build.gradle, config/**, facades/PC/build/distributions/Terasology.zip, build/resources/main/org/terasology/version/versionInfo.properties, natives/**, buildSrc/src/**, buildSrc/*.kts'
1628
}
1729
stage('Publish') {
18-
if (env.BRANCH_NAME.equals("master") || env.BRANCH_NAME.equals("develop")) {
30+
if (specialBranch) {
1931
withCredentials([usernamePassword(credentialsId: 'artifactory-gooey', usernameVariable: 'artifactoryUser', passwordVariable: 'artifactoryPass')]) {
2032
sh './gradlew --console=plain -Dorg.gradle.internal.publish.checksums.insecure=true publish -PmavenUser=${artifactoryUser} -PmavenPass=${artifactoryPass}'
2133
}

build.gradle

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ plugins {
2828
// Needed for extending the "clean" task to also delete custom stuff defined here like natives
2929
id "base"
3030

31+
// needs for native platform("org.lwjgl") handling.
32+
id "java-platform"
33+
3134
// The root project should not be an eclipse project. It keeps eclipse (4.2) from finding the sub-projects.
3235
//apply plugin: 'eclipse'
3336
id "idea"
@@ -51,7 +54,7 @@ import static org.gradle.internal.logging.text.StyledTextOutput.Style
5154
// Check for Java 8
5255
if(!(JavaVersion.current() == JavaVersion.VERSION_1_8 || JavaVersion.current() == JavaVersion.VERSION_11)) {
5356
def out = services.get(StyledTextOutputFactory).create("an-ouput")
54-
out.withStyle(Style.FailureHeader).println("WARNING: Compiling with a JDK not 8 nor 11. While some other Javas may be safe to use any newer than 11 may cause issues. If you encounter oddities try Java 8 or 11. See https://github.com/MovingBlocks/Terasology/issues/3976")
57+
out.withStyle(Style.FailureHeader).println("WARNING: Compiling with a JDK not 8 nor 11. While some other Javas may be safe to use any newer than 11 may cause issues. If you encounter oddities try Java 8 or 11. See https://github.com/MovingBlocks/Terasology/issues/3976. Current detected Java version is ${JavaVersion.current()} from vendor ${System.getProperty("java.vendor")} located at ${System.getProperty("java.home")}")
5558
}
5659

5760
// Declare "extra properties" (variables) for the project (and subs) - a Gradle thing that makes them special.
@@ -63,7 +66,7 @@ ext {
6366
// Lib dir for use in manifest entries etc (like in :engine). A separate "libsDir" exists, auto-created by Gradle
6467
subDirLibs = 'libs'
6568

66-
LwjglVersion = '2.9.3'
69+
LwjglVersion = '3.2.3'
6770
}
6871

6972
// Declare remote repositories we're interested in - library files will be fetched from here
@@ -93,19 +96,32 @@ configurations {
9396

9497
dependencies {
9598
// For the "natives" configuration make it depend on the native files from LWJGL
96-
natives group: 'org.lwjgl.lwjgl', name: 'lwjgl', version: LwjglVersion
99+
natives platform("org.lwjgl:lwjgl-bom:$LwjglVersion")
100+
["natives-linux","natives-windows","natives-macos"].forEach {
101+
natives "org.lwjgl:lwjgl::$it"
102+
natives "org.lwjgl:lwjgl-assimp::$it"
103+
natives "org.lwjgl:lwjgl-glfw::$it"
104+
natives "org.lwjgl:lwjgl-openal::$it"
105+
natives "org.lwjgl:lwjgl-opengl::$it"
106+
natives "org.lwjgl:lwjgl-stb::$it"
107+
}
108+
97109

98110
// Config for our code analytics lives in a centralized repo: https://github.com/MovingBlocks/TeraConfig
99111
codeMetrics group: 'org.terasology.config', name: 'codemetrics', version: '1.3.2', ext: 'zip'
100112

101113
// Natives for JNLua (Kallisti, KComputers)
102114
natives group: 'org.terasology.jnlua', name: 'jnlua_natives', version: '0.1.0-SNAPSHOT', ext: 'zip'
115+
116+
// Natives for JNBullet
117+
natives group: 'org.terasology.jnbullet', name: 'JNBullet', version: '1.0.2', ext: 'zip'
118+
103119
}
104120

105121
task extractWindowsNatives(type: Copy) {
106122
description = "Extracts the Windows natives from the downloaded zip"
107123
from {
108-
configurations.natives.collect { it.getName().contains('-natives-window') ? zipTree(it) : [] }
124+
configurations.natives.collect { it.getName().contains('natives-windows') ? zipTree(it) : [] }
109125
}
110126
into("$dirNatives/windows")
111127
exclude('META-INF/**')
@@ -114,7 +130,7 @@ task extractWindowsNatives(type: Copy) {
114130
task extractMacOSXNatives(type: Copy) {
115131
description = "Extracts the OSX natives from the downloaded zip"
116132
from {
117-
configurations.natives.collect { it.getName().contains('-natives-osx') ? zipTree(it) : [] }
133+
configurations.natives.collect { it.getName().contains('natives-macos') ? zipTree(it) : [] }
118134
}
119135
into("$dirNatives/macosx")
120136
exclude('META-INF/**')
@@ -123,7 +139,7 @@ task extractMacOSXNatives(type: Copy) {
123139
task extractLinuxNatives(type: Copy) {
124140
description = "Extracts the Linux natives from the downloaded zip"
125141
from {
126-
configurations.natives.collect { it.getName().contains('-natives-linux') ? zipTree(it) : [] }
142+
configurations.natives.collect { it.getName().contains('natives-linux') ? zipTree(it) : [] }
127143
}
128144
into("$dirNatives/linux")
129145
exclude('META-INF/**')
@@ -137,12 +153,22 @@ task extractJNLuaNatives(type: Copy) {
137153
into("$dirNatives")
138154
}
139155

156+
task extractNativeBulletNatives(type:Copy) {
157+
description = "Extracts the JNBullet natives from the downloaded zip"
158+
from {
159+
configurations.natives.collect { it.getName().contains('JNBullet') ? zipTree(it) : [] }
160+
}
161+
into ("$dirNatives")
162+
}
163+
164+
140165
task extractNatives {
141166
description = "Extracts all the native lwjgl libraries from the downloaded zip"
142167
dependsOn extractWindowsNatives
143168
dependsOn extractLinuxNatives
144169
dependsOn extractMacOSXNatives
145170
dependsOn extractJNLuaNatives
171+
dependsOn extractNativeBulletNatives
146172
}
147173

148174
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -290,6 +316,12 @@ class RemoteModuleGatherer implements DependencyResolutionListener {
290316
gradle.addListener(new RemoteModuleGatherer(rootDir.toPath().resolve("modules")))
291317

292318

319+
tasks.named('wrapper') {
320+
// ALL distributionType because IntelliJ prefers having its sources for analysis and reference.
321+
distributionType = Wrapper.DistributionType.ALL
322+
}
323+
324+
293325
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
294326
// General IDE customization //
295327
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

buildSrc/src/main/kotlin/terasology-module.gradle.kts

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
1-
/*
2-
* Copyright 2020 MovingBlocks
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* https://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
1+
// Copyright 2020 The Terasology Foundation
2+
// SPDX-License-Identifier: Apache-2.0
163

174
// Simple build file for modules - the one under the Core module is the template, will be copied as needed to modules
185

@@ -174,6 +161,8 @@ tasks.register("cacheReflections") {
174161
outputs.file(File(mainSourceSet.output.classesDirs.first(), "reflections.cache"))
175162
dependsOn(tasks.named("classes"))
176163

164+
outputs.upToDateWhen { tasks.named("classes").get().state.upToDate }
165+
177166
doFirst {
178167
try {
179168
val reflections = Reflections(ConfigurationBuilder()

0 commit comments

Comments
 (0)