From f3c97887bc1787c75c8ae28d9f0612fb1bd01dc5 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Sun, 17 Nov 2019 14:21:36 +1000 Subject: [PATCH] Only download translations if a key is provided --- worldedit-core/build.gradle.kts | 38 ++++++++++++++++----------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/worldedit-core/build.gradle.kts b/worldedit-core/build.gradle.kts index 877199c84..7eb0f967e 100644 --- a/worldedit-core/build.gradle.kts +++ b/worldedit-core/build.gradle.kts @@ -90,25 +90,25 @@ sourceSets { val crowdinApiKey = "crowdin_apikey" -if (!project.hasProperty(crowdinApiKey)) ext[crowdinApiKey] = "" +if (project.hasProperty(crowdinApiKey)) { + tasks.named("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("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("crowdinDownload") { + apiKey = "${project.property(crowdinApiKey)}" + destination = "$projectDir/src/main/resources/lang" + projectId = "worldedit-core" + } -tasks.named("crowdinDownload") { - apiKey = "${project.property(crowdinApiKey)}" - destination = "$projectDir/src/main/resources/lang" - projectId = "worldedit-core" -} - -tasks.named("processResources").configure { - dependsOn("crowdinDownload") + tasks.named("processResources").configure { + dependsOn("crowdinDownload") + } }