Background ponies are generated as part of the build action

This commit is contained in:
Sollace 2018-11-05 15:47:05 +02:00
parent 08fb6b978f
commit 594157565e

View file

@ -110,6 +110,33 @@ jar {
archivesBaseName = "mod-${project.name.toLowerCase()}" archivesBaseName = "mod-${project.name.toLowerCase()}"
task copyBGPones(type: Copy) {
delete "${buildDir}/skins/assets/minelittlepony/textures/entity/pony"
def permittedChars = /[^0-9a-z\",\{\}\[\]\(\):\'\.\/ ]/
from("skins/Background Ponies") {
exclude "bgponies.json"
rename { filename ->
filename.toLowerCase()
.replaceAll(permittedChars, '')
}
}
from("skins/Background Ponies") {
include "bgponies.json"
filter { line ->
line.toLowerCase()
.replaceAll('\t', ' ')
.replaceAll(permittedChars, '')
}
}
into "${buildDir}/skins/assets/minelittlepony/textures/entity/pony"
}
shadowJar { shadowJar {
extension 'litemod' extension 'litemod'
classifier "mc$minecraft.version" classifier "mc$minecraft.version"
@ -117,6 +144,11 @@ shadowJar {
from sourceSets.hdskins.output from sourceSets.hdskins.output
from litemod from litemod
exclude "/assets/minelittlepony/textures/entity/pony"
from(copyBGPones) {
into "/assets/minelittlepony/textures/entity/pony"
}
dependencies { dependencies {
exclude dependency('deobf.com.mumfrey:liteloader:') exclude dependency('deobf.com.mumfrey:liteloader:')
exclude dependency('deobf.org.ow2.asm:') exclude dependency('deobf.org.ow2.asm:')
@ -141,6 +173,16 @@ task srgJar(type: Jar) {
classifier "mc$minecraft.version-srg" classifier "mc$minecraft.version-srg"
} }
task zipCommunityPack(type: Zip) {
baseName = "Pony Skin Pack"
destinationDir = new File(buildDir, "libs")
from("skins") {
// TODO: Later packs will have their folders excluded.
// For now we just zip everything.
exclude "README.md"
}
}
reobf { reobf {
srgJar { srgJar {
mappingType = 'SEARGE' mappingType = 'SEARGE'