FastAsyncWorldEdit/buildSrc/src/main/kotlin/CommonConfig.kt
Hannes Greule a353c12df0
Support for 1.20.5/6 (#2721)
* 1.20.6

Signed-off-by: Alexander Brandes <mc.cache@web.de>

* work

Signed-off-by: Alexander Brandes <mc.cache@web.de>

* More work

Signed-off-by: Alexander Brandes <mc.cache@web.de>

* chore: address more removed fields and methods, make it run

* chore: don't allocate unnecessary arrays (by maps)

* chore: the comment might still be noteworthy

* chore: no need to synchronize twice

* fix obfuscation changes

* remove unneeded deprecation

* make regen work without throwing exceptions - but slow

* fix: error when adapting BaseItemStacks without nbt

* fix annoying paper api breakage

---------

Signed-off-by: Alexander Brandes <mc.cache@web.de>
Co-authored-by: Alexander Brandes <mc.cache@web.de>
Co-authored-by: Pierre Maurice Schwang <mail@pschwang.eu>
2024-05-19 13:32:18 +02:00

63 Zeilen
1.9 KiB
Kotlin

import org.gradle.api.Project
import org.gradle.api.plugins.JavaPluginExtension
import org.gradle.jvm.toolchain.JavaLanguageVersion
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.repositories
import org.gradle.kotlin.dsl.the
fun Project.applyCommonConfiguration() {
group = rootProject.group
version = rootProject.version
repositories {
mavenCentral()
maven {
name = "EngineHub"
url = uri("https://maven.enginehub.org/repo/")
}
maven {
name = "OSS Sonatype Snapshots"
url = uri("https://oss.sonatype.org/content/repositories/snapshots/")
}
maven {
name = "Athion"
url = uri("https://ci.athion.net/plugin/repository/tools/")
}
}
configurations.all {
resolutionStrategy {
cacheChangingModulesFor(5, "MINUTES")
}
}
plugins.withId("java") {
the<JavaPluginExtension>().toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
}
dependencies {
constraints {
for (conf in configurations) {
if (conf.isCanBeConsumed || conf.isCanBeResolved) {
// dependencies don't get declared in these
continue
}
add(conf.name, "com.google.guava:guava") {
version { require("31.1-jre") }
because("Mojang provides Guava")
}
add(conf.name, "com.google.code.gson:gson") {
version { require("2.10") }
because("Mojang provides Gson")
}
add(conf.name, "it.unimi.dsi:fastutil") {
version { require("8.5.9") }
because("Mojang provides FastUtil")
}
}
}
}
}