仅构建默认值(无风味/变体)

时间:2015-07-20 15:37:00

标签: android gradle android-productflavors

我为我的构建定义了一堆产品风格。但是在某些情况下,我想要构建一个没有味道。

然而,当我尝试构建一个没有味道的版本时,即

gradlew assembleRelease

它贯穿并构建了所有变体,这需要很长时间。我想开始发布版本并忽略所有风格。这可能吗?

我确信我可以添加一个名为'默认的空味,并构建它。好像我不应该这样做。

编辑:

defaultConfig {
    resValue "string", "hello", "Hello default"
}

productFlavors {
    foo {
        resValue "string", "hello", "Hello Foo"
    }

    bar {
        resValue "string", "hello", "Hello Bar"
    }
}

目前的答案似乎是提供您自己的默认'味道

productFlavors {

    defaults {
       // yup its empty cause I just want to build with the defaults
       // that are already defined.
    }

    foo {
        resValue "string", "hello", "Hello Foo"
    }

    bar {
        resValue "string", "hello", "Hello Bar"
    }
}

1 个答案:

答案 0 :(得分:1)

我发现"主要"作为一种味道的作品。所以我不需要添加google-services.json或其他任何内容的附加文件夹

productFlavors {

    main{

    }

    flav1 {
        applicationId 'id'
    }

}
相关问题