让两种风格使用相同的sourceSet [英] Let two flavors use the same sourceSet

查看:191
本文介绍了让两种风格使用相同的sourceSet的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个口味demo和full,每个口令都在src / demo和src / full中有自己的sourceSet。这工作正常。



我现在想做出使用其中一个sourceSets的第三种口味。

 productFlavors {
full {
applicationIdcom.example.full
signingConfig signingConfigs.full
resValuestring,app_name,Full
}
demo {
applicationIdcom.example.demo
signingConfig signingConfigs.demo
resValuestring,app_name,Demo
}
第三个{
applicationIdcom.example.third
resValuestring,app_name,third
signingConfig signingConfigs.full
sourceSet =full



解决方案

productFlavors {
...
}
sourceSets.third.root =src / full


I have two flavors "demo" and "full", with each their own sourceSet in src/demo and src/full. This works fine.

I want now to make a third flavor that uses one of those sourceSets. How would I do that?

I tried something like:

productFlavors {
    full {
        applicationId "com.example.full"
        signingConfig signingConfigs.full
        resValue "string", "app_name", "Full"
    }
    demo {
        applicationId "com.example.demo"
        signingConfig signingConfigs.demo
        resValue "string", "app_name", "Demo"
    }
    third {
        applicationId "com.example.third"
        resValue "string", "app_name", "third"
        signingConfig signingConfigs.full
        sourceSet = "full"
    }
}

解决方案

productFlavors {
    ...
}
sourceSets.third.root = "src/full"

这篇关于让两种风格使用相同的sourceSet的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆