Android Gradle: rename/disable default build type

守給你的承諾、 提交于 2019-12-04 22:48:08
Kevin Brotcke
import com.android.builder.core.BuilderConstants
android.variantFilter { variant ->
    def build = variant.buildType.name
    if (build == BuilderConstants.DEBUG || build == BuilderConstants.RELEASE) {
        variant.setIgnore(true)
    }
}

Note that the very first time importing the project Android Studio will pick any variant named debug else it will pick the first build variant in alphabetical order, which may not be the one you prefer as the default.

One solution i have come up with is to acctually just assemble the specifics and not run assemble. Which assembles all.

Try out gradle tasks to see the possibilites

But im looking for a better solution too, one that can be defined in the gradle.build file.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!