Use latest fancy gradle features to not do that dumb string bullshit from before

Signed-off-by: solonovamax <solonovamax@12oclockpoint.com>
This commit is contained in:
solonovamax
2021-11-21 23:58:24 -05:00
parent 7e0fa4854f
commit dc07b60688
33 changed files with 88 additions and 84 deletions

View File

@@ -9,6 +9,6 @@ repositories {
}
dependencies {
"implementation"("gradle.plugin.com.github.jengelman.gradle.plugins:shadow:+")
"implementation"("org.yaml:snakeyaml:1.27")
implementation("gradle.plugin.com.github.jengelman.gradle.plugins:shadow:+")
implementation("org.yaml:snakeyaml:1.27")
}

View File

@@ -2,8 +2,10 @@ package com.dfsek.terra
import org.gradle.api.Project
import org.gradle.kotlin.dsl.apply
import org.gradle.kotlin.dsl.creating
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.invoke
import org.gradle.kotlin.dsl.getValue
import org.gradle.kotlin.dsl.getting
import org.gradle.kotlin.dsl.project
import org.gradle.kotlin.dsl.repositories
@@ -11,14 +13,18 @@ fun Project.configureDependencies() {
apply(plugin = "java")
apply(plugin = "java-library")
configurations {
val shaded = create("shaded")
val shadedApi = create("shadedApi")
shaded.extendsFrom(shadedApi)
getByName("api").extendsFrom(shadedApi)
val shadedImplementation = create("shadedImplementation")
shaded.extendsFrom(shadedImplementation)
getByName("implementation").extendsFrom(shadedImplementation)
val api by configurations.getting
val implementation by configurations.getting
val testImplementation by configurations.getting
val compileOnly by configurations.getting
val shaded by configurations.creating
val shadedApi by configurations.creating {
shaded.extendsFrom(this)
api.extendsFrom(this)
}
val shadedImplementation by configurations.creating {
implementation.extendsFrom(this)
}
repositories {
@@ -31,18 +37,18 @@ fun Project.configureDependencies() {
}
dependencies {
"testImplementation"("org.junit.jupiter:junit-jupiter-api:5.7.0")
"testImplementation"("org.junit.jupiter:junit-jupiter-engine:5.7.0")
"compileOnly"("org.jetbrains:annotations:20.1.0")
"compileOnly"("com.google.guava:guava:30.0-jre")
"testImplementation"("com.google.guava:guava:30.0-jre")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.0")
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.7.0")
compileOnly("org.jetbrains:annotations:20.1.0")
compileOnly("com.google.guava:guava:30.0-jre")
testImplementation("com.google.guava:guava:30.0-jre")
}
if (project(":common:addons").subprojects.contains(this)) { // If this is an addon project, depend on the API.
dependencies {
"compileOnly"(project(":common:api"))
"testImplementation"(project(":common:api"))
compileOnly(project(":common:api"))
testImplementation(project(":common:api"))
}
}
}

View File

@@ -1,3 +1,3 @@
dependencies {
"shadedApi"(project(":common:addons:manifest-addon-loader"))
shadedApi(project(":common:addons:manifest-addon-loader"))
}

View File

@@ -1,3 +1,3 @@
dependencies {
"shadedApi"(project(":common:addons:manifest-addon-loader"))
shadedApi(project(":common:addons:manifest-addon-loader"))
}

View File

@@ -1,3 +1,3 @@
dependencies {
"shadedApi"(project(":common:addons:manifest-addon-loader"))
shadedApi(project(":common:addons:manifest-addon-loader"))
}

View File

@@ -1,3 +1,3 @@
dependencies {
"shadedApi"(project(":common:addons:manifest-addon-loader"))
shadedApi(project(":common:addons:manifest-addon-loader"))
}

View File

@@ -1,3 +1,3 @@
dependencies {
"shadedApi"(project(":common:addons:manifest-addon-loader"))
shadedApi(project(":common:addons:manifest-addon-loader"))
}

View File

@@ -1,3 +1,3 @@
dependencies {
"shadedApi"(project(":common:addons:manifest-addon-loader"))
shadedApi(project(":common:addons:manifest-addon-loader"))
}

View File

@@ -1,3 +1,3 @@
dependencies {
"shadedApi"(project(":common:addons:manifest-addon-loader"))
shadedApi(project(":common:addons:manifest-addon-loader"))
}

View File

@@ -1,3 +1,3 @@
dependencies {
"shadedApi"(project(":common:addons:manifest-addon-loader"))
shadedApi(project(":common:addons:manifest-addon-loader"))
}

View File

@@ -1,3 +1,3 @@
dependencies {
"shadedApi"(project(":common:addons:manifest-addon-loader"))
shadedApi(project(":common:addons:manifest-addon-loader"))
}

View File

@@ -1,3 +1,3 @@
dependencies {
"shadedApi"(project(":common:addons:manifest-addon-loader"))
shadedApi(project(":common:addons:manifest-addon-loader"))
}

View File

@@ -1,3 +1,3 @@
dependencies {
"shadedApi"(project(":common:addons:manifest-addon-loader"))
shadedApi(project(":common:addons:manifest-addon-loader"))
}

View File

@@ -1,3 +1,3 @@
dependencies {
"shadedApi"(project(":common:addons:manifest-addon-loader"))
shadedApi(project(":common:addons:manifest-addon-loader"))
}

View File

@@ -1,3 +1,3 @@
dependencies {
"shadedApi"(project(":common:addons:manifest-addon-loader"))
shadedApi(project(":common:addons:manifest-addon-loader"))
}

View File

@@ -1,4 +1,4 @@
dependencies {
"shadedApi"("com.googlecode.json-simple:json-simple:1.1.1")
"shadedApi"(project(":common:addons:manifest-addon-loader"))
shadedApi("com.googlecode.json-simple:json-simple:1.1.1")
shadedApi(project(":common:addons:manifest-addon-loader"))
}

View File

@@ -1,3 +1,3 @@
dependencies {
"shadedApi"(project(":common:addons:manifest-addon-loader"))
shadedApi(project(":common:addons:manifest-addon-loader"))
}

View File

@@ -1,3 +1,3 @@
dependencies {
"shadedApi"(project(":common:addons:manifest-addon-loader"))
shadedApi(project(":common:addons:manifest-addon-loader"))
}

View File

@@ -1,4 +1,4 @@
dependencies {
"shadedImplementation"("com.dfsek.tectonic:yaml:2.1.2")
"shadedApi"(project(":common:addons:manifest-addon-loader"))
shadedImplementation("com.dfsek.tectonic:yaml:2.1.2")
shadedApi(project(":common:addons:manifest-addon-loader"))
}

View File

@@ -1,6 +1,6 @@
dependencies {
"shadedApi"("commons-io:commons-io:2.6")
"shadedImplementation"("com.dfsek.tectonic:yaml:2.1.2")
shadedApi("commons-io:commons-io:2.6")
shadedImplementation("com.dfsek.tectonic:yaml:2.1.2")
}
tasks.withType<Jar> {

View File

@@ -9,9 +9,9 @@ repositories {
}
dependencies {
"shadedApi"("commons-io:commons-io:2.6")
"shadedApi"("com.github.Querz:NBT:6.1")
"shadedApi"(project(":common:addons:manifest-addon-loader"))
shadedApi("commons-io:commons-io:2.6")
shadedApi("com.github.Querz:NBT:6.1")
shadedApi(project(":common:addons:manifest-addon-loader"))
}
tasks.named<ShadowJar>("shadowJar") {

View File

@@ -5,8 +5,8 @@ plugins {
}
dependencies {
"shadedApi"("commons-io:commons-io:2.6")
"shadedApi"(project(":common:addons:manifest-addon-loader"))
shadedApi("commons-io:commons-io:2.6")
shadedApi(project(":common:addons:manifest-addon-loader"))
}
tasks.named<ShadowJar>("shadowJar") {

View File

@@ -1,4 +1,4 @@
dependencies {
"shadedApi"(project(":common:api:util"))
"shadedApi"("ca.solo-studios:strata:1.0.0")
shadedApi(project(":common:api:util"))
shadedApi("ca.solo-studios:strata:1.0.0")
}

View File

@@ -3,7 +3,7 @@ afterEvaluate {
if(it != project) {
println("Project: ${it.name}")
dependencies {
"shadedApi"(it)
shadedApi(it)
}
}
}

View File

@@ -1,17 +1,17 @@
dependencies {
"shadedApi"(project(":common:api:util"))
"shadedApi"(project(":common:api:noise"))
"shadedApi"(project(":common:api:registry"))
"shadedApi"(project(":common:api:addons"))
shadedApi(project(":common:api:util"))
shadedApi(project(":common:api:noise"))
shadedApi(project(":common:api:registry"))
shadedApi(project(":common:api:addons"))
"shadedApi"("com.dfsek:Paralithic:0.5.0")
shadedApi("com.dfsek:Paralithic:0.5.0")
"shadedApi"("com.dfsek.tectonic:common:2.1.2")
shadedApi("com.dfsek.tectonic:common:2.1.2")
"shadedApi"("net.jafama:jafama:2.3.2")
shadedApi("net.jafama:jafama:2.3.2")
"shadedApi"("org.slf4j:slf4j-api:1.7.32")
shadedApi("org.slf4j:slf4j-api:1.7.32")
"shadedApi"("ca.solo-studios:strata:1.0.0")
shadedApi("ca.solo-studios:strata:1.0.0")
}

View File

@@ -1,10 +1,10 @@
dependencies {
"shadedApi"(project(":common:api:util"))
shadedApi(project(":common:api:util"))
"shadedApi"("com.dfsek:Paralithic:0.5.0")
shadedApi("com.dfsek:Paralithic:0.5.0")
"shadedApi"("com.dfsek.tectonic:common:2.1.2")
shadedApi("com.dfsek.tectonic:common:2.1.2")
"shadedApi"("net.jafama:jafama:2.3.2")
shadedApi("net.jafama:jafama:2.3.2")
}

View File

@@ -1,10 +1,10 @@
dependencies {
"shadedApi"(project(":common:api:util"))
shadedApi(project(":common:api:util"))
"shadedApi"("com.dfsek:Paralithic:0.5.0")
shadedApi("com.dfsek:Paralithic:0.5.0")
"shadedApi"("com.dfsek.tectonic:common:2.1.2")
shadedApi("com.dfsek.tectonic:common:2.1.2")
"shadedApi"("net.jafama:jafama:2.3.2")
shadedApi("net.jafama:jafama:2.3.2")
}

View File

@@ -1,6 +1,6 @@
dependencies {
"shadedApi"(project(":common:api:util"))
shadedApi(project(":common:api:util"))
"shadedApi"("com.dfsek.tectonic:common:2.1.2")
shadedApi("com.dfsek.tectonic:common:2.1.2")
}

View File

@@ -1,4 +1,4 @@
dependencies {
"shadedApi"("net.jafama:jafama:2.3.2")
shadedApi("net.jafama:jafama:2.3.2")
}

View File

@@ -15,18 +15,16 @@ val paperURL = "https://papermc.io/api/v1/paper/%version%/latest/download/"
val purpurURL = "https://ci.pl3x.net/job/Purpur/lastSuccessfulBuild/artifact/final/purpurclip.jar"
dependencies {
"shadedApi"(project(":common:implementation:base"))
shadedApi(project(":common:implementation:base"))
shadedImplementation("org.slf4j:slf4j-log4j12:1.7.32")
"compileOnly"("io.papermc.paper:paper-api:1.17-R0.1-SNAPSHOT")
"shadedImplementation"("io.papermc:paperlib:1.0.5")
compileOnly("io.papermc.paper:paper-api:1.17-R0.1-SNAPSHOT")
shadedImplementation("io.papermc:paperlib:1.0.5")
"shadedImplementation"("org.bstats:bstats-bukkit:1.7")
shadedImplementation("org.bstats:bstats-bukkit:1.7")
"compileOnly"("com.sk89q.worldedit:worldedit-bukkit:7.2.0-SNAPSHOT")
"shadedApi"("com.google.guava:guava:30.0-jre")
shadedApi("com.google.guava:guava:30.0-jre")
}
val jvmFlags = listOf(

View File

@@ -22,14 +22,14 @@ val fabricLoader = "0.12.5"
dependencies {
"shadedApi"(project(":common:implementation:base"))
shadedApi(project(":common:implementation:base"))
shadedImplementation("org.slf4j:slf4j-log4j12:1.7.32")
// shadedImplementation("org.apache.logging.log4j:log4j-slf4j-impl:2.8.1")
"minecraft"("com.mojang:minecraft:$minecraft")
"mappings"("net.fabricmc:yarn:$minecraft+build.$yarn:v2")
"modImplementation"("net.fabricmc:fabric-loader:$fabricLoader")
minecraft("com.mojang:minecraft:$minecraft")
mappings("net.fabricmc:yarn:$minecraft+build.$yarn:v2")
modImplementation("net.fabricmc:fabric-loader:$fabricLoader")
}
tasks.withType<JavaCompile>().configureEach {

View File

@@ -3,7 +3,7 @@ val platformOverrides = mapOf(
)
dependencies {
"shadedApi"(project(":common:implementation"))
shadedApi(project(":common:implementation"))
}
val taskSet = HashSet<AbstractArchiveTask>()

View File

@@ -9,14 +9,14 @@ repositories {
}
dependencies {
"shadedApi"(project(":common:implementation:base"))
shadedApi(project(":common:implementation:base"))
shadedImplementation("org.slf4j:slf4j-log4j12:1.7.32")
// "shadedImplementation"("org.apache.logging.log4j:log4j-slf4j-impl:2.8.1")
"annotationProcessor"("org.spongepowered:spongeapi:9.0.0-SNAPSHOT")
"shadedImplementation"("org.spongepowered:spongeapi:9.0.0-SNAPSHOT")
"annotationProcessor"("org.spongepowered:mixin:0.8.2:processor")
annotationProcessor("org.spongepowered:spongeapi:9.0.0-SNAPSHOT")
shadedImplementation("org.spongepowered:spongeapi:9.0.0-SNAPSHOT")
annotationProcessor("org.spongepowered:mixin:0.8.2:processor")
}
minecraft {