2021-02-24 12:04:31 +01:00
|
|
|
import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
|
2021-02-17 14:49:10 +01:00
|
|
|
|
|
|
|
plugins {
|
|
|
|
`java-library`
|
2021-02-18 12:35:54 +01:00
|
|
|
`maven-publish`
|
2021-04-14 14:16:48 +02:00
|
|
|
id("net.kyori.blossom") version "1.2.0" apply false
|
2021-02-17 14:49:10 +01:00
|
|
|
}
|
|
|
|
|
2021-02-24 13:25:09 +01:00
|
|
|
allprojects {
|
2021-04-24 20:54:38 +02:00
|
|
|
group = "com.viaversion"
|
2021-05-19 18:28:49 +02:00
|
|
|
version = "4.0.0-21w20a-SNAPSHOT"
|
2021-02-24 13:25:09 +01:00
|
|
|
description = "Allow newer clients to join older server versions."
|
|
|
|
}
|
2021-02-17 14:49:10 +01:00
|
|
|
|
2021-02-18 06:32:43 +01:00
|
|
|
subprojects {
|
|
|
|
apply<JavaLibraryPlugin>()
|
|
|
|
apply<MavenPublishPlugin>()
|
2021-02-17 14:49:10 +01:00
|
|
|
|
|
|
|
tasks {
|
|
|
|
// Variable replacements
|
|
|
|
processResources {
|
|
|
|
filesMatching(listOf("plugin.yml", "mcmod.info", "fabric.mod.json", "bungee.yml")) {
|
|
|
|
expand("version" to project.version, "description" to project.description)
|
|
|
|
}
|
|
|
|
}
|
2021-02-24 12:04:31 +01:00
|
|
|
withType<Javadoc> {
|
|
|
|
options.encoding = Charsets.UTF_8.name()
|
|
|
|
}
|
2021-02-18 11:38:50 +01:00
|
|
|
withType<JavaCompile> {
|
2021-02-24 12:04:31 +01:00
|
|
|
options.encoding = Charsets.UTF_8.name()
|
2021-02-18 11:38:50 +01:00
|
|
|
options.compilerArgs.addAll(listOf("-nowarn", "-Xlint:-unchecked", "-Xlint:-deprecation"))
|
|
|
|
}
|
2021-02-18 06:32:43 +01:00
|
|
|
}
|
2021-02-17 14:49:10 +01:00
|
|
|
|
|
|
|
repositories {
|
2021-04-12 20:11:05 +02:00
|
|
|
maven("https://repo.viaversion.com")
|
|
|
|
maven("https://papermc.io/repo/repository/maven-public/")
|
2021-02-24 12:04:31 +01:00
|
|
|
maven("https://oss.sonatype.org/content/repositories/snapshots/")
|
2021-02-18 06:32:43 +01:00
|
|
|
maven("https://nexus.velocitypowered.com/repository/velocity-artifacts-snapshots/")
|
2021-03-07 12:26:08 +01:00
|
|
|
maven("https://repo.spongepowered.org/repository/maven-public/")
|
2021-02-18 06:32:43 +01:00
|
|
|
maven("https://libraries.minecraft.net")
|
2021-04-14 14:16:48 +02:00
|
|
|
mavenCentral()
|
2021-02-17 14:49:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2021-04-08 10:58:54 +02:00
|
|
|
// Note: If manually starting tests doesn't work for you in IJ, change 'Gradle -> Run Tests Using' to 'IntelliJ IDEA'
|
2021-04-14 14:16:48 +02:00
|
|
|
testImplementation(rootProject.libs.netty)
|
|
|
|
testImplementation(rootProject.libs.guava)
|
|
|
|
testImplementation(rootProject.libs.bundles.junit)
|
2021-02-17 14:49:10 +01:00
|
|
|
}
|
|
|
|
|
2021-04-14 14:16:48 +02:00
|
|
|
configureJavaTarget(8)
|
2021-02-24 12:04:31 +01:00
|
|
|
java {
|
|
|
|
withSourcesJar()
|
|
|
|
withJavadocJar()
|
2021-02-17 14:49:10 +01:00
|
|
|
}
|
2021-04-15 11:07:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Configure shadow tasks before the publishing task
|
|
|
|
sequenceOf(
|
|
|
|
projects.viaversionBukkit,
|
|
|
|
projects.viaversionBungee,
|
|
|
|
projects.viaversionFabric,
|
|
|
|
projects.viaversionSponge,
|
|
|
|
projects.viaversionVelocity
|
|
|
|
).map { it.dependencyProject }.forEach { project ->
|
|
|
|
project.configureShadowJar()
|
|
|
|
}
|
|
|
|
|
|
|
|
projects.viaversionApi.dependencyProject.configureShadowJarAPI()
|
|
|
|
projects.viaversion.dependencyProject.apply<ShadowPlugin>()
|
2021-02-19 01:33:32 +01:00
|
|
|
|
2021-04-15 11:07:40 +02:00
|
|
|
subprojects {
|
2021-02-24 12:04:31 +01:00
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
create<MavenPublication>("mavenJava") {
|
|
|
|
groupId = rootProject.group as String
|
|
|
|
artifactId = project.name
|
|
|
|
version = rootProject.version as String
|
|
|
|
|
|
|
|
if (plugins.hasPlugin(ShadowPlugin::class.java)) {
|
|
|
|
artifact(tasks["shadowJar"])
|
|
|
|
} else {
|
|
|
|
from(components["java"])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
repositories.maven {
|
|
|
|
name = "Via"
|
|
|
|
url = uri("https://repo.viaversion.com/")
|
|
|
|
credentials(PasswordCredentials::class)
|
|
|
|
authentication {
|
|
|
|
create<BasicAuthentication>("basic")
|
|
|
|
}
|
2021-02-19 11:40:29 +01:00
|
|
|
}
|
2021-02-19 01:33:32 +01:00
|
|
|
}
|
2021-02-18 06:32:43 +01:00
|
|
|
}
|
2021-02-17 14:49:10 +01:00
|
|
|
|
2021-02-18 06:32:43 +01:00
|
|
|
tasks {
|
|
|
|
// root project has no useful artifacts
|
|
|
|
withType<Jar> {
|
|
|
|
onlyIf { false }
|
2021-02-17 14:49:10 +01:00
|
|
|
}
|
2021-02-18 06:32:43 +01:00
|
|
|
}
|