Only download translations if a key is provided

This commit is contained in:
Matthew Miller 2019-11-17 14:21:36 +10:00
parent 9a01bf9ab2
commit f3c97887bc

View File

@ -90,25 +90,25 @@ sourceSets {
val crowdinApiKey = "crowdin_apikey" val crowdinApiKey = "crowdin_apikey"
if (!project.hasProperty(crowdinApiKey)) ext[crowdinApiKey] = "" if (project.hasProperty(crowdinApiKey)) {
tasks.named<UploadSourceFileTask>("crowdinUpload") {
apiKey = "${project.property(crowdinApiKey)}"
projectId = "worldedit-core"
files = arrayOf(
object {
var name = "strings.json"
var source = "$projectDir/src/main/resources/lang/strings.json"
}
)
}
tasks.named<UploadSourceFileTask>("crowdinUpload") { tasks.named<DownloadTranslationsTask>("crowdinDownload") {
apiKey = "${project.property(crowdinApiKey)}" apiKey = "${project.property(crowdinApiKey)}"
projectId = "worldedit-core" destination = "$projectDir/src/main/resources/lang"
files = arrayOf( projectId = "worldedit-core"
object { }
var name = "strings.json"
var source = "$projectDir/src/main/resources/lang/strings.json"
}
)
}
tasks.named<DownloadTranslationsTask>("crowdinDownload") { tasks.named("processResources").configure {
apiKey = "${project.property(crowdinApiKey)}" dependsOn("crowdinDownload")
destination = "$projectDir/src/main/resources/lang" }
projectId = "worldedit-core"
}
tasks.named("processResources").configure {
dependsOn("crowdinDownload")
} }