From 8a3126f14ed0e95cb8c603c053dcf90c8a0b20df Mon Sep 17 00:00:00 2001 From: powercas_gamer Date: Sat, 2 Dec 2023 17:56:13 +0100 Subject: [PATCH] BROKEN --- .../src/main/kotlin/gremlin-stuff.gradle.kts | 38 +++++++++++++++++++ paper/build.gradle.kts | 35 +---------------- .../mizule/timetriggeredperms/paper/TTP.kt | 3 -- velocity/build.gradle.kts | 33 +--------------- 4 files changed, 40 insertions(+), 69 deletions(-) create mode 100644 build-logic/src/main/kotlin/gremlin-stuff.gradle.kts diff --git a/build-logic/src/main/kotlin/gremlin-stuff.gradle.kts b/build-logic/src/main/kotlin/gremlin-stuff.gradle.kts new file mode 100644 index 0000000..34c8f2f --- /dev/null +++ b/build-logic/src/main/kotlin/gremlin-stuff.gradle.kts @@ -0,0 +1,38 @@ +plugins { + id("common-conventions") + id("xyz.jpenilla.gremlin-gradle") +} + +val runtimeDownloadOnlyApi by configurations.registering { + extendsFrom(configurations.compileOnlyApi.get()) + extendsFrom(configurations.runtimeDownload.get()) +} + +val runtimeDownloadApi by configurations.registering { + extendsFrom(configurations.api.get()) + extendsFrom(configurations.runtimeDownload.get()) +} + +dependencies { + implementation(libs.gremlin.runtime) + +} + +tasks.writeDependencies { + outputFileName.set("dependencies.txt") + repos.add("https://repo.papermc.io/repository/maven-public/") + repos.add("https://repo.maven.apache.org/maven2/") + repos.add("https://maven.mizule.dev/") + repos.add("https://maven.reposilite.com/snapshots/") + repos.add("https://maven.reposilite.com/releases/") +} + +gremlin { + defaultJarRelocatorDependencies.set(true) + defaultGremlinRuntimeDependency.set(false) +} + +configurations.runtimeDownload { + exclude("org.checkerframework", "checker-qual") + exclude("org.jetbrains", "annotations") +} diff --git a/paper/build.gradle.kts b/paper/build.gradle.kts index c33138a..9069c7f 100644 --- a/paper/build.gradle.kts +++ b/paper/build.gradle.kts @@ -1,28 +1,14 @@ -import java.util.* - plugins { id("common-conventions") id("kotlin-conventions") id("paper-conventions") - id("xyz.jpenilla.gremlin-gradle") -} - -fun DependencyHandler.runtimeDownloadApi(dependencyNotation: Any) { - api(dependencyNotation) - runtimeDownload(dependencyNotation) -} - -fun DependencyHandler.runtimeDownloadOnlyApi(dependencyNotation: Any) { - compileOnlyApi(dependencyNotation) - runtimeDownload(dependencyNotation) + id("gremlin-stuff") } dependencies { api(projects.timetriggeredpermsCore) compileOnly("io.papermc.paper:paper-api:1.20.2-R0.1-SNAPSHOT") - compileOnly("net.luckperms:api:5.4") implementation(libs.gremlin.runtime) - runtimeDownloadOnlyApi(kotlin("stdlib")) runtimeDownloadOnlyApi(kotlin("reflect")) runtimeDownloadOnlyApi("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") @@ -44,22 +30,3 @@ idea { isDownloadSources = true } } - -tasks.writeDependencies { - outputFileName.set("dependencies.txt") - repos.add("https://repo.papermc.io/repository/maven-public/") - repos.add("https://repo.maven.apache.org/maven2/") - repos.add("https://maven.mizule.dev/") - repos.add("https://maven.reposilite.com/snapshots/") - repos.add("https://maven.reposilite.com/releases/") -} - -gremlin { - defaultJarRelocatorDependencies.set(true) - defaultGremlinRuntimeDependency.set(false) -} - -configurations.runtimeDownload { - exclude("org.checkerframework", "checker-qual") - exclude("org.jetbrains", "annotations") -} diff --git a/paper/src/main/kotlin/dev/mizule/timetriggeredperms/paper/TTP.kt b/paper/src/main/kotlin/dev/mizule/timetriggeredperms/paper/TTP.kt index ff09863..d3c980d 100644 --- a/paper/src/main/kotlin/dev/mizule/timetriggeredperms/paper/TTP.kt +++ b/paper/src/main/kotlin/dev/mizule/timetriggeredperms/paper/TTP.kt @@ -33,9 +33,6 @@ import org.bstats.bukkit.Metrics import org.bukkit.Bukkit import org.bukkit.plugin.java.JavaPlugin import org.spongepowered.configurate.kotlin.extensions.get -import org.spongepowered.configurate.kotlin.objectMapperFactory -import org.spongepowered.configurate.yaml.NodeStyle -import org.spongepowered.configurate.yaml.YamlConfigurationLoader class TTP : JavaPlugin(), TTPPlugin { diff --git a/velocity/build.gradle.kts b/velocity/build.gradle.kts index bf28f06..9acb334 100644 --- a/velocity/build.gradle.kts +++ b/velocity/build.gradle.kts @@ -5,25 +5,13 @@ plugins { id("kotlin-conventions") id("velocity-conventions") kotlin("kapt") - id("xyz.jpenilla.gremlin-gradle") -} - -fun DependencyHandler.runtimeDownloadApi(dependencyNotation: Any) { - api(dependencyNotation) - runtimeDownload(dependencyNotation) -} - -fun DependencyHandler.runtimeDownloadOnlyApi(dependencyNotation: Any) { - compileOnlyApi(dependencyNotation) - runtimeDownload(dependencyNotation) + id("gremlin-stuff") } dependencies { api(projects.timetriggeredpermsCore) - compileOnly("net.luckperms:api:5.4") compileOnly("com.velocitypowered:velocity-api:3.2.0-SNAPSHOT") kapt("com.velocitypowered:velocity-api:3.2.0-SNAPSHOT") - implementation(libs.gremlin.runtime) runtimeDownloadOnlyApi(kotlin("stdlib")) runtimeDownloadOnlyApi(kotlin("reflect")) runtimeDownloadOnlyApi("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") @@ -45,22 +33,3 @@ idea { isDownloadSources = true } } - -tasks.writeDependencies { - outputFileName.set("dependencies.txt") - repos.add("https://repo.papermc.io/repository/maven-public/") - repos.add("https://repo.maven.apache.org/maven2/") - repos.add("https://maven.mizule.dev/") - repos.add("https://maven.reposilite.com/snapshots/") - repos.add("https://maven.reposilite.com/releases/") -} - -gremlin { - defaultJarRelocatorDependencies.set(true) - defaultGremlinRuntimeDependency.set(false) -} - -configurations.runtimeDownload { - exclude("org.checkerframework", "checker-qual") - exclude("org.jetbrains", "annotations") -}