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' api 'org.bstats:bstats-bukkit:1.8'
implementation 'org.spongepowered:configurate-yaml:4.1.1' implementation 'org.spongepowered:configurate-yaml:4.1.1'
implementation 'org.yaml:snakeyaml:1.+' implementation 'org.checkerframework:checker-qual:3.14.0'
implementation 'org.checkerframework:checker-qual:3.7.1'
// Providers // Providers
api project(':providers:BaseProviders') 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") id("net.kyori.indra.publishing")
} }
val baseExtension = extensions.create<EssentialsBaseExtension>("essentials", project)
val checkstyleVersion = "8.36.2" val checkstyleVersion = "8.36.2"
val spigotVersion = "1.16.5-R0.1-SNAPSHOT" val spigotVersion = "1.16.5-R0.1-SNAPSHOT"
val junit5Version = "5.7.0" val junit5Version = "5.7.0"
@ -17,9 +19,17 @@ dependencies {
testImplementation("org.junit.vintage", "junit-vintage-engine", junit5Version) testImplementation("org.junit.vintage", "junit-vintage-engine", junit5Version)
testImplementation("org.mockito", "mockito-core", mockitoVersion) testImplementation("org.mockito", "mockito-core", mockitoVersion)
if (project.name != "1_8Provider" && project.name != "PaperProvider" && project.name != "NMSReflectionProvider") { // These providers use their own bukkit versions constraints {
api("org.spigotmc", "spigot-api", spigotVersion) { implementation("org.yaml:snakeyaml:1.28") {
exclude(group = "org.yaml", module = "snakeyaml") 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 { dependencies {
api project(':providers:NMSReflectionProvider') api project(':providers:NMSReflectionProvider')
} }
essentials {
injectBukkitApi.set(false)
}

View File

@ -6,3 +6,7 @@ dependencies {
implementation project(':providers:BaseProviders') implementation project(':providers:BaseProviders')
api 'org.bukkit:bukkit:1.12.2-R0.1-SNAPSHOT' 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') implementation project(':providers:BaseProviders')
compileOnly 'com.destroystokyo.paper:paper-api:1.16.5-R0.1-SNAPSHOT' compileOnly 'com.destroystokyo.paper:paper-api:1.16.5-R0.1-SNAPSHOT'
} }
essentials {
injectBukkitApi.set(false)
}