How to disable lint abortOnError in Android Gradle Plugin from top level of multi project directory

前端 未结 1 1231
余生分开走
余生分开走 2020-12-05 19:37

I have a top level Android Gradle project. There are multiple subprojects nested below this projects (sometimes they are 2 level deep) i.e:

top level project         


        
相关标签:
1条回答
  • 2020-12-05 20:04

    I too faced a similar situation, but instead of just modifying the DSL directly, I called configure on it instead:

    configure(android.lintOptions) {
        abortOnError false
    }
    

    As a result, I was able to disable abortOnError for my desired subprojects. Bottom line, your subproject block should look like this:

    subprojects {
    
        afterEvaluate {
            if (getPlugins().hasPlugin('android') ||
                getPlugins().hasPlugin('android-library')) {
    
                println name // for debugging
    
                configure(android.lintOptions) {
                    abortOnError false
                }
            }
    
        }
    }
    
    0 讨论(0)
提交回复
热议问题