Velocitab/build.gradle

87 lines
2.9 KiB
Groovy
Raw Normal View History

import org.apache.tools.ant.filters.ReplaceTokens
2023-02-19 01:02:50 +01:00
plugins {
2023-03-22 17:22:13 +01:00
id 'com.github.johnrengelman.shadow' version '8.1.1'
2023-02-19 01:02:50 +01:00
id 'org.ajoberstar.grgit' version '5.0.0'
id 'java'
2023-02-19 01:02:50 +01:00
}
group 'net.william278'
2023-03-22 17:22:28 +01:00
version "$ext.plugin_version-${versionMetadata()}"
ext {
set 'version', version.toString()
}
2023-02-19 01:02:50 +01:00
repositories {
mavenCentral()
maven { url = 'https://repo.papermc.io/repository/maven-public/' }
maven { url = 'https://jitpack.io/' }
2023-02-19 01:02:50 +01:00
maven { url = 'https://repo.minebench.de/' }
maven { url = 'https://mvn.exceptionflug.de/repository/exceptionflug-public/' }
2023-02-19 01:02:50 +01:00
}
dependencies {
compileOnly 'com.velocitypowered:velocity-api:3.1.1'
compileOnly 'net.luckperms:api:5.4'
2023-03-19 14:26:47 +01:00
compileOnly 'dev.simplix:protocolize-api:2.2.6'
compileOnly 'io.netty:netty-codec-http:4.1.90.Final'
compileOnly 'io.github.miniplaceholders:miniplaceholders-api:2.0.0'
compileOnly 'net.william278:PAPIProxyBridge:1.0'
compileOnly 'org.projectlombok:lombok:1.18.26'
compileOnly 'net.kyori:adventure-text-minimessage:4.13.0'
2023-02-19 01:02:50 +01:00
implementation 'org.apache.commons:commons-text:1.10.0'
2023-02-19 01:02:50 +01:00
implementation 'net.william278:Annotaml:2.0.1'
implementation 'dev.dejvokep:boosted-yaml:1.3.1'
implementation 'de.themoep:minedown-adventure:1.7.2-SNAPSHOT'
2023-02-19 01:02:50 +01:00
annotationProcessor 'org.projectlombok:lombok:1.18.26'
2023-02-19 01:02:50 +01:00
}
processResources {
filesMatching(['**/*.json', '**/*.yml']) {
filter ReplaceTokens as Class, beginToken: '${', endToken: '}',
tokens: rootProject.ext.properties
}
}
2023-03-11 01:05:34 +01:00
logger.lifecycle("Building Velocitab ${version} by William278")
version rootProject.version
archivesBaseName = "${rootProject.name}"
2023-02-19 01:02:50 +01:00
shadowJar {
2023-03-09 22:26:33 +01:00
relocate 'org.apache.commons.text', 'net.william278.velocitab.libraries.commons.text'
relocate 'org.apache.commons.lang3', 'net.william278.velocitab.libraries.commons.lang3'
relocate 'org.jetbrains', 'net.william278.velocitab.libraries'
relocate 'org.intellij', 'net.william278.velocitab.libraries'
2023-02-19 01:02:50 +01:00
relocate 'de.themoep', 'net.william278.velocitab.libraries'
relocate 'dev.dejvokep.boostedyaml', 'net.william278.velocitab.libraries'
2023-02-19 01:02:50 +01:00
relocate 'net.william278.annotaml', 'net.william278.velocitab.libraries.annotaml'
dependencies {
//noinspection GroovyAssignabilityCheck
exclude dependency(':slf4j-api')
}
destinationDirectory.set(file("$rootDir/target"))
archiveClassifier.set('')
2023-02-19 01:02:50 +01:00
}
jar.dependsOn shadowJar
clean.delete "$rootDir/target"
2023-02-19 01:02:50 +01:00
@SuppressWarnings('GrMethodMayBeStatic')
def versionMetadata() {
// Get if there is a tag for this commit
def tag = grgit.tag.list().find { it.commit.id == grgit.head().id }
if (tag != null) {
return ''
}
// Otherwise, get the last commit hash and if it's a clean head
2023-02-19 01:02:50 +01:00
if (grgit == null) {
return System.getenv("GITHUB_RUN_NUMBER") ? 'build.' + System.getenv("GITHUB_RUN_NUMBER") : 'unknown'
}
return grgit.head().abbreviatedId + (grgit.status().clean ? '' : '-indev')
}