ProtocolLib/build.gradle

113 lines
2.8 KiB
Groovy
Raw Normal View History

2023-04-10 00:47:19 +02:00
plugins {
id 'java-library'
id 'maven-publish'
2023-04-10 02:02:14 +02:00
id 'com.github.johnrengelman.shadow' version '8.1.1'
2023-04-10 00:47:19 +02:00
}
group = 'com.comphenix.protocol'
version = '5.0.0-SNAPSHOT'
2023-04-10 02:02:14 +02:00
description = 'Provides access to the Minecraft protocol'
2023-04-10 03:06:41 +02:00
def isSnapshot = version.endsWith('-SNAPSHOT')
2023-04-10 00:47:19 +02:00
repositories {
2023-04-10 03:06:41 +02:00
// mavenLocal() // can speed up build, but may fail in CI
2023-04-10 00:47:19 +02:00
mavenCentral()
maven {
2023-04-10 02:34:15 +02:00
url 'https://repo.dmulloy2.net/repository/public/'
2023-04-10 00:47:19 +02:00
}
maven {
2023-04-10 02:34:15 +02:00
url 'https://hub.spigotmc.org/nexus/content/groups/public/'
2023-04-10 00:47:19 +02:00
}
2023-04-10 01:13:50 +02:00
maven {
2023-04-10 02:34:15 +02:00
url 'https://libraries.minecraft.net/'
metadataSources {
mavenPom()
artifact()
ignoreGradleMetadataRedirection()
}
2023-04-10 01:13:50 +02:00
}
2023-04-10 00:47:19 +02:00
}
dependencies {
2023-04-10 00:59:11 +02:00
implementation 'net.bytebuddy:byte-buddy:1.14.3'
2023-04-10 02:16:20 +02:00
compileOnly 'org.spigotmc:spigot-api:1.19.4-R0.1-SNAPSHOT'
compileOnly 'org.spigotmc:spigot:1.19.4-R0.1-SNAPSHOT'
compileOnly 'io.netty:netty-all:4.0.23.Final'
compileOnly 'net.kyori:adventure-text-serializer-gson:4.13.0'
compileOnly 'com.googlecode.json-simple:json-simple:1.1.1'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.9.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.2'
2023-04-10 00:47:19 +02:00
testImplementation 'org.mockito:mockito-core:4.11.0'
testImplementation 'org.mockito:mockito-inline:4.11.0'
testImplementation 'io.netty:netty-common:4.1.77.Final'
testImplementation 'io.netty:netty-transport:4.1.77.Final'
2023-04-10 02:16:20 +02:00
testImplementation 'org.spigotmc:spigot:1.19.4-R0.1-SNAPSHOT'
2023-04-10 00:47:19 +02:00
}
2023-04-10 02:02:14 +02:00
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withJavadocJar()
withSourcesJar()
}
2023-04-10 00:47:19 +02:00
shadowJar {
dependencies {
2023-04-10 00:55:53 +02:00
include(dependency('net.bytebuddy:byte-buddy:.*'))
2023-04-10 00:47:19 +02:00
}
2023-04-10 02:16:20 +02:00
relocate 'net.bytebuddy', 'com.comphenix.net.bytebuddy'
2023-04-10 00:47:19 +02:00
archiveFileName = 'ProtocolLib.jar'
}
test {
useJUnitPlatform()
}
processResources {
2023-04-10 03:06:41 +02:00
def includeBuild = isSnapshot && System.getenv('BUILD_NUMBER')
def fullVersion = includeBuild
2023-04-10 00:47:19 +02:00
? version + '-' + System.getenv('BUILD_NUMBER')
: version
2023-04-10 03:06:41 +02:00
eachFile { expand(['version': fullVersion]) }
2023-04-10 00:47:19 +02:00
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
afterEvaluate {
artifactId = 'ProtocolLib'
}
}
}
2023-04-10 03:06:41 +02:00
2023-04-10 00:47:19 +02:00
repositories {
maven {
2023-04-10 03:06:41 +02:00
url isSnapshot
2023-04-10 00:47:19 +02:00
? 'https://repo.dmulloy2.net/repository/snapshots/'
: 'https://repo.dmulloy2.net/repository/releases/'
2023-04-10 03:06:41 +02:00
credentials {
username project.nexusUsername
password project.nexusPassword
}
2023-04-10 00:47:19 +02:00
}
}
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
tasks.withType(Javadoc) {
options.encoding = 'UTF-8'
}