简体   繁体   English

仅针对一种构建方式启用资源缩减

[英]Enable resource shrinking for only one build flavor

Is it possible to write build.gradle file to have resource shrinking enabled for only one build flavor? 是否可以编写build.gradle文件以仅针对一种构建样式启用资源缩减? Currently we can enable shrinking per build type, can we have build types per flavor 当前,我们可以启用每种构建类型的收缩,我们可以每种口味具有构建类型吗

There are three notion in gardle build system. gardle构建系统有三个概念。

Build type 构建类型
Build flavor 营造风味
Build varinat 建立varinat

Build varinat is the combination of Build type and build falvor. Build varinat是Build类型和build falvor的组合。

For example you have release and debug build types and you have free and paid falvors. 例如,您具有发布和调试构建类型,并且有免费的和付费的。

There will be four build variants 将有四个版本

freeDebug freeDebug
freeRelease freeRelease
paidDebug paidDebug
paidRelease paidRelease

If your release build type is with shrinking you can add new release named realese2 without shrinking there will added two build variants more 如果您的release构建类型是缩小的,则可以在不缩小的情况下添加名为realese2新发行版,这将进一步增加两个构建变体

freeRelease2 freeRelease2
paidRelease2 paidRelease2

When you want falvor with shrinking build falvorRelease and dont want shrinkg build with falvorRelease2 当您希望通过收缩构建falvorRelease希望通过收缩构建falvorRelease2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM