57 lines
1.5 KiB
Groovy
57 lines
1.5 KiB
Groovy
plugins {
|
|
id 'java-library'
|
|
}
|
|
apply from: rootProject.file('specialSource.gradle')
|
|
|
|
version = '3.0.1-MC1.19.4'
|
|
group = 'plugin.mrtransistor.AFK'
|
|
|
|
ext {
|
|
author = 'MrTransistor'
|
|
spigotVersion = '1.19.4-R0.1-SNAPSHOT'
|
|
remapServerCode = true
|
|
|
|
mainClass = group + '.' + rootProject.getName()
|
|
apiVersion = spigotVersion.split('\\.')[0] + '.' + spigotVersion.split('\\.')[1]
|
|
}
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
mavenLocal()
|
|
maven { url = 'https://libraries.minecraft.net/' }
|
|
}
|
|
|
|
dependencies {
|
|
afterEvaluate {
|
|
if (remapServerCode) {
|
|
implementation "org.spigotmc:spigot:${spigotVersion}:remapped-mojang"
|
|
} else {
|
|
implementation "org.spigotmc:spigot:${spigotVersion}"
|
|
}
|
|
}
|
|
}
|
|
|
|
afterEvaluate {
|
|
if (remapServerCode) {
|
|
jar {
|
|
doLast {
|
|
def outputFiles = outputs.files.files
|
|
for (inputFile in outputFiles) {
|
|
File intermediateFile = new File(temporaryDir, inputFile.name.replace('.jar', '-obf.jar'))
|
|
File outputFile = inputFile
|
|
remapMojangToSpigot(inputFile, intermediateFile, outputFile, spigotVersion)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
processResources {
|
|
def props = [name : rootProject.name, version: version, author: author,
|
|
mainClassPath: mainClass, apiVersion: apiVersion]
|
|
inputs.properties props
|
|
filteringCharset 'UTF-8'
|
|
filesMatching('plugin.yml') {
|
|
expand props
|
|
}
|
|
} |