2019-08-26 04:45:03 +00:00
|
|
|
import org.gradle.api.Project
|
2021-01-25 10:14:09 +00:00
|
|
|
import org.gradle.api.plugins.JavaPluginExtension
|
|
|
|
import org.gradle.jvm.toolchain.JavaLanguageVersion
|
|
|
|
import org.gradle.kotlin.dsl.dependencies
|
2019-08-26 04:45:03 +00:00
|
|
|
import org.gradle.kotlin.dsl.repositories
|
2021-01-25 10:14:09 +00:00
|
|
|
import org.gradle.kotlin.dsl.the
|
2019-08-26 04:45:03 +00:00
|
|
|
|
|
|
|
fun Project.applyCommonConfiguration() {
|
|
|
|
group = rootProject.group
|
|
|
|
version = rootProject.version
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenLocal()
|
2021-07-01 20:16:25 +00:00
|
|
|
mavenCentral()
|
2021-01-18 20:58:50 +00:00
|
|
|
maven {
|
2021-01-21 12:07:17 +00:00
|
|
|
name = "IntellectualSites"
|
|
|
|
url = uri("https://mvn.intellectualsites.com/content/groups/public/")
|
|
|
|
}
|
|
|
|
maven {
|
2021-01-21 12:34:33 +00:00
|
|
|
name = "EngineHub"
|
2021-01-18 20:58:50 +00:00
|
|
|
url = uri("https://maven.enginehub.org/repo/")
|
2021-01-21 12:07:17 +00: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/")
|
2021-01-08 02:31:24 +00:00
|
|
|
}
|
2019-08-26 04:45:03 +00:00
|
|
|
}
|
2020-08-14 03:37:28 +00:00
|
|
|
|
2019-08-26 04:45:03 +00:00
|
|
|
configurations.all {
|
|
|
|
resolutionStrategy {
|
2020-07-14 02:50:59 +00:00
|
|
|
cacheChangingModulesFor(5, "MINUTES")
|
2019-08-26 04:45:03 +00:00
|
|
|
}
|
2021-03-29 13:29:16 +00:00
|
|
|
}
|
|
|
|
|
2021-01-25 10:14:09 +00:00
|
|
|
plugins.withId("java") {
|
|
|
|
the<JavaPluginExtension>().toolchain {
|
2021-11-22 12:38:32 +00:00
|
|
|
languageVersion.set(JavaLanguageVersion.of(17))
|
2021-01-25 10:14:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
constraints {
|
2021-05-14 08:31:32 +00: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-08-01 17:28:51 +00:00
|
|
|
version { require("21.0") }
|
2021-01-25 10:14:09 +00:00
|
|
|
because("Mojang provides Guava")
|
|
|
|
}
|
2021-05-14 08:31:32 +00:00
|
|
|
add(conf.name, "com.google.code.gson:gson") {
|
2021-08-01 17:28:51 +00:00
|
|
|
version { require("2.8.0") }
|
2021-01-25 10:14:09 +00:00
|
|
|
because("Mojang provides Gson")
|
|
|
|
}
|
2021-05-14 08:31:32 +00:00
|
|
|
add(conf.name, "it.unimi.dsi:fastutil") {
|
2021-08-01 17:28:51 +00:00
|
|
|
version { require("8.2.1") }
|
2021-01-25 10:14:09 +00:00
|
|
|
because("Mojang provides FastUtil")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-08-26 04:45:03 +00:00
|
|
|
}
|