How can I make the android gradle construct fail if I don't have enough translations

I am trying to get gradle so that my Android build fails if I missed a line that wasn’t translated into my Spanish strings.xmlfile and I’m out of luck. I know that there are IDE level options in Android studio, but I was hoping there was some configuration or gradle flag that I could set so that my build would fail. I tried adding a couple of flags to my gradle file under the lint options, but they actually did nothing.

lintOptions {
    abortOnError true
    quiet true
    ignoreWarnings false
    enable 'MissingTranslation'
}

Never wondered here before, so I apologize if I didn’t ask correctly

Update

It seems that adding a flag to the lint block allowed our build to crash on our build machine.

lintOptions {
    abortOnError true
    ignoreWarnings true
    fatal 'MissingTranslation'
}

. /gradlew assembleRelease . , - !

+4
1

:

disable 'MissingTranslation'

:

 lintOptions {
        checkReleaseBuilds false
        disable 'MissingTranslation'
        abortOnError false
    }
+1

Source: https://habr.com/ru/post/1691063/


All Articles