Clean up Bukkit API exclusion, use dep constraint for SnakeYAML (#4213)

This commit is contained in:
Jason 2021-06-08 15:36:43 -07:00 committed by GitHub
parent ecea17195a
commit 2018149395
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 33 additions and 5 deletions

View file

@ -13,8 +13,7 @@ dependencies {
api 'org.bstats:bstats-bukkit:1.8'
implementation 'org.spongepowered:configurate-yaml:4.1.1'
implementation 'org.yaml:snakeyaml:1.+'
implementation 'org.checkerframework:checker-qual:3.7.1'
implementation 'org.checkerframework:checker-qual:3.14.0'
// Providers
api project(':providers:BaseProviders')

View file

@ -0,0 +1,7 @@
import org.gradle.api.Project
import org.gradle.api.provider.Property
import org.gradle.kotlin.dsl.property
abstract class EssentialsBaseExtension(private val project: Project) {
val injectBukkitApi: Property<Boolean> = project.objects.property<Boolean>().convention(true)
}

View file

@ -7,6 +7,8 @@ plugins {
id("net.kyori.indra.publishing")
}
val baseExtension = extensions.create<EssentialsBaseExtension>("essentials", project)
val checkstyleVersion = "8.36.2"
val spigotVersion = "1.16.5-R0.1-SNAPSHOT"
val junit5Version = "5.7.0"
@ -17,9 +19,17 @@ dependencies {
testImplementation("org.junit.vintage", "junit-vintage-engine", junit5Version)
testImplementation("org.mockito", "mockito-core", mockitoVersion)
if (project.name != "1_8Provider" && project.name != "PaperProvider" && project.name != "NMSReflectionProvider") { // These providers use their own bukkit versions
api("org.spigotmc", "spigot-api", spigotVersion) {
exclude(group = "org.yaml", module = "snakeyaml")
constraints {
implementation("org.yaml:snakeyaml:1.28") {
because("Bukkit API ships old versions, Configurate requires modern versions")
}
}
}
afterEvaluate {
if (baseExtension.injectBukkitApi.get()) {
dependencies {
api("org.spigotmc", "spigot-api", spigotVersion)
}
}
}

View file

@ -5,3 +5,7 @@ plugins {
dependencies {
api project(':providers:NMSReflectionProvider')
}
essentials {
injectBukkitApi.set(false)
}

View file

@ -6,3 +6,7 @@ dependencies {
implementation project(':providers:BaseProviders')
api 'org.bukkit:bukkit:1.12.2-R0.1-SNAPSHOT'
}
essentials {
injectBukkitApi.set(false)
}

View file

@ -6,3 +6,7 @@ dependencies {
implementation project(':providers:BaseProviders')
compileOnly 'com.destroystokyo.paper:paper-api:1.16.5-R0.1-SNAPSHOT'
}
essentials {
injectBukkitApi.set(false)
}