Make it build™️

This commit is contained in:
KennyTV 2021-02-24 14:24:06 +01:00
parent 9a581c534f
commit 189936ecd2
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
3 changed files with 40 additions and 35 deletions

View File

@ -1,22 +1,19 @@
import net.kyori.indra.IndraPlugin
import net.kyori.indra.IndraPublishingPlugin
import net.kyori.indra.sonatypeSnapshots
import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
plugins {
`java-library`
`maven-publish`
id("net.kyori.indra")
}
allprojects {
group = "com.viaversion"
version = "3.3.0-21w07a"
description = "Allow older clients to join newer server versions."
}
subprojects {
apply<JavaLibraryPlugin>()
apply<MavenPublishPlugin>()
apply<IndraPlugin>()
apply<IndraPublishingPlugin>()
tasks {
// Variable replacements
@ -27,7 +24,11 @@ subprojects {
"url" to "https://github.com/ViaVersion/ViaBackwards")
}
}
withType<Javadoc> {
options.encoding = Charsets.UTF_8.name()
}
withType<JavaCompile> {
options.encoding = Charsets.UTF_8.name()
options.compilerArgs.addAll(listOf("-nowarn", "-Xlint:-unchecked", "-Xlint:-deprecation"))
}
}
@ -42,9 +43,12 @@ subprojects {
if (platforms.contains(project.name)) {
configureShadowJar()
}
if (project.name == "viabackwards") {
apply<ShadowPlugin>()
}
repositories {
sonatypeSnapshots()
maven("https://oss.sonatype.org/content/repositories/snapshots/")
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots")
maven("https://nexus.velocitypowered.com/repository/velocity-artifacts-snapshots/")
maven("https://repo.spongepowered.org/maven")
@ -53,18 +57,28 @@ subprojects {
mavenLocal()
}
indra {
javaVersions {
target.set(8)
testWith(8, 11, 15)
}
github("ViaVersion", "ViaBackwards") {
issues = true
}
mitLicense()
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withSourcesJar()
withJavadocJar()
}
publishing.repositories.maven {
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)
@ -73,6 +87,7 @@ subprojects {
}
}
}
}
tasks {
withType<Jar> {

View File

@ -7,7 +7,5 @@ repositories {
}
dependencies {
implementation("net.kyori", "indra-common", "1.3.1")
implementation("net.kyori", "indra-publishing-gradle-plugin", "1.3.1")
implementation("com.github.jengelman.gradle.plugins", "shadow", "6.1.0")
}

View File

@ -1,8 +1,5 @@
import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
apply<ShadowPlugin>()
tasks {
withType<ShadowJar> {
archiveClassifier.set("")
@ -25,9 +22,4 @@ tasks {
build {
dependsOn(withType<ShadowJar>())
}
withType<Jar> {
if (name == "jar") {
archiveClassifier.set("unshaded")
}
}
}