
phraseapp.CheckTask.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of phrase-gradle-plugin Show documentation
Show all versions of phrase-gradle-plugin Show documentation
A Gradle plugin to upload your mobile translations to Phrase and download all locales.
The newest version!
package phraseapp
import kotlinx.coroutines.runBlocking
import org.gradle.api.DefaultTask
import org.gradle.api.GradleException
import org.gradle.api.provider.Property
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.TaskAction
import phraseapp.internal.platforms.Platform
import phraseapp.repositories.checks.CheckRepository
abstract class CheckTask : DefaultTask() {
@get:Input
abstract val baseUrl: Property
@get:Input
abstract val platform: Property
@get:Input
abstract val authToken: Property
@get:Input
abstract val projectId: Property
@get:Input
abstract val localeNameRegex: Property
@get:Input
abstract val output: Property
@TaskAction
fun action() = runBlocking {
try {
CheckRepository
.newInstance(
baseUrl.get(),
output.get(),
localeNameRegex.get(),
authToken.get(),
projectId.get(),
platform.get()
)
.check()
logger.info("You don't have any error in your translations!")
} catch (error: Throwable) {
throw GradleException("You have errors in your translations", error)
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy