2019-08-26 06:45:03 +02:00
|
|
|
import org.gradle.api.Project
|
2021-01-25 11:14:09 +01:00
|
|
|
import org.gradle.api.plugins.JavaPluginExtension
|
|
|
|
import org.gradle.jvm.toolchain.JavaLanguageVersion
|
|
|
|
import org.gradle.kotlin.dsl.dependencies
|
2019-08-26 06:45:03 +02:00
|
|
|
import org.gradle.kotlin.dsl.repositories
|
2021-01-25 11:14:09 +01:00
|
|
|
import org.gradle.kotlin.dsl.the
|
2019-08-26 06:45:03 +02:00
|
|
|
|
|
|
|
fun Project.applyCommonConfiguration() {
|
|
|
|
group = rootProject.group
|
|
|
|
version = rootProject.version
|
|
|
|
|
|
|
|
repositories {
|
2021-07-01 22:16:25 +02:00
|
|
|
mavenCentral()
|
2021-01-21 13:07:17 +01:00
|
|
|
maven {
|
2021-01-21 13:34:33 +01:00
|
|
|
name = "EngineHub"
|
2021-01-18 21:58:50 +01:00
|
|
|
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 = "Athion"
|
|
|
|
url = uri("https://ci.athion.net/plugin/repository/tools/")
|
2021-01-08 03:31:24 +01:00
|
|
|
}
|
2019-08-26 06:45:03 +02:00
|
|
|
}
|
2020-08-14 05:37:28 +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
|
|
|
}
|
2021-03-29 15:29:16 +02:00
|
|
|
}
|
|
|
|
|
2021-01-25 11:14:09 +01:00
|
|
|
plugins.withId("java") {
|
|
|
|
the<JavaPluginExtension>().toolchain {
|
2021-11-22 13:38:32 +01:00
|
|
|
languageVersion.set(JavaLanguageVersion.of(17))
|
2021-01-25 11:14:09 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
constraints {
|
2021-05-14 10:31:32 +02:00
|
|
|
for (conf in configurations) {
|
|
|
|
if (conf.isCanBeConsumed || conf.isCanBeResolved) {
|
|
|
|
// dependencies don't get declared in these
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
add(conf.name, "com.google.guava:guava") {
|
2021-11-22 13:47:59 +01:00
|
|
|
version { require("31.0.1-jre") }
|
2021-01-25 11:14:09 +01:00
|
|
|
because("Mojang provides Guava")
|
|
|
|
}
|
2021-05-14 10:31:32 +02:00
|
|
|
add(conf.name, "com.google.code.gson:gson") {
|
2021-11-22 13:47:59 +01:00
|
|
|
version { require("2.8.8") }
|
2021-01-25 11:14:09 +01:00
|
|
|
because("Mojang provides Gson")
|
|
|
|
}
|
2021-05-14 10:31:32 +02:00
|
|
|
add(conf.name, "it.unimi.dsi:fastutil") {
|
2021-11-22 13:47:59 +01:00
|
|
|
version { require("8.5.6") }
|
2021-01-25 11:14:09 +01:00
|
|
|
because("Mojang provides FastUtil")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-08-26 06:45:03 +02:00
|
|
|
}
|