How to make Grade release build fail using Lint Option StopShip?

后端 未结 1 898
长发绾君心
长发绾君心 2021-02-04 10:59

I\'ve read a lot about the StopShip Android Lint Check and Gradle support for it

  • http://tools.android.com/tips/lint-checks
  • http://tools.andro
1条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-04 11:30

    I finally cracked it! fatal 'StopShip'. That's what finally did it! Leaving my discovery in case it helps anyone.

    Replacing error 'StopShip' with fatal 'StopShip' in my build.gradle config solved the problem.

    I don't fully understand why my previous attempts with error 'StopShip' didn't work, as the abortOnError docs clearly state:

    Whether lint should set the exit code of the process if errors are found

    and I was marking the StopShip check severity as error. It looks like abortOnError will only make the Gradle build abort for FATAL errors. Can anyone confirm?

    Of course, if it anyone offers a better solution/explanation, please do share.

    0 讨论(0)
提交回复
热议问题