2023-01-03 23:54:35 +01:00
|
|
|
plugins {
|
|
|
|
id "java-library"
|
|
|
|
id "maven-publish"
|
2023-12-25 20:25:14 +01:00
|
|
|
id "idea"
|
2024-08-06 11:51:36 +02:00
|
|
|
id "net.raphimc.class-token-replacer" version "1.1.3"
|
2023-01-03 23:54:35 +01:00
|
|
|
}
|
|
|
|
|
2023-09-03 00:47:32 +02:00
|
|
|
base {
|
2024-05-16 23:23:54 +02:00
|
|
|
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
|
2023-09-03 00:47:32 +02:00
|
|
|
compileJava.options.encoding = compileTestJava.options.encoding = javadoc.options.encoding = "UTF-8"
|
2023-01-03 23:54:35 +01:00
|
|
|
|
2023-09-03 00:47:32 +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-03 23:54:35 +01:00
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
maven {
|
|
|
|
name = "ViaVersion"
|
2024-09-05 01:13:33 +02:00
|
|
|
url = "https://repo.viaversion.com"
|
2023-01-03 23:54:35 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2024-08-21 17:03:34 +02:00
|
|
|
compileOnly "com.viaversion:viaversion-common:5.0.4-SNAPSHOT"
|
2024-08-19 11:50:56 +02:00
|
|
|
compileOnly "com.google.guava:guava:33.3.0-jre"
|
2024-07-22 11:28:45 +02:00
|
|
|
compileOnly "io.netty:netty-handler:4.1.112.Final"
|
2023-01-03 23:54:35 +01:00
|
|
|
}
|
|
|
|
|
2023-09-05 21:20:50 +02:00
|
|
|
sourceSets {
|
|
|
|
main {
|
|
|
|
classTokenReplacer {
|
|
|
|
property("\${version}", project.version)
|
|
|
|
property("\${impl_version}", "git-${project.name}-${project.version}:${project.latestCommitHash()}")
|
|
|
|
}
|
|
|
|
}
|
2023-01-04 03:39:05 +01:00
|
|
|
}
|
|
|
|
|
2023-01-03 23:54:35 +01:00
|
|
|
java {
|
|
|
|
withSourcesJar()
|
|
|
|
}
|
|
|
|
|
2023-01-04 03:39:05 +01:00
|
|
|
jar {
|
|
|
|
from("LICENSE") {
|
2023-09-03 00:47:32 +02:00
|
|
|
rename { "${it}_${project.name ?: rootProject.name}" }
|
2023-01-04 03:39:05 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-01-03 23:54:35 +01:00
|
|
|
publishing {
|
|
|
|
repositories {
|
|
|
|
maven {
|
2023-05-28 18:53:41 +02:00
|
|
|
name = "Via"
|
|
|
|
url = "https://repo.viaversion.com/"
|
2023-06-30 23:51:40 +02:00
|
|
|
|
2023-01-03 23:54:35 +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:51:40 +02:00
|
|
|
|
|
|
|
pom {
|
|
|
|
name = "ViaLegacy"
|
|
|
|
description = "ViaVersion addon to add support for EVERY Minecraft server version (Classic, Alpha, Beta, Release)"
|
|
|
|
url = "https://github.com/ViaVersion/ViaLegacy"
|
|
|
|
licenses {
|
|
|
|
license {
|
|
|
|
name = "GPL-3.0 License"
|
|
|
|
url = "https://github.com/ViaVersion/ViaLegacy/blob/main/LICENSE"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
developers {
|
|
|
|
developer {
|
|
|
|
id = "RK_01"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
scm {
|
|
|
|
connection = "scm:git:git://github.com/ViaVersion/ViaLegacy.git"
|
|
|
|
developerConnection = "scm:git:ssh://github.com/ViaVersion/ViaLegacy.git"
|
|
|
|
url = "https://github.com/ViaVersion/ViaLegacy.git"
|
|
|
|
}
|
|
|
|
}
|
2023-01-03 23:54:35 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-08-15 01:49:41 +02:00
|
|
|
|
2023-12-25 20:25:14 +01:00
|
|
|
idea {
|
|
|
|
module {
|
|
|
|
["run"].each {
|
|
|
|
excludeDirs << file("$it")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-15 01:49:41 +02:00
|
|
|
String latestCommitHash() {
|
|
|
|
def stdout = new ByteArrayOutputStream()
|
|
|
|
exec {
|
|
|
|
commandLine "git", "rev-parse", "--short", "HEAD"
|
|
|
|
standardOutput = stdout
|
|
|
|
}
|
|
|
|
return stdout.toString().trim()
|
|
|
|
}
|