ViaBackwards/build.gradle.kts

98 lines
2.8 KiB
Plaintext
Raw Normal View History

2021-02-24 14:24:06 +01:00
import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
2021-02-18 14:34:33 +01:00
plugins {
`java-library`
`maven-publish`
id("net.kyori.blossom") version "1.2.0" apply false
2021-02-18 14:34:33 +01:00
}
2021-02-24 14:24:06 +01:00
allprojects {
2021-02-25 23:23:24 +01:00
group = "nl.matsv"
2021-04-23 22:50:35 +02:00
version = "4.0.0-21w16a"
2021-02-24 14:24:06 +01:00
description = "Allow older clients to join newer server versions."
}
2021-02-18 14:34:33 +01:00
subprojects {
apply<JavaLibraryPlugin>()
apply<MavenPublishPlugin>()
tasks {
// Variable replacements
processResources {
filesMatching(listOf("plugin.yml", "mcmod.info", "fabric.mod.json", "bungee.yml")) {
expand("version" to project.version,
"description" to project.description,
"url" to "https://github.com/ViaVersion/ViaBackwards")
}
}
2021-02-24 14:24:06 +01:00
withType<Javadoc> {
options.encoding = Charsets.UTF_8.name()
}
2021-02-18 14:34:33 +01:00
withType<JavaCompile> {
2021-02-24 14:24:06 +01:00
options.encoding = Charsets.UTF_8.name()
2021-02-18 14:34:33 +01:00
options.compilerArgs.addAll(listOf("-nowarn", "-Xlint:-unchecked", "-Xlint:-deprecation"))
}
}
repositories {
2021-02-24 14:50:51 +01:00
maven("https://repo.viaversion.com")
maven("https://papermc.io/repo/repository/maven-public/")
2021-02-24 14:24:06 +01:00
maven("https://oss.sonatype.org/content/repositories/snapshots/")
2021-02-18 14:34:33 +01:00
maven("https://nexus.velocitypowered.com/repository/velocity-artifacts-snapshots/")
maven("https://repo.spongepowered.org/maven")
mavenCentral()
2021-02-18 14:34:33 +01:00
}
2021-02-24 14:24:06 +01:00
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withSourcesJar()
withJavadocJar()
2021-02-18 14:34:33 +01:00
}
2021-04-15 11:11:04 +02:00
}
// Configure shadow tasks before the publishing task
sequenceOf(
projects.viabackwardsBukkit,
projects.viabackwardsBungee,
projects.viabackwardsFabric,
projects.viabackwardsSponge,
projects.viabackwardsVelocity
).map { it.dependencyProject }.forEach { project ->
project.configureShadowJar()
}
projects.viabackwards.dependencyProject.apply<ShadowPlugin>()
2021-02-23 11:29:18 +01:00
2021-04-15 11:11:04 +02:00
subprojects {
2021-02-24 14:24:06 +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-23 11:29:18 +01:00
}
}
2021-02-18 14:34:33 +01:00
}
tasks {
withType<Jar> {
onlyIf { false }
}
}