android 删除build,android - Android Studio:如何删除/过滤默认调试版本的buildvariant并释放buildType,并仅保留那些使用自定义buildType...

我创建了如下的自定义buildTypes:

buildTypes {

releasefree.initWith(buildTypes.release)

releasefree {

minifyEnabled true

shrinkResources true

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

}

releasepro.initWith(buildTypes.release)

releasepro {

minifyEnabled true

shrinkResources true

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

applicationIdSuffix ".pro"

}

debugfree.initWith(buildTypes.debug)

debugfree {

shrinkResources true

applicationIdSuffix ".debug"

debuggable true

}

debugpro.initWith(buildTypes.debug)

debugpro {

shrinkResources true

applicationIdSuffix ".pro.debug"

debuggable true

}

}

我将永远不会使用默认的调试和发布构建类型,而是要从构建变体列表中删除它们。 我有几种口味,并且变体列表太大。 删除具有默认调试和发行版类型的变体会有所帮助,因为我永远不会使用它们。

我尝试使用变体过滤器,如下所示,但它不起作用

android.variantFilter { variant ->

if(variant.buildType.name.endsWith('Release') || variant.buildType.name.endsWith('Debug')) {

variant.setIgnore(true);

}

}

我过滤变体的方式是否有问题,或者只是无法使用默认的调试和发布构建类型来删除变体。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值