Download latest translations from website and include them in the final jar file
This commit is contained in:
17
build.gradle
17
build.gradle
@@ -1,3 +1,5 @@
|
||||
import java.util.zip.ZipInputStream
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@@ -69,6 +71,21 @@ jar {
|
||||
}
|
||||
from noticeDir
|
||||
|
||||
def langDir = file("$buildDir/languages")
|
||||
doFirst {
|
||||
langDir.deleteDir()
|
||||
langDir.mkdirs()
|
||||
def dir = new File(langDir, 'assets/replaymod/lang/')
|
||||
dir.mkdirs()
|
||||
def zip = new ZipInputStream(new URL('http://replaymod.com/api/grab_languages').openStream())
|
||||
def e;
|
||||
while ((e = zip.nextEntry) != null) {
|
||||
new File(dir, e.getName()) << zip
|
||||
zip.closeEntry()
|
||||
}
|
||||
}
|
||||
from langDir
|
||||
|
||||
from (configurations.shade.collect { it.isDirectory() ? it : zipTree(it) }) {
|
||||
exclude '**/NOTICE*'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user