diff --git a/build.gradle b/build.gradle.kts similarity index 50% rename from build.gradle rename to build.gradle.kts index c9c3127..29ee6ce 100644 --- a/build.gradle +++ b/build.gradle.kts @@ -1,12 +1,10 @@ -apply plugin: 'idea' - -wrapper { - gradleVersion = '6.8.2' +plugins { + idea apply true } // Using this instead of allprojects allows this project to be embedded yet not affect parent projects -group = 'org.terasology' +group = "org.terasology" subprojects { - group = 'org.terasology.rust' + group = "org.terasology.rust" } \ No newline at end of file diff --git a/core-rust/build.gradle b/core-rust/build.gradle deleted file mode 100644 index 340bf91..0000000 --- a/core-rust/build.gradle +++ /dev/null @@ -1,169 +0,0 @@ -plugins { - id 'base' - id 'maven-publish' -} - -//configurations { -// rust -//} -// -//dependencies { -// rust(fileTree('natives') { include "*.rs"}) -//} - -import org.apache.tools.ant.taskdefs.condition.Os -ext { - if(Os.isFamily(Os.FAMILY_MAC)) { -// natives = ["macosx_amd64_clang"] - } else if (Os.isFamily(Os.FAMILY_UNIX)) { - natives = [ - [target: "x86_64-unknown-linux-gnu", module: "linux-amd64"] - ] - } else if (Os.isFamily(Os.FAMILY_WINDOWS)) { - natives = [ - [target: "x86_64-pc-windows-msvc", "module": "windows-amd64"] - ] - } else { - throw new GradleException("Unsupported platform") - } - - baseDir = "$rootDir/core-rust" -} - -version = "0.0.1" -group = "org.terasology.rust" - -// We use both Maven Central and our own Artifactory instance, which contains module builds, extra libs, and so on -repositories { - mavenCentral() - - // Terasology Artifactory instance for libs not readily available elsewhere plus our own libs - maven { - def repoViaEnv = System.getenv()["RESOLUTION_REPO"] - if (rootProject.hasProperty("alternativeResolutionRepo")) { - // If the user supplies an alternative repo via gradle.properties then use that - name "from alternativeResolutionRepo property" - url alternativeResolutionRepo - } else if (repoViaEnv != null && repoViaEnv != "") { - name "from \$RESOLUTION_REPO" - url = repoViaEnv - } else { - // Our default is the main virtual repo containing everything except repos for testing Artifactory itself - name "Terasology Artifactory" - url "http://artifactory.terasology.org/artifactory/virtual-repo-live" - allowInsecureProtocol true // 😱 - } - } -} - - -natives.each { module -> - tasks.create(name: "native_${module["target"]}", type: Exec) { - description = "cargo ${module["target"]} " - executable "cargo" - workingDir "$baseDir/natives" - args "build", "--target=${module["target"]}" - doFirst { - mkdir "$baseDir/build/natives" - } - doLast { - copy { - from "$baseDir/natives/target/${module["target"]}/debug" - include '*.so' - include '*.dll' - rename '(.+).so', "\$1-${module["module"]}.so" - rename '(.+).dll', "lib\$1-${module["module"]}.dll" - into "$baseDir/build/natives" - } - } - } -} - -task buildNatives{ - dependsOn fileTree("$baseDir/natives") // Input directory containing the source files - description = "Builds Natives" - natives.each { module -> - dependsOn "native_${module["target"]}" - } -} - -// TODO: outputs are not defined well enough yet for Gradle to skip this if already done (maybe more the natives task?) -task zipNatives(type: Zip){ - description 'Creates a zip archive that contains all TeraBullet native files' - from ("$baseDir/build/natives") { - include '*linux*' - into "linux" - } - - from ("$baseDir/build/natives") { - include '*osx*' - into "macosx" - } - - from ("$baseDir/build/natives") { - include '*windows*' - into "windows" - } - - destinationDirectory = file(buildDir) - archiveBaseName = 'core-rust' -} - -zipNatives.dependsOn buildNatives - -artifacts.add('default', zipNatives) - -publish { - dependsOn zipNatives -} - -// Define the artifacts we want to publish (the .pom will also be included since the Maven plugin is active) -publishing { - publications { - "TeraRustyCoreRust"(MavenPublication) { - // Without this we get a .pom with no dependencies - artifact zipNatives - - repositories { - maven { - name = 'TerasologyOrg' - allowInsecureProtocol true // 😱 - no https on our Artifactory yet - - if (rootProject.hasProperty("publishRepo")) { - // This first option is good for local testing, you can set a full explicit target repo in gradle.properties - url = "http://artifactory.terasology.org/artifactory/$publishRepo" - - logger.info("Changing PUBLISH repoKey set via Gradle property to {}", publishRepo) - } else { - // Support override from the environment to use a different target publish org - String deducedPublishRepo = System.getenv()["PUBLISH_ORG"] - if (deducedPublishRepo == null || deducedPublishRepo == "") { - // If not then default - deducedPublishRepo = "libs" - } - - // Base final publish repo on whether we're building a snapshot or a release - if (project.version.endsWith('SNAPSHOT')) { - deducedPublishRepo += "-snapshot-local" - } else { - deducedPublishRepo += "-release-local" - } - - logger.info("The final deduced publish repo is {}", deducedPublishRepo) - url = "http://artifactory.terasology.org/artifactory/$deducedPublishRepo" - } - - if (rootProject.hasProperty("mavenUser") && rootProject.hasProperty("mavenPass")) { - credentials { - username = "$mavenUser" - password = "$mavenPass" - } - authentication { - basic(BasicAuthentication) - } - } - } - } - } - } -} \ No newline at end of file diff --git a/core-rust/build.gradle.kts b/core-rust/build.gradle.kts new file mode 100644 index 0000000..cb14585 --- /dev/null +++ b/core-rust/build.gradle.kts @@ -0,0 +1,177 @@ +import org.apache.tools.ant.taskdefs.condition.Os +import java.net.URI + +plugins { + id("base") + id("maven-publish") +} + +//configurations { +// rust +//} +// +//dependencies { +// rust(fileTree("natives") { include ("*.rs")}) +//} + +val natives = mutableMapOf() +val baseDir = projectDir.toString() + + +ext { + if (Os.isFamily(Os.FAMILY_MAC)) { +// natives = listOf("macosx_amd64_clang") + } else if (Os.isFamily(Os.FAMILY_UNIX)) { + natives["target"] = "x86_64-unknown-linux-gnu" + natives["module"] = "linux-amd64" + } else if (Os.isFamily(Os.FAMILY_WINDOWS)) { + natives["target"] = "x86_64-pc-windows-msvc" + natives["module"] = "windows-amd64" + } else { + throw GradleException("Unsupported platform") + } +} + +version = "0.0.1" +group = "org.terasology.rust" + +// We use both Maven Central and our own Artifactory instance, which contains module builds, extra libs, and so on +repositories { + mavenCentral() + + // Terasology Artifactory instance for libs not readily available elsewhere plus our own libs + maven { + val repoViaEnv = System.getenv()["RESOLUTION_REPO"] + if (rootProject.hasProperty("alternativeResolutionRepo")) { + // If the user supplies an alternative repo via gradle.properties then use that + name = "from alternativeResolutionRepo property" + url = URI(properties["alternativeResolutionRepo"].toString()) + } else if (repoViaEnv != null && repoViaEnv != "") { + name = "from \$RESOLUTION_REPO" + url = URI(repoViaEnv) + } else { + // Our default is the main virtual repo containing everything except repos for testing Artifactory itself + name = "Terasology Artifactory" + url = URI("http://artifactory.terasology.org/artifactory/virtual-repo-live") + isAllowInsecureProtocol = true + } + } +} + +tasks.register(name = "native_${natives["target"]}") { + description = "cargo ${natives["target"]} " + executable = "cargo" + workingDir("$baseDir/natives") + args = listOf("build", "--target=${natives["target"]}") + doFirst { + mkdir("$baseDir/build/natives") + } + doLast { + copy { + from("$baseDir/natives/target/${natives["target"]}/debug") + include("*.so") + include("*.dll") + rename("(.+).so", "\$1-${natives["module"]}.so") + rename("(.+).dll", "lib\$1-${natives["module"]}.dll") + into("$baseDir/build/natives") + } + } +} + + +tasks.register("buildNatives") { + description = "Builds Natives" + dependsOn(fileTree("$baseDir/natives")) // Input directory containing the source files + dependsOn("native_${natives["target"]}") +} + +// TODO: outputs are not defined well enough yet for Gradle to skip this if already done (maybe more the natives task?) +val zipNatives by tasks.creating(Zip::class) { + description = "Creates a zip archive that contains all TeraBullet native files" + dependsOn("buildNatives") + + from("$baseDir/build/natives") { + include("*linux*") + into("linux") + } + + from("$baseDir/build/natives") { + include("*osx*") + into("macosx") + } + + from("$baseDir/build/natives") { + include("*windows*") + into("windows") + } + + destinationDirectory.set(file(layout.buildDirectory)) + archiveBaseName.set("core-rust") +} + +artifacts.add("default", zipNatives) + +tasks.getByName("publish") { + dependsOn("zipNatives") +} + +tasks.build { + dependsOn("buildNatives") + dependsOn("zipNatives") +} + +// Define the artifacts we want to publish (the .pom will also be included since the Maven plugin is active) + +publishing { + publications { + create("TeraRustyCoreRust") { + artifact(zipNatives) + repositories { + maven { + name = "TerasologyOrg" + isAllowInsecureProtocol = true + if (project.hasProperty("publishRepo")) { + val publishRepo = project.property("publishRepo") + // This first option is good for local testing, you can set a full explicit target repo in gradle.properties + url = URI("http://artifactory.terasology.org/artifactory/$publishRepo") + logger.info("Changing PUBLISH repoKey set via Gradle property to $publishRepo") + } else { + // Support override from the environment to use a different target publish org + var deducedPublishRepo: String? = System.getenv()["PUBLISH_ORG"] + if (deducedPublishRepo.isNullOrEmpty()) { + // If not then default + deducedPublishRepo = "libs" + } + + // Base final publish repo on whether we're building a snapshot or a release + + if (project.version.toString().endsWith("SNAPSHOT")) { + deducedPublishRepo += "-snapshot-local" + } else { + deducedPublishRepo += "-release-local" + } + + logger.info("The final deduced publish repo is {}", deducedPublishRepo) + url = URI("http://artifactory.terasology.org/artifactory/$deducedPublishRepo") + } + if (project.hasProperty("mavenUser") && project.hasProperty("mavenPass")) { + credentials { + val mavenUser = + project.property("mavenUser") as? String + ?: throw RuntimeException("Not a valid maven user") + val mavenPass = + project.property("mavenPass") as? String + ?: throw RuntimeException("Not a valid maven pass") + username = mavenUser + password = mavenPass + + authentication { + create("basic") + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/core/build.gradle b/core/build.gradle deleted file mode 100644 index 7eebd70..0000000 --- a/core/build.gradle +++ /dev/null @@ -1,142 +0,0 @@ -plugins { - id 'base' - id 'java-library' - id 'maven-publish' -} - -ext { - baseDir = "$rootDir/core" -} - -dependencies { - api group: 'org.joml', name: 'joml', version: '1.10.0' - api group: 'org.slf4j', name: 'slf4j-api', version: '1.7.21' - api group: 'net.sf.trove4j', name: 'trove4j', version: '3.0.3' - api group: 'org.terasology.joml-ext', name: 'joml-geometry', version: '0.1.0' -} - - -version = "0.0.1" -group = "org.terasology.rust" - -// We use both Maven Central and our own Artifactory instance, which contains module builds, extra libs, and so on -repositories { - mavenCentral() - - // Terasology Artifactory instance for libs not readily available elsewhere plus our own libs - maven { - def repoViaEnv = System.getenv()["RESOLUTION_REPO"] - if (rootProject.hasProperty("alternativeResolutionRepo")) { - // If the user supplies an alternative repo via gradle.properties then use that - name "from alternativeResolutionRepo property" - url alternativeResolutionRepo - } else if (repoViaEnv != null && repoViaEnv != "") { - name "from \$RESOLUTION_REPO" - url = repoViaEnv - } else { - // Our default is the main virtual repo containing everything except repos for testing Artifactory itself - name "Terasology Artifactory" - url "http://artifactory.terasology.org/artifactory/virtual-repo-live" - allowInsecureProtocol true // 😱 - } - } -} - -javadoc { - failOnError = false -} - -task sourceJar(type: Jar) { - description = "Create a JAR with all sources" - from sourceSets.main.allSource - from sourceSets.test.allSource -} - -task javadocJar(type: Jar, dependsOn: javadoc) { - description = "Create a JAR with the JavaDoc for the java sources" - from javadoc.destinationDir -} - -publish { - dependsOn sourceJar, javadocJar -} - -// Define the artifacts we want to publish (the .pom will also be included since the Maven plugin is active) -publishing { - publications { - "TeraRustyCore"(MavenPublication) { - // Without this we get a .pom with no dependencies - from components.java - - artifact sourceJar - artifact javadocJar - - pom.withXml { - asNode().with { - appendNode('name', "core") - appendNode('description', "A Java Native Terasology Core Wrapper") - appendNode('url', "http://www.example.com/project") - appendNode('licenses').with { - appendNode('license').with { - appendNode('name', "The Apache License, Version 2.0") - appendNode('url', "http://www.apache.org/licenses/LICENSE-2.0.txt") - } - } - appendNode('developers').with { - appendNode('developer').with { - appendNode('id', "michaelpollind") - appendNode('name', "Michael Pollind") - appendNode('email', "mpollind@gmail.com") - } - } - appendNode('scm').with { - appendNode('connection', "https://github.com/MovingBlocks/JNBullet") - appendNode('developerConnection', "git@github.com:MovingBlocks/JNBullet.git") - appendNode('url', "https://github.com/MovingBlocks/JNBullet") - } - } - } - - repositories { - maven { - name = 'TerasologyOrg' - allowInsecureProtocol true // 😱 - no https on our Artifactory yet - - if (rootProject.hasProperty("publishRepo")) { - // This first option is good for local testing, you can set a full explicit target repo in gradle.properties - url = "http://artifactory.terasology.org/artifactory/$publishRepo" - - logger.info("Changing PUBLISH repoKey set via Gradle property to {}", publishRepo) - } else { - // Support override from the environment to use a different target publish org - String deducedPublishRepo = System.getenv()["PUBLISH_ORG"] - if (deducedPublishRepo == null || deducedPublishRepo == "") { - // If not then default - deducedPublishRepo = "libs" - } - - // Base final publish repo on whether we're building a snapshot or a release - if (project.version.endsWith('SNAPSHOT')) { - deducedPublishRepo += "-snapshot-local" - } else { - deducedPublishRepo += "-release-local" - } - - logger.info("The final deduced publish repo is {}", deducedPublishRepo) - url = "http://artifactory.terasology.org/artifactory/$deducedPublishRepo" - } - - if (rootProject.hasProperty("mavenUser") && rootProject.hasProperty("mavenPass")) { - credentials { - username = "$mavenUser" - password = "$mavenPass" - } - authentication { - basic(BasicAuthentication) - } - } - } - } - } - } -} \ No newline at end of file diff --git a/core/build.gradle.kts b/core/build.gradle.kts new file mode 100644 index 0000000..ef36e4a --- /dev/null +++ b/core/build.gradle.kts @@ -0,0 +1,144 @@ +import java.net.URI + +plugins { + id("base") + id("java-library") + id("maven-publish") +} + +val baseDir = projectDir.toString() + +dependencies { + api("org.joml:joml:1.10.0") + api("org.slf4j:slf4j-api:1.7.21") + api("net.sf.trove4j:trove4j:3.0.3") + api("org.terasology.joml-ext:joml-geometry:0.1.0") +} + + +version = "0.0.1" +group = "org.terasology.rust" + +// We use both Maven Central and our own Artifactory instance, which contains module builds, extra libs, and so on +repositories { + mavenCentral() + // Terasology Artifactory instance for libs not readily available elsewhere plus our own libs + maven { + val repoViaEnv = System.getenv()["RESOLUTION_REPO"] + if (rootProject.hasProperty("alternativeResolutionRepo")) { + // If the user supplies an alternative repo via gradle.properties then use that + name = "from alternativeResolutionRepo property" + url = URI(properties["alternativeResolutionRepo"].toString()) + } else if (repoViaEnv != null && repoViaEnv != "") { + name = "from \$RESOLUTION_REPO" + url = URI(repoViaEnv) + } else { + // Our default is the main virtual repo containing everything except repos for testing Artifactory itself + name = "Terasology Artifactory" + url = URI("http://artifactory.terasology.org/artifactory/virtual-repo-live") + isAllowInsecureProtocol = true + } + } +} + +val doctask by tasks.creating(Javadoc::class) { + isFailOnError = false +} + +val javaDocJar by tasks.creating(Jar::class) { + archiveClassifier.set("javadoc") + dependsOn(doctask) + description = "Create a JAR with the JavaDoc for the java sources" + from(doctask.destinationDir) +} + +val sourceJar by tasks.creating(Jar::class) { + archiveClassifier.set("sources") + description = "Create a JAR with all sources" + from(sourceSets.main.get().allSource) + from(sourceSets.test.get().allSource) +} + +tasks.getByName("publish") { + dependsOn(sourceJar, javaDocJar) +} + +publishing { + publications { + create("TeraRustyCore") { + // Without this we get a .pom with no dependencies + from(components["java"]) + artifacts { + artifact(sourceJar) + artifact(javaDocJar) + } + pom.withXml { + asNode().apply { + appendNode("name", "core") + appendNode("description", "A Java Native Terasology Core Wrapper") + appendNode("url", "http://www.example.com/project") + appendNode("licenses").appendNode("license").apply { + appendNode("name", "The Apache License, Version 2.0") + appendNode("url", "http://www.apache.org/licenses/LICENSE-2.0.txt") + } + appendNode("developers").appendNode("developer").apply { + appendNode("id", "michaelpollind") + appendNode("name", "Michael Pollind") + appendNode("email", "mpollind@gmail.com") + } + appendNode("scm").apply { + appendNode("connection", "https://github.com/MovingBlocks/JNBullet") + appendNode("developerConnection", "git@github.com:MovingBlocks/JNBullet.git") + appendNode("url", "https://github.com/MovingBlocks/JNBullet") + } + } + } + repositories { + maven { + name = "TerasologyOrg" + isAllowInsecureProtocol = true + if (project.hasProperty("publishRepo")) { + val publishRepo = project.property("publishRepo") + // This first option is good for local testing, you can set a full explicit target repo in gradle.properties + url = URI("http://artifactory.terasology.org/artifactory/$publishRepo") + logger.info("Changing PUBLISH repoKey set via Gradle property to $publishRepo") + } else { + // Support override from the environment to use a different target publish org + var deducedPublishRepo: String? = System.getenv()["PUBLISH_ORG"] + if (deducedPublishRepo.isNullOrEmpty()) { + // If not then default + deducedPublishRepo = "libs" + } + + // Base final publish repo on whether we're building a snapshot or a release + + if (project.version.toString().endsWith("SNAPSHOT")) { + deducedPublishRepo += "-snapshot-local" + } else { + deducedPublishRepo += "-release-local" + } + + logger.info("The final deduced publish repo is {}", deducedPublishRepo) + url = URI("http://artifactory.terasology.org/artifactory/$deducedPublishRepo") + } + if (project.hasProperty("mavenUser") && project.hasProperty("mavenPass")) { + credentials { + val mavenUser = + project.property("mavenUser") as? String + ?: throw RuntimeException("Not a valid maven user") + val mavenPass = + project.property("mavenPass") as? String + ?: throw RuntimeException("Not a valid maven pass") + username = mavenUser + password = mavenPass + + authentication { + create("basic") + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7454180..7f93135 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ae04661..d11cdd9 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index a69d9cb..0adc8e1 100755 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,13 +80,11 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,22 +131,29 @@ 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. + if ! command -v java >/dev/null 2>&1 + then + 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 fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -193,6 +198,10 @@ if "$cygwin" || "$msys" ; then done fi + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + # Collect all arguments for the java command; # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of # shell script including quotes and variable substitutions, so put them in diff --git a/gradlew.bat b/gradlew.bat index 53a6b23..6689b85 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 06ad3d5..0000000 --- a/settings.gradle +++ /dev/null @@ -1,17 +0,0 @@ - -pluginManagement.repositories { - mavenLocal() - gradlePluginPortal() -} - -println "rootProject is: " + rootProject.name - -if (rootProject.name == 'Terasology') { - println "TeraRusty is embedded within Terasology, using nested paths" - include ':libs:TeraRusty:core' - include ':libs:TeraRusty:core-rust' -} else { - println "TeraRusty is running standalone so using simple paths for includes" - include "core" - include "core-rust" -} \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000..1b7ad23 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,18 @@ +pluginManagement { + repositories { + mavenLocal() + gradlePluginPortal() + } +} + +println("rootProject is: " + rootProject.name) + +if (rootProject.name == "Terasology") { + println("TeraRusty is embedded within Terasology, using nested paths") + include (":libs:TeraRusty:core") + include (":libs:TeraRusty:core-rust") +} else { + println("TeraRusty is running standalone so using simple paths for includes") + include("core") + include("core-rust") +} \ No newline at end of file