proguard gradle debug build but not the tests

后端 未结 3 1956
长情又很酷
长情又很酷 2020-12-05 15:37

I enabled proguard for the debug build using:

android {
    buildTypes {
        debug {
            runProguard true
            proguardFile \'proguard-deb         


        
3条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-05 15:47

    Introduce a new build type "derived" from debug specific to the test app that disables ProGuard again like

    android {
        buildTypes {
            debugTest.initWith(debug)
            debugTest {
                minifyEnabled false
            }
        }
    }
    

    and use that build type for the test app by assigning its name to the testBuildType property

    android {
        testBuildType 'debugTest'
    }
    

提交回复
热议问题