From 93b6a10ea1c2477656c0032cab13532b41b88f73 Mon Sep 17 00:00:00 2001 From: Cervator Date: Thu, 26 Jan 2017 02:04:36 -0500 Subject: [PATCH 1/3] Major Gradle overhaul - bunch of stuff done, stable again but more to do. - Upgrades to Gradle 3.3 from 2.10 - Removes the need for module directories to have a build.gradle - Related cleanup / simplification of scripts - Bakes in support for alternative module languages into new /modules Gradle scripts via new "language" property in module.txt --- build.gradle | 318 --------------------------------------------------- module.txt | 5 +- 2 files changed, 3 insertions(+), 320 deletions(-) delete mode 100644 build.gradle diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 7679800..0000000 --- a/build.gradle +++ /dev/null @@ -1,318 +0,0 @@ -// Expanded Core style build file for ScalaLib as a module. IntelliJ users should install the IDE's Scala plugin -// NOTE: This module needs special treatment to not have its slight tweaks to Core's build.gradle overwritten -apply plugin: 'scala' - -// Grab all the common stuff like plugins to use, artifact repositories, code analysis config, Artifactory settings, Git magic -apply from: "$rootDir/config/gradle/artifactory.gradle" - -import groovy.json.JsonSlurper -import java.text.SimpleDateFormat; - -// Git plugin details at https://github.com/ajoberstar/gradle-git -import org.ajoberstar.gradle.git.tasks.* -import org.reflections.Reflections; -import org.reflections.scanners.SubTypesScanner; -import org.reflections.scanners.TypeAnnotationsScanner; -import org.reflections.util.ConfigurationBuilder; - -// Dependencies needed for what our Gradle scripts themselves use. It cannot be included via an external Gradle file :-( -buildscript { - repositories { - // External libs - jcenter is Bintray and is supposed to be a superset of Maven Central, but do both just in case - jcenter() - mavenCentral() - } - - dependencies { - // Artifactory plugin - classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '4.0.0') - - // Git plugin for Gradle - classpath 'org.ajoberstar:gradle-git:0.6.3' - - // Needed for caching reflected data during builds - classpath 'org.reflections:reflections:0.9.10' - classpath 'dom4j:dom4j:1.6.1' - } -} - -ext { - // Read environment variables, including variables passed by jenkins continuous integration server - env = System.getenv() -} - -def moduleDepends = []; -def moduleFile = file('module.txt') - -// The module file should always exist if the module was correctly created or cloned using Gradle -if (!moduleFile.exists()) { - println "Y U NO EXIST MODULE.TXT!" - throw new GradleException("Failed to find module.txt for " + project.name) -} - -//println "Scanning for dependencies in module.txt for " + project.name -def slurper = new JsonSlurper() -def moduleConfig = slurper.parseText(moduleFile.text) -for (dependency in moduleConfig.dependencies) { - if (dependency.id != 'engine') { - moduleDepends += dependency.id - } -} - -// Gradle uses the magic version variable when creating the jar name (unless explicitly set somewhere else I guess) -version = moduleConfig.version - -// Jenkins-Artifactory integration catches on to this as part of the Maven-type descriptor -group = 'org.terasology.modules' - -println "Version for $project.name loaded as $version for group $group" - -// TODO: Remove when we don't need to rely on snapshots. Needed here for solo builds in Jenkins -configurations.all { - resolutionStrategy.cacheChangingModulesFor 0, 'seconds' -} - -configurations { - includeInJar -} - -// Set dependencies. Note that the dependency information from module.txt is used for other Terasology modules -dependencies { - - // Specific to ScalaLib - includeInJar 'org.scala-lang:scala-library:2.11.7' - configurations.compile.extendsFrom(configurations.includeInJar) - - // Check to see if this module is not the root Gradle project - if so we are in a multi-project workspace - if (project.name != project(':').name) { - println "\nProcessing module '$project.name' in a multi-project workspace" - - // Dependency on the engine itself (actually its built jar file) - compile project(':engine') - - // Engine unit tests contain classes that module unit tests can extend, so need to be compile, not testCompile - compile project(':engine-tests') - - if (moduleDepends.size() > 0) { - println "* $project.name has extra dependencies:" - moduleDepends.each { - println "** $it" - } - } else { - println "* No extra dependencies" - } - - // If the module has dependencies on other modules we look for either a source version or a remote binary - for (dependency in moduleDepends) { - File wouldBeSrcPath = new File(rootDir, 'modules/' + dependency) - //println "Scanning for source module at: " + wouldBeSrcPath.getAbsolutePath() - - // First see if we have an actual source module project in the Gradle project tree (user fetchModule'ed it) - if (wouldBeSrcPath.exists()) { - //TODO: This could hit problems with corrupt module directories? - - println "*** Identified source: " + dependency - // Note: if artifactoryPublish is used in a multi-project workspace including modules the .pom gets hard version refs - // Normally they're expected to run in Jenkins standalone where they'll instead match the else and get version '+' - compile project(':modules:' + dependency) - } else { - println "*** Seeking as binary: " + dependency - // The '+' is satisfied by any version. "changing" triggers better checking for updated snapshots - // TODO: When version handling and promotion is in then we can probably ignore snapshots in normal cases - compile(group: 'org.terasology.modules', name: dependency, version: '+', changing: true) - } - } - - // This step resolves artifacts early, after which project config CANNOT be altered again! - configurations.compile.resolvedConfiguration.resolvedArtifacts.each { ResolvedArtifact artifact -> - def id = artifact.moduleVersion.id - - // Check for any needed module dependencies on other modules that we need at runtime - if (id.group == 'org.terasology.modules' && id.name != "Core") { - File moduleSrcPath = new File(rootDir, 'modules/' + id.name) - File moduleJarPath = new File(rootDir, 'modules/' + id.name + '-' + id.version + '.jar') - - if (moduleSrcPath.exists()) { - println "*** Found module dependency $id.name in source form, not copying a runtime jar from Gradle" - } else { - println "$project.name resolved binary $id.group - $id.name at version $id.version" - - // This copies the jar from the Gradle cache to the game's module dir for runtime usage, if needed - if (!moduleJarPath.exists()) { - println "* Writing a runtime jar to /modules: " + moduleJarPath.name - moduleJarPath.createNewFile() - moduleJarPath << artifact.file.bytes - } - } - } - } - } else { - println "We're in a single-project non-Core module workspace (Jenkins) so will look elsewhere for dependencies" - - // TODO: While this is easy it would prevent modules declaring an engine dependency of a specific version - // TODO: Look for a provided engine jar in the workspace and use that if present - // TODO: Only use engine, engine-tests, and maybe core for compilation, but remove when publishing? - compile(group: 'org.terasology.engine', name: 'engine', version: '+', changing: true) - compile(group: 'org.terasology.engine', name: 'engine-tests', version: '+', changing: true) - - // To get Terasology module dependencies we simply declare them against Artifactory - moduleDepends.each { - println "*** Attempting to fetch dependency module from Artifactory for " + project.name + ": " + it - // The '+' is satisfied by any version - compile(group: 'org.terasology.modules', name: it, version: '+', changing: true) - - } - - // TODO: parse and apply external lib dependencies if any are present - // TODO: Consider / keep an eye on whether resolving artifacts early at this point causes any trouble (is only for logging) - // This step resolves artifacts (both compile & testCompile) and prints out some interesting versions - configurations.testCompile.resolvedConfiguration.resolvedArtifacts.each { ResolvedArtifact artifact -> - def id = artifact.moduleVersion.id - // Print out module (and engine stuff) dependencies and the exact versions they resolved at - if (id.group.startsWith('org.terasology')) { - println "*** $project.name remotely resolved $id.group - $id.name - version $id.version" - } - } - } -} - -// Change the output dir of each module -sourceSets { - main { - java { - output.classesDir 'build/classes' - } - scala { - output.classesDir 'build/classes' - } - } -} - -// Generate the module directory structure if missing -task createSkeleton() { - mkdir('assets') - mkdir('assets/animations') - mkdir('assets/atlas') - mkdir('assets/behaviors') - mkdir('assets/blocks') - mkdir('assets/blockSounds') - mkdir('assets/blockTiles') - mkdir('assets/fonts') - mkdir('assets/materials') - mkdir('assets/mesh') - mkdir('assets/music') - mkdir('assets/prefabs') - mkdir('assets/shaders') - mkdir('assets/shapes') - mkdir('assets/skeletalMesh') - mkdir('assets/skins') - mkdir('assets/sounds') - mkdir('assets/textures') - mkdir('assets/ui') - mkdir('overrides') - mkdir('deltas') - mkdir('src/main/java') - mkdir('src/main/scala') - mkdir('src/test/java') - mkdir('src/test/scala') -} - -task cacheReflections { - description = 'Caches reflection output to make regular startup faster. May go stale and need cleanup at times.' - // TODO: The extra "org" qualifier excludes test classes otherwise sucked up in Jenkins, causing issues. Redo later - File dirToReflect = new File(sourceSets.main.output.classesDir, "org") - inputs.files dirToReflect - outputs.file file(sourceSets.main.output.classesDir.toString() + "/reflections.cache") - dependsOn classes - doFirst { - // Without the .mkdirs() we might hit a scenario where the classes dir doesn't exist yet - dirToReflect.mkdirs() - Reflections reflections = new Reflections(new ConfigurationBuilder() - .addUrls(dirToReflect.toURI().toURL()) - .setScanners(new TypeAnnotationsScanner(), new SubTypesScanner())) - reflections.save(sourceSets.main.output.classesDir.toString() + "/reflections.cache") - } -} - -task cleanReflections(type: Delete) { - description = 'Cleans the reflection cache. Useful in cases where it has gone stale and needs regeneration.' - delete sourceSets.main.output.classesDir.toString() + "/reflections.cache" -} - -// This task syncs everything in the assets dir into the output dir, used when jarring the module -task syncAssets(type: Sync) { - from 'assets' - into 'build/classes/assets' -} - -task syncOverrides(type: Sync) { - from 'overrides' - into 'build/classes/overrides' -} - -task syncDeltas(type: Sync) { - from 'deltas' - into 'build/classes/deltas' -} - -// Instructions for packaging a jar file - is a manifest even needed for modules? -jar { - // Make sure the assets directory is included - dependsOn cacheReflections - dependsOn syncAssets - dependsOn syncOverrides - dependsOn syncDeltas - - // Jarring needs to copy module.txt and all the assets into the output - doFirst { - copy { - from 'module.txt' - from configurations.includeInJar - into 'build/classes' - } - } -} - -jar.finalizedBy cleanReflections - -// Prep an IntelliJ module for the Terasology module - yes, might want to read that twice :D -idea { - module { - // Change around the output a bit - inheritOutputDirs = false - outputDir = file('build/classes') - testOutputDir = file('build/testClasses') - downloadSources = true - } -} - -// For Eclipse just make sure the classpath is right -eclipse { - classpath { - defaultOutputDir = file('build/classes') - } -} - -// Utility task to update the module (except Core) via Git - not tested with local changes present, may cause trouble -task (updateModule, type: GitPull) { - description = 'Updates source for the module from its home (most likely GitHub)' - - // Base whether the task executes on two things - // 1 - we actually asked for it ("gradlew updateModule") - otherwise we don't want it to run TODO: Test for abbreviations? - // 2 - this is not the Core module, which lives with the engine and needs no updates - boolean enabled = "updateModule" in project.gradle.startParameter.taskNames && !project.name.equals("Core") - // TODO: Used to cheat with declaring tasks using << but that defers everything (including config) to execution phase - // Some tasks do not work that way, this one would ALWAYS go with default (root git repo) in that case - // Probably should go through other stuff and use this strategy instead of << - - // Only if we asked for it (and not Core) do we actually configure the repo path and log that we're updating - if (enabled) { - - // This is the Git repo we're actually using - projectDir is specific to the executing project, a.k.a. module whatever - // If not enabled the default is the root project's Git dir, which is a valid Git dir - // However in the case of Core we'd be setting ain invalid Git dir which causes fail - so this avoids that - repoPath = projectDir - - println "Pulling updates via Git to " + getRepoDir() + ", if dependencies change run Gradle again (like 'gradlew idea')" - } -} diff --git a/module.txt b/module.txt index 2bea5ec..9268b32 100644 --- a/module.txt +++ b/module.txt @@ -1,9 +1,10 @@ { + "language" : "scala", "id" : "ScalaLib", - "version" : "1.0.1-SNAPSHOT", + "version" : "2.11.7-SNAPSHOT", "author" : "skaldarnar", "displayName" : "Scala Runtime Library Module", - "description" : "Library module that supplies the Scala runtime library. See www.scala-lang.org for more information.", + "description" : "Library module that supplies the Kotlin runtime library. See www.scala-lang.org. Version tied to embedded Scala.", "dependencies" : [], "isServerSideOnly" : false } \ No newline at end of file From 78fb8a0d5b398bceff7b2386d3e536c26d5c4088 Mon Sep 17 00:00:00 2001 From: Cervator Date: Fri, 27 Jan 2017 23:58:56 -0500 Subject: [PATCH 2/3] Minor cleanup. --- gradle/wrapper/gradle-wrapper.properties | 6 - gradlew | 160 ----------------------- gradlew.bat | 90 ------------- module.txt | 18 +-- 4 files changed, 9 insertions(+), 265 deletions(-) delete mode 100644 gradle/wrapper/gradle-wrapper.properties delete mode 100755 gradlew delete mode 100644 gradlew.bat diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 18248ba..0000000 --- a/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Fri Oct 23 23:46:06 CEST 2015 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-bin.zip diff --git a/gradlew b/gradlew deleted file mode 100755 index 9d82f78..0000000 --- a/gradlew +++ /dev/null @@ -1,160 +0,0 @@ -#!/usr/bin/env bash - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "$*" -} - -die ( ) { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") -} -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" - -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/gradlew.bat b/gradlew.bat deleted file mode 100644 index 8a0b282..0000000 --- a/gradlew.bat +++ /dev/null @@ -1,90 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/module.txt b/module.txt index 9268b32..5be3aea 100644 --- a/module.txt +++ b/module.txt @@ -1,10 +1,10 @@ { - "language" : "scala", - "id" : "ScalaLib", - "version" : "2.11.7-SNAPSHOT", - "author" : "skaldarnar", - "displayName" : "Scala Runtime Library Module", - "description" : "Library module that supplies the Kotlin runtime library. See www.scala-lang.org. Version tied to embedded Scala.", - "dependencies" : [], - "isServerSideOnly" : false -} \ No newline at end of file + "language" : "scala", + "id" : "ScalaLib", + "version" : "2.11.7-SNAPSHOT", + "author" : "skaldarnar", + "displayName" : "Scala Runtime Library Module", + "description" : "Library module that supplies the Kotlin runtime library. See www.scala-lang.org. Version tied to embedded Scala.", + "dependencies" : [], + "isServerSideOnly" : false +} From 77c7f771face534cd355f9946fc7ab0d5aa4f90d Mon Sep 17 00:00:00 2001 From: bbarker Date: Sun, 29 Oct 2017 21:36:30 -0400 Subject: [PATCH 3/3] typo fox; added version to hello for better runtime info --- module.txt | 2 +- src/main/scala/org/terasology/ScalaCommands.scala | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/module.txt b/module.txt index 5be3aea..558079e 100644 --- a/module.txt +++ b/module.txt @@ -4,7 +4,7 @@ "version" : "2.11.7-SNAPSHOT", "author" : "skaldarnar", "displayName" : "Scala Runtime Library Module", - "description" : "Library module that supplies the Kotlin runtime library. See www.scala-lang.org. Version tied to embedded Scala.", + "description" : "Library module that supplies the Scala runtime library. See www.scala-lang.org. Version tied to embedded Scala.", "dependencies" : [], "isServerSideOnly" : false } diff --git a/src/main/scala/org/terasology/ScalaCommands.scala b/src/main/scala/org/terasology/ScalaCommands.scala index f224fd7..c3746d0 100644 --- a/src/main/scala/org/terasology/ScalaCommands.scala +++ b/src/main/scala/org/terasology/ScalaCommands.scala @@ -6,6 +6,8 @@ import org.terasology.logic.console.commandSystem.annotations.Command @RegisterSystem class ScalaCommands extends BaseComponentSystem { + val scalaVersion = scala.util.Properties.versionString + @Command(shortDescription = "Scala test command", runOnServer = false) - def helloScala() = "Hello there, this is Scala =)" + def helloScala() = s"Hello there, this is Scala $scalaVersion =)" }