From 9dc4e87fa8f1eca80c5ef52efe6513d1b05f8e46 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Mon, 15 Nov 2021 16:53:36 -0800 Subject: [PATCH] Use typesafe dependency accessors --- cloud-annotations/build.gradle.kts | 2 +- cloud-core/build.gradle.kts | 2 +- cloud-discord/cloud-javacord/build.gradle.kts | 2 +- cloud-discord/cloud-jda/build.gradle.kts | 2 +- cloud-irc/cloud-pircbotx/build.gradle.kts | 2 +- .../cloud-kotlin-coroutines-annotations/build.gradle.kts | 4 ++-- cloud-kotlin/cloud-kotlin-coroutines/build.gradle.kts | 6 +++--- cloud-kotlin/cloud-kotlin-extensions/build.gradle.kts | 2 +- cloud-minecraft/cloud-brigadier/build.gradle.kts | 2 +- cloud-minecraft/cloud-bukkit/build.gradle.kts | 6 +++--- cloud-minecraft/cloud-bungee/build.gradle.kts | 2 +- cloud-minecraft/cloud-cloudburst/build.gradle.kts | 2 +- cloud-minecraft/cloud-fabric/build.gradle.kts | 6 +++--- cloud-minecraft/cloud-minecraft-extras/build.gradle.kts | 2 +- cloud-minecraft/cloud-paper/build.gradle.kts | 2 +- cloud-minecraft/cloud-sponge7/build.gradle.kts | 2 +- cloud-minecraft/cloud-velocity/build.gradle.kts | 4 ++-- cloud-services/build.gradle.kts | 1 - settings.gradle.kts | 2 ++ 19 files changed, 27 insertions(+), 26 deletions(-) diff --git a/cloud-annotations/build.gradle.kts b/cloud-annotations/build.gradle.kts index d3782147..bbb02b05 100644 --- a/cloud-annotations/build.gradle.kts +++ b/cloud-annotations/build.gradle.kts @@ -1,3 +1,3 @@ dependencies { - implementation(project(":cloud-core")) + implementation(projects.cloudCore) } diff --git a/cloud-core/build.gradle.kts b/cloud-core/build.gradle.kts index da881344..3a866d6d 100644 --- a/cloud-core/build.gradle.kts +++ b/cloud-core/build.gradle.kts @@ -1,5 +1,5 @@ dependencies { - api(project(":cloud-services")) + api(projects.cloudServices) compileOnly("com.google.inject", "guice", Versions.guice) testImplementation("org.openjdk.jmh", "jmh-core", Versions.jmh) testImplementation("org.openjdk.jmh", "jmh-generator-annprocess", Versions.jmh) diff --git a/cloud-discord/cloud-javacord/build.gradle.kts b/cloud-discord/cloud-javacord/build.gradle.kts index 9a8b753d..af17c9c7 100644 --- a/cloud-discord/cloud-javacord/build.gradle.kts +++ b/cloud-discord/cloud-javacord/build.gradle.kts @@ -1,4 +1,4 @@ dependencies { - api(project(":cloud-core")) + api(projects.cloudCore) implementation("org.javacord", "javacord", Versions.javacord) } diff --git a/cloud-discord/cloud-jda/build.gradle.kts b/cloud-discord/cloud-jda/build.gradle.kts index b7706788..6a457e62 100644 --- a/cloud-discord/cloud-jda/build.gradle.kts +++ b/cloud-discord/cloud-jda/build.gradle.kts @@ -1,4 +1,4 @@ dependencies { - api(project(":cloud-core")) + api(projects.cloudCore) compileOnly ("net.dv8tion", "JDA", Versions.jda) } diff --git a/cloud-irc/cloud-pircbotx/build.gradle.kts b/cloud-irc/cloud-pircbotx/build.gradle.kts index 056ea729..9b95b038 100644 --- a/cloud-irc/cloud-pircbotx/build.gradle.kts +++ b/cloud-irc/cloud-pircbotx/build.gradle.kts @@ -1,4 +1,4 @@ dependencies { - api(project(":cloud-core")) + api(projects.cloudCore) implementation("com.github.pircbotx", "pircbotx", Versions.pircbotx) } diff --git a/cloud-kotlin/cloud-kotlin-coroutines-annotations/build.gradle.kts b/cloud-kotlin/cloud-kotlin-coroutines-annotations/build.gradle.kts index 04b06b55..24bf567a 100644 --- a/cloud-kotlin/cloud-kotlin-coroutines-annotations/build.gradle.kts +++ b/cloud-kotlin/cloud-kotlin-coroutines-annotations/build.gradle.kts @@ -3,8 +3,8 @@ plugins { } dependencies { - api(project(":cloud-core")) - api(project(":cloud-annotations")) + api(projects.cloudCore) + api(projects.cloudAnnotations) api(kotlin("reflect")) api(libs.bundles.coroutines) } diff --git a/cloud-kotlin/cloud-kotlin-coroutines/build.gradle.kts b/cloud-kotlin/cloud-kotlin-coroutines/build.gradle.kts index 4ac8abdf..e7764653 100644 --- a/cloud-kotlin/cloud-kotlin-coroutines/build.gradle.kts +++ b/cloud-kotlin/cloud-kotlin-coroutines/build.gradle.kts @@ -3,9 +3,9 @@ plugins { } dependencies { - api(project(":cloud-core")) + api(projects.cloudCore) api(libs.bundles.coroutines) - compileOnly(project(":cloud-kotlin-extensions")) - testImplementation(project(":cloud-kotlin-extensions")) + compileOnly(projects.cloudKotlinExtensions) + testImplementation(projects.cloudKotlinExtensions) } diff --git a/cloud-kotlin/cloud-kotlin-extensions/build.gradle.kts b/cloud-kotlin/cloud-kotlin-extensions/build.gradle.kts index 07c0a675..58abf50d 100644 --- a/cloud-kotlin/cloud-kotlin-extensions/build.gradle.kts +++ b/cloud-kotlin/cloud-kotlin-extensions/build.gradle.kts @@ -3,5 +3,5 @@ plugins { } dependencies { - api(project(":cloud-core")) + api(projects.cloudCore) } diff --git a/cloud-minecraft/cloud-brigadier/build.gradle.kts b/cloud-minecraft/cloud-brigadier/build.gradle.kts index dff3dc31..249a377d 100644 --- a/cloud-minecraft/cloud-brigadier/build.gradle.kts +++ b/cloud-minecraft/cloud-brigadier/build.gradle.kts @@ -1,5 +1,5 @@ dependencies { - implementation(project(":cloud-core")) + implementation(projects.cloudCore) /* Needs to be provided by the platform */ compileOnly("com.mojang", "brigadier", Versions.brigadier) testImplementation("com.mojang", "brigadier", Versions.brigadier) diff --git a/cloud-minecraft/cloud-bukkit/build.gradle.kts b/cloud-minecraft/cloud-bukkit/build.gradle.kts index 308798b5..0156bfbf 100644 --- a/cloud-minecraft/cloud-bukkit/build.gradle.kts +++ b/cloud-minecraft/cloud-bukkit/build.gradle.kts @@ -1,7 +1,7 @@ dependencies { - api(project(":cloud-core")) - api(project(":cloud-brigadier")) - api(project(":cloud-tasks")) + api(projects.cloudCore) + api(projects.cloudBrigadier) + api(projects.cloudTasks) compileOnly("org.bukkit", "bukkit", Versions.bukkit) compileOnly("me.lucko", "commodore", Versions.commodore) compileOnly("org.jetbrains", "annotations", Versions.jetbrainsAnnotations) diff --git a/cloud-minecraft/cloud-bungee/build.gradle.kts b/cloud-minecraft/cloud-bungee/build.gradle.kts index 4172e97a..6bd1c5ca 100644 --- a/cloud-minecraft/cloud-bungee/build.gradle.kts +++ b/cloud-minecraft/cloud-bungee/build.gradle.kts @@ -1,4 +1,4 @@ dependencies { - api(project(":cloud-core")) + api(projects.cloudCore) compileOnly("net.md-5", "bungeecord-api", Versions.bungeecord) } diff --git a/cloud-minecraft/cloud-cloudburst/build.gradle.kts b/cloud-minecraft/cloud-cloudburst/build.gradle.kts index 3c8d8177..52d0fccb 100644 --- a/cloud-minecraft/cloud-cloudburst/build.gradle.kts +++ b/cloud-minecraft/cloud-cloudburst/build.gradle.kts @@ -1,4 +1,4 @@ dependencies { - api(project(":cloud-core")) + api(projects.cloudCore) compileOnly("org.cloudburstmc", "cloudburst-server", Versions.cloudburst) } diff --git a/cloud-minecraft/cloud-fabric/build.gradle.kts b/cloud-minecraft/cloud-fabric/build.gradle.kts index 17fcda45..6a07c499 100644 --- a/cloud-minecraft/cloud-fabric/build.gradle.kts +++ b/cloud-minecraft/cloud-fabric/build.gradle.kts @@ -48,9 +48,9 @@ dependencies { modApi(include("me.lucko", "fabric-permissions-api", "0.1-SNAPSHOT")) - api(include(project(":cloud-core"))!!) - api(include(project(":cloud-brigadier"))!!) - api(include(project(":cloud-services"))!!) + api(include(projects.cloudCore)!!) + api(include(projects.cloudBrigadier)!!) + api(include(projects.cloudServices)!!) api(include("io.leangen.geantyref", "geantyref", Versions.geantyref)) } diff --git a/cloud-minecraft/cloud-minecraft-extras/build.gradle.kts b/cloud-minecraft/cloud-minecraft-extras/build.gradle.kts index f5359b00..48191a9c 100644 --- a/cloud-minecraft/cloud-minecraft-extras/build.gradle.kts +++ b/cloud-minecraft/cloud-minecraft-extras/build.gradle.kts @@ -1,5 +1,5 @@ dependencies { - api(project(":cloud-core")) + api(projects.cloudCore) api("net.kyori", "adventure-api", Versions.adventureApi) api("net.kyori", "adventure-text-serializer-plain", Versions.adventureApi) } diff --git a/cloud-minecraft/cloud-paper/build.gradle.kts b/cloud-minecraft/cloud-paper/build.gradle.kts index 8ac642c3..3a03b9df 100644 --- a/cloud-minecraft/cloud-paper/build.gradle.kts +++ b/cloud-minecraft/cloud-paper/build.gradle.kts @@ -1,5 +1,5 @@ dependencies { - api(project(":cloud-bukkit")) + api(projects.cloudBukkit) compileOnly("com.destroystokyo.paper", "paper-api", Versions.paperApi) compileOnly("com.destroystokyo.paper", "paper-mojangapi", Versions.paperApi) compileOnly("org.jetbrains", "annotations", Versions.jetbrainsAnnotations) diff --git a/cloud-minecraft/cloud-sponge7/build.gradle.kts b/cloud-minecraft/cloud-sponge7/build.gradle.kts index 46f3a4c1..7e14aedf 100644 --- a/cloud-minecraft/cloud-sponge7/build.gradle.kts +++ b/cloud-minecraft/cloud-sponge7/build.gradle.kts @@ -1,4 +1,4 @@ dependencies { - api(project(":cloud-core")) + api(projects.cloudCore) compileOnly("org.spongepowered", "spongeapi", Versions.spongeApi7) } diff --git a/cloud-minecraft/cloud-velocity/build.gradle.kts b/cloud-minecraft/cloud-velocity/build.gradle.kts index d679ac2d..7e221505 100644 --- a/cloud-minecraft/cloud-velocity/build.gradle.kts +++ b/cloud-minecraft/cloud-velocity/build.gradle.kts @@ -1,5 +1,5 @@ dependencies { - api(project(":cloud-core")) - api(project(":cloud-brigadier")) + api(projects.cloudCore) + api(projects.cloudBrigadier) compileOnly("com.velocitypowered", "velocity-api", Versions.velocityApi) } diff --git a/cloud-services/build.gradle.kts b/cloud-services/build.gradle.kts index 62fbe6ed..f42c73e3 100644 --- a/cloud-services/build.gradle.kts +++ b/cloud-services/build.gradle.kts @@ -1,4 +1,3 @@ dependencies { api("io.leangen.geantyref", "geantyref", Versions.geantyref) - } diff --git a/settings.gradle.kts b/settings.gradle.kts index a796b9d2..756d50cb 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,3 +1,5 @@ +enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") + pluginManagement { repositories { gradlePluginPortal()