Fix crowdinExport task

This commit is contained in:
Modmuss50 2018-08-31 16:00:31 +01:00
parent d4e08ba976
commit cee083eb88
No known key found for this signature in database
GPG key ID: 773D17BE8BF49C82

View file

@ -197,14 +197,14 @@ build.dependsOn deobfJar, apiJar
//Triggers crowdin to export the latest translations
task crowdinExport() {
onlyIf {
hasProperty('crowdinKey')
project.hasProperty('crowdinKey')
}
doLast{
def apiKey = project.crowdinKey
def projectId = 'techreborn'
def response = new URL(sprintf('https://api.crowdin.com/api/project/$s/export?key=$s', [projectId, apiKey])).text
def metadata = new XmlSlurper().parseText(response)
project.logger.lifecycle("crowdin export status: " + metadata.@success)
def response = new URL(sprintf('https://api.crowdin.com/api/project/%1$s/export?key=%2$s', [projectId, apiKey])).text
def metadata = new XmlParser().parseText(response)
project.logger.lifecycle("crowdin export status: " + metadata.@status)
}
}