FastAsyncWorldEdit/buildSrc/src/main/kotlin/CommonConfig.kt

Revisionen in .git-blame-ignore-revs werden ignoriert. Klicke hier, um das zu umgehen und die normale Blame-Ansicht zu sehen.

82 Zeilen
2.5 KiB
Kotlin

2019-08-26 06:45:03 +02:00
import org.gradle.api.Project
import org.gradle.api.plugins.JavaPluginExtension
import org.gradle.jvm.toolchain.JavaLanguageVersion
2021-05-14 23:42:37 +02:00
import org.gradle.jvm.toolchain.JvmVendorSpec
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.get
2019-08-26 06:45:03 +02:00
import org.gradle.kotlin.dsl.repositories
import org.gradle.kotlin.dsl.the
2019-08-26 06:45:03 +02:00
fun Project.applyCommonConfiguration() {
group = rootProject.group
version = rootProject.version
repositories {
mavenLocal()
maven {
2021-01-21 13:07:17 +01:00
name = "IntellectualSites"
url = uri("https://mvn.intellectualsites.com/content/groups/public/")
}
maven {
2021-01-21 13:34:33 +01:00
name = "EngineHub"
url = uri("https://maven.enginehub.org/repo/")
2021-01-21 13:07:17 +01:00
}
maven {
name = "OSS Sonatype Snapshots"
url = uri("https://oss.sonatype.org/content/repositories/snapshots/")
}
maven {
name = "OSS Sonatype Releases"
url = uri("https://oss.sonatype.org/content/repositories/releases/")
}
maven {
name = "Athion"
url = uri("https://ci.athion.net/plugin/repository/tools/")
}
2019-08-26 06:45:03 +02:00
}
2019-08-26 06:45:03 +02:00
configurations.all {
resolutionStrategy {
2020-07-14 04:50:59 +02:00
cacheChangingModulesFor(5, "MINUTES")
2019-08-26 06:45:03 +02:00
}
}
configurations.findByName("compileClasspath")?.apply {
resolutionStrategy.componentSelection {
withModule("org.slf4j:slf4j-api") {
reject("No SLF4J allowed on compile classpath")
}
}
}
plugins.withId("java") {
the<JavaPluginExtension>().toolchain {
2021-05-14 23:42:37 +02:00
languageVersion.set(JavaLanguageVersion.of(11))
vendor.set(JvmVendorSpec.ADOPTOPENJDK)
}
}
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(Versions.GUAVA) }
because("Mojang provides Guava")
}
add(conf.name, "com.google.code.gson:gson") {
version { require(Versions.GSON) }
because("Mojang provides Gson")
}
add(conf.name, "it.unimi.dsi:fastutil") {
version { require(Versions.FAST_UTIL) }
because("Mojang provides FastUtil")
}
}
}
}
2019-08-26 06:45:03 +02:00
}