Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Breaking all] Gestalt v7 re-integration.... #4144

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
a945a02
feature(reintegrate-gestaltv7): bump up gestalt dependencies version.…
DarkWeird Sep 7, 2020
d1cce0c
feature(reintegrate-gestaltv7): Fix all source code problems
DarkWeird Sep 7, 2020
3e7612d
feature(reintegrate-gestaltv7): Update gson.
DarkWeird Sep 7, 2020
89ff068
feature(reintegrate-gestaltv7): fix engine-tests
DarkWeird Sep 7, 2020
3ad747e
feature(gestaltv7): Restore Colorc in CanvasRenderers
DarkWeird Sep 7, 2020
eef934f
feature(reintegrate-gestaltv7): replace ShrinkWrapSystem with defalut…
DarkWeird Sep 8, 2020
0b0aaac
feature(reintegrate-gestaltv7): move engine to package `org.terasolo…
DarkWeird Sep 9, 2020
3602e53
feature(reintegrate-gestaltv7): fix packageNames for runConfigs. (ma…
DarkWeird Sep 9, 2020
9176592
feature(reintegrate-gestaltv7): move reflection in engine package
DarkWeird Sep 10, 2020
45b643d
feature(reintegrate-gestaltv7): move reflection package to engine pa…
DarkWeird Sep 10, 2020
3e3faaf
feature(reintegrate-gestaltv7): add reload handling on EnvironmentSw…
DarkWeird Sep 10, 2020
b95028b
feature(reintegrate-gestaltv7): migrate ui types from engine to nui(…
DarkWeird Sep 10, 2020
fec847a
feature(reintegrate-gestaltv7): update guava lib version
DarkWeird Sep 10, 2020
5646321
feature(reintegrate-gestaltv7): add gestalt's classes to whitelist a…
DarkWeird Sep 10, 2020
46b97c6
feature(reintegrate-gestaltv7): Fix emptymodules on return to main menu
DarkWeird Sep 11, 2020
15501d9
feature(reintegrate-gestaltv7): Fix tests
DarkWeird Sep 11, 2020
938d29e
feature(reintegrate-gestaltv7): Fix MTE tests
DarkWeird Sep 15, 2020
cc5236d
feature(reintegrate-gestaltv7): cleanup build.gradle
DarkWeird Sep 15, 2020
685c96c
feature(reintegrate-gestaltv7): cleanup and check gestalt related TODOs
DarkWeird Sep 15, 2020
66deb05
feature(reintegrate-gestaltv7): fix module downloading.
DarkWeird Sep 15, 2020
f987e3b
Merge remote-tracking branch 'origin/develop' into feature/gestalt-v7
DarkWeird Sep 16, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/TerasologyPC.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/TerasologyPC__2nd_client_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/TerasologyPC__3rd_client_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/TerasologyPC__CR_enabled_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/TerasologyPC__EXTREME_8GB_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/TerasologyPC__Headless_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/TerasologyPC__Splash_disabled_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/TerasologyPC__load_latest_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/TerasologyPC__no_audio_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/TerasologyPC__no_saves_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/engine_tests_with_JaCoCo.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ buildscript {
}

dependencies {
// Needed for caching reflected data during builds
classpath 'org.reflections:reflections:0.9.10'
classpath 'dom4j:dom4j:1.6.1'

//Spotbugs
classpath "gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.0.0"
Expand Down
1 change: 1 addition & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ dependencies {
// Needed for caching reflected data during builds
implementation("org.reflections:reflections:0.9.10")
implementation("dom4j:dom4j:1.6.1")
implementation("com.google.code.gson:gson:2.8.5")
}
31 changes: 10 additions & 21 deletions buildSrc/src/main/kotlin/terasology-module.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
/*
* Copyright 2020 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2020 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0

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

Expand All @@ -22,6 +9,7 @@ import org.gradle.plugins.ide.idea.model.IdeaModel
import org.reflections.Reflections
import org.reflections.scanners.SubTypesScanner
import org.reflections.scanners.TypeAnnotationsScanner
import org.reflections.serializers.JsonSerializer
import org.reflections.util.ConfigurationBuilder
import org.reflections.util.FilterBuilder

Expand Down Expand Up @@ -134,8 +122,6 @@ if (project.name == "ModuleTestingEnvironment") {
implementation("org.junit.jupiter:junit-jupiter-api:5.6.2")
implementation("org.mockito:mockito-junit-jupiter:3.2.0")
implementation("junit:junit:4.12")
//TODO: Remove shrinkwrap from code, you have FileSystem in java 8
implementation("org.jboss.shrinkwrap:shrinkwrap-depchain-java7:1.2.1")
}
}

Expand Down Expand Up @@ -171,7 +157,7 @@ tasks.register("createSkeleton") {
tasks.register("cacheReflections") {
description = "Caches reflection output to make regular startup faster. May go stale and need cleanup at times."
inputs.files(mainSourceSet.output.classesDirs)
outputs.file(File(mainSourceSet.output.classesDirs.first(), "reflections.cache"))
outputs.file(File(mainSourceSet.output.classesDirs.first(), "manifest.json"))
dependsOn(tasks.named("classes"))

doFirst {
Expand All @@ -180,7 +166,7 @@ tasks.register("cacheReflections") {
.filterInputsBy(FilterBuilder.parsePackages("+org"))
.addUrls(inputs.getFiles().getSingleFile().toURI().toURL())
.setScanners(TypeAnnotationsScanner(), SubTypesScanner()))
reflections.save(outputs.getFiles().getAsPath())
reflections.save(outputs.getFiles().getAsPath(), JsonSerializer())
} catch (e: java.net.MalformedURLException) {
getLogger().error("Cannot parse input to url", e);
}
Expand Down Expand Up @@ -208,10 +194,13 @@ tasks.register<Sync>("syncDeltas") {
into("${mainSourceSet.output.classesDirs.first()}/deltas")
}

tasks.named("compileJava") {
finalizedBy("cacheReflections")
}

// Instructions for packaging a jar file - is a manifest even needed for modules?
tasks.named("jar") {
// Make sure the assets directory is included
dependsOn("cacheReflections")
dependsOn("syncAssets")
dependsOn("syncOverrides")
dependsOn("syncDeltas")
Expand All @@ -224,7 +213,7 @@ tasks.named("jar") {
}
}

finalizedBy("cleanReflections")
// finalizedBy("cleanReflections")
}

// Prep an IntelliJ module for the Terasology module - yes, might want to read that twice :D
Expand Down
2 changes: 1 addition & 1 deletion config/eclipse/Terasology.launch
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.terasology.engine.Terasology"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.terasology.engine.core.Terasology"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="PC"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms256m -Xmx1024m"/>
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:PC}/../.."/>
Expand Down
2 changes: 1 addition & 1 deletion config/eclipse/TerasologyAWT.launch
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.terasology.engine.TerasologyAwt"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.terasology.engine.core.TerasologyAwt"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="AWT"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms256m -Xmx1024m"/>
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:AWT}/../.."/>
Expand Down
23 changes: 7 additions & 16 deletions config/gradle/common.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
/*
* Copyright 2020 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2020 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0

// language
apply plugin: 'java'
Expand Down Expand Up @@ -70,6 +57,10 @@ repositories {
url "http://maven.snplow.com/releases"
allowInsecureProtocol true // 😱
}
google()
maven {
url 'https://heisluft.tk/maven'
}
}

dependencies {
Expand Down Expand Up @@ -111,7 +102,7 @@ test {
}

jacoco {
excludes = ["org.terasology.protobuf.*",
excludes = ["org.terasology.engine.protobuf.*",
"*MethodAccess","*FieldAccess"]
}
}
Expand Down
26 changes: 5 additions & 21 deletions engine-tests/build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
/*
* Copyright 2020 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2020 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0

// Engine tests are split out due to otherwise quirky project dependency issues with module tests extending engine tests

Expand All @@ -32,7 +19,7 @@ ext {
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// Read the internal version out of the engine-tests module.txt
def moduleFile = file('src/main/resources/module.txt')
def moduleFile = file('src/main/resources/org/terasology/unittest/module.txt')

if (!moduleFile.exists()) {
println "Failed to find module.txt for engine-tests"
Expand Down Expand Up @@ -68,12 +55,12 @@ dependencies {
implementation project(':engine')

// Dependency not provided for modules, but required for module-tests
implementation group: 'com.google.code.gson', name: 'gson', version: '2.6.2'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
implementation group: 'org.codehaus.plexus', name: 'plexus-utils', version: '1.5.6'
implementation group: 'com.google.protobuf', name: 'protobuf-java', version: '2.6.1'
implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
runtimeOnly group: 'org.slf4j', name: 'jul-to-slf4j', version: '1.7.21'
implementation group: 'org.reflections', name: 'reflections', version: '0.9.10'
implementation group: 'org.terasology', name: 'reflections', version: '0.9.12-MB'

// Test lib dependencies
implementation("org.junit.jupiter:junit-jupiter-api:5.5.2")
Expand All @@ -83,9 +70,6 @@ dependencies {
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.5.2")

implementation group: 'junit', name: 'junit', version: '4.12'

//TODO: Remove shrinkwrap from code, you have FileSystem in java 8
implementation group: 'org.jboss.shrinkwrap', name: 'shrinkwrap-depchain-java7', version: '1.2.1'
}

task copyResourcesToClasses(type:Copy) {
Expand Down
34 changes: 10 additions & 24 deletions engine-tests/src/main/java/org/terasology/Environment.java
Original file line number Diff line number Diff line change
@@ -1,37 +1,23 @@
/*
* Copyright 2014 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License"){ }
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2020 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0

package org.terasology;

import com.google.common.collect.Sets;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.terasology.assets.management.AssetManager;
import org.terasology.context.Context;
import org.terasology.context.internal.ContextImpl;
import org.terasology.naming.Name;
import org.terasology.recording.RecordAndReplayCurrentStatus;
import org.terasology.registry.CoreRegistry;
import org.terasology.engine.context.Context;
import org.terasology.engine.context.internal.ContextImpl;
import org.terasology.engine.recording.RecordAndReplayCurrentStatus;
import org.terasology.engine.registry.CoreRegistry;
import org.terasology.gestalt.assets.management.AssetManager;
import org.terasology.gestalt.naming.Name;

import java.io.IOException;
import java.util.Set;

/**
* Setup an empty Terasology environment
*
*/
public class Environment {

Expand Down Expand Up @@ -72,7 +58,7 @@ protected void reset(Set<Name> moduleNames) throws Exception {
AssetManager assetManager = setupAssetManager();

setupBlockManager(assetManager);

setupExtraDataManager(context);

setupCollisionManager();
Expand Down Expand Up @@ -133,7 +119,7 @@ protected AssetManager setupEmptyAssetManager() {
protected void setupBlockManager(AssetManager assetManager) {
// empty
}

protected void setupExtraDataManager(Context context) {
// empty
}
Expand Down
Loading