Files
hamster-core/hamster-core-bungeecord/build.gradle
2023-06-14 20:22:01 +08:00

78 lines
2.8 KiB
Groovy

//file:noinspection GroovyAssignabilityCheck
//file:noinspection VulnerableLibrariesLocal
//file:noinspection GrDeprecatedAPIUsage
plugins {
id 'com.github.johnrengelman.shadow' version '7+'
}
setArchivesBaseName("HamsterCore-BungeeCord")
evaluationDependsOn(':hamster-core-common')
dependencies {
//noinspection VulnerableLibrariesLocal
compileOnly 'net.md-5:bungeecord-api:1.19-R0.1-SNAPSHOT'
implementation project(":hamster-core-common") transitive false
//noinspection GradlePackageUpdate
implementation "com.zaxxer:HikariCP:${HikariCP_version}"
// https://mvnrepository.com/artifact/net.kyori/adventure-platform-bungeecord
implementation "net.kyori:adventure-platform-bungeecord:${adventure_version}" exclude group: 'org.jetbrains'
// https://mvnrepository.com/artifact/net.kyori/adventure-text-minimessage
implementation "net.kyori:adventure-text-minimessage:${adventure_serializer_version}" exclude group: 'org.jetbrains'
// https://mvnrepository.com/artifact/net.kyori/adventure-text-serializer-gson
implementation "net.kyori:adventure-text-serializer-gson:${adventure_serializer_version}" exclude group: 'org.jetbrains'
// https://mvnrepository.com/artifact/net.kyori/adventure-text-serializer-legacy
implementation "net.kyori:adventure-text-serializer-legacy:${adventure_serializer_version}" exclude group: 'org.jetbrains'
}
processResources {
inputs.property "version", project.version
filesMatching("bungee.yml") {
expand "version": project.version
}
}
jar {
classifier = 'dev'
}
tasks.compileJava.dependsOn(":hamster-core-common:build")
shadowJar {
classifier = ''
dependencies {
exclude(dependency {
it.moduleGroup == 'com.google.code.gson' || it.moduleName == 'org.jetbrains'
})
}
relocate 'org.slf4j', 'cn.hamster3.mc.plugin.core.lib.slf4j'
relocate 'net.kyori', 'cn.hamster3.mc.plugin.core.lib.kyori'
relocate 'com.zaxxer.hikari', 'cn.hamster3.mc.plugin.core.lib.hikari'
destinationDir(getRootProject().buildDir)
}
tasks.build.dependsOn(shadowJar)
publishing {
publications {
shadow(MavenPublication) { publication ->
{
def projectNameSplit = project.name.split('-')
artifactId = projectNameSplit[projectNameSplit.length - 1]
from components.java
}
}
}
repositories {
maven {
def releasesRepoUrl = 'https://maven.airgame.net/maven-releases/'
def snapshotsRepoUrl = 'https://maven.airgame.net/maven-snapshots/'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = rootProject.properties.getOrDefault("maven_username", "")
password = rootProject.properties.getOrDefault("maven_password", "")
}
}
}
}