2023-01-14 14:24:21 +01:00
|
|
|
plugins {
|
|
|
|
id "java-library"
|
|
|
|
id "maven-publish"
|
2023-12-25 20:28:37 +01:00
|
|
|
id "idea"
|
2023-09-05 21:26:13 +02:00
|
|
|
id "net.raphimc.class-token-replacer" version "1.0.0"
|
2023-01-14 14:24:21 +01:00
|
|
|
}
|
|
|
|
|
2023-09-03 00:48:44 +02:00
|
|
|
base {
|
|
|
|
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
|
|
|
|
compileJava.options.encoding = compileTestJava.options.encoding = javadoc.options.encoding = "UTF-8"
|
2023-01-14 14:24:21 +01:00
|
|
|
|
2023-09-03 00:48:44 +02:00
|
|
|
group = project.maven_group ?: rootProject.maven_group
|
|
|
|
archivesName = project.maven_name ?: rootProject.maven_name
|
|
|
|
version = project.maven_version ?: rootProject.maven_version
|
|
|
|
}
|
2023-01-14 14:24:21 +01:00
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
maven {
|
|
|
|
name = "ViaVersion"
|
|
|
|
url "https://repo.viaversion.com"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2024-01-05 15:30:16 +01:00
|
|
|
compileOnly "com.viaversion:viaversion-common:4.10.0-23w51b-SNAPSHOT"
|
|
|
|
compileOnly "com.viaversion:viabackwards-common:4.10.0-23w51b-SNAPSHOT"
|
2023-11-06 13:04:18 +01:00
|
|
|
compileOnly "org.yaml:snakeyaml:2.2"
|
2023-12-19 10:26:40 +01:00
|
|
|
compileOnly "com.google.guava:guava:33.0.0-jre"
|
2023-12-18 10:27:03 +01:00
|
|
|
compileOnly "io.netty:netty-handler:4.1.104.Final"
|
2023-01-14 14:24:21 +01:00
|
|
|
}
|
|
|
|
|
2023-09-05 21:26:13 +02:00
|
|
|
sourceSets {
|
|
|
|
main {
|
|
|
|
classTokenReplacer {
|
|
|
|
property("\${version}", project.version)
|
|
|
|
property("\${impl_version}", "git-${project.name}-${project.version}:${project.latestCommitHash()}")
|
|
|
|
}
|
|
|
|
}
|
2023-01-14 14:24:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
java {
|
|
|
|
withSourcesJar()
|
|
|
|
withJavadocJar()
|
|
|
|
}
|
|
|
|
|
|
|
|
jar {
|
|
|
|
from("LICENSE") {
|
2023-09-03 00:48:44 +02:00
|
|
|
rename { "${it}_${project.name ?: rootProject.name}" }
|
2023-01-14 14:24:21 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
publishing {
|
|
|
|
repositories {
|
|
|
|
maven {
|
2023-05-28 18:56:07 +02:00
|
|
|
name = "Via"
|
|
|
|
url = "https://repo.viaversion.com/"
|
2023-06-30 23:54:15 +02:00
|
|
|
|
2023-01-14 14:24:21 +01:00
|
|
|
credentials(PasswordCredentials)
|
|
|
|
authentication {
|
|
|
|
basic(BasicAuthentication)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
publications {
|
|
|
|
maven(MavenPublication) {
|
|
|
|
groupId = project.maven_group
|
|
|
|
artifactId = project.maven_name
|
|
|
|
version = project.maven_version
|
|
|
|
|
|
|
|
from components.java
|
2023-06-30 23:54:15 +02:00
|
|
|
|
|
|
|
pom {
|
|
|
|
name = "ViaAprilFools"
|
|
|
|
description = "ViaVersion addon to add support for some notable Minecraft snapshots"
|
|
|
|
url = "https://github.com/ViaVersion/ViaAprilFools"
|
|
|
|
licenses {
|
|
|
|
license {
|
|
|
|
name = "GPL-3.0 License"
|
|
|
|
url = "https://github.com/ViaVersion/ViaAprilFools/blob/main/LICENSE"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
developers {
|
|
|
|
developer {
|
|
|
|
id = "RK_01"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
scm {
|
|
|
|
connection = "scm:git:git://github.com/ViaVersion/ViaAprilFools.git"
|
|
|
|
developerConnection = "scm:git:ssh://github.com/ViaVersion/ViaAprilFools.git"
|
|
|
|
url = "https://github.com/ViaVersion/ViaAprilFools.git"
|
|
|
|
}
|
|
|
|
}
|
2023-01-14 14:24:21 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-08-15 01:52:03 +02:00
|
|
|
|
2023-12-25 20:28:37 +01:00
|
|
|
idea {
|
|
|
|
module {
|
|
|
|
["run"].each {
|
|
|
|
excludeDirs << file("$it")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-15 01:52:03 +02:00
|
|
|
String latestCommitHash() {
|
|
|
|
def stdout = new ByteArrayOutputStream()
|
|
|
|
exec {
|
|
|
|
commandLine "git", "rev-parse", "--short", "HEAD"
|
|
|
|
standardOutput = stdout
|
|
|
|
}
|
|
|
|
return stdout.toString().trim()
|
|
|
|
}
|