[英]Can we organize repositories by flavor and build variant
I am taking over an android project which can be deployed in many countries. 我正在接管可以在许多国家/地区部署的android项目。 Right now I have a set of libraries on a custom Jfrog Artifactory server.
现在,我在定制的Jfrog Artifactory服务器上有一组库。
What I am curious is can I clone this library set into different artifactory repos (have same group ID and artifact ID) and use them by android project's flavor and build varirant. 我很好奇的是,我可以将此库集克隆到不同的工件仓库中(具有相同的组ID和工件ID),并按照android项目的风格使用它们并构建变体。
Something like this 像这样
allprojects {
repositories {
google()
jcenter()
if(flavor == 'A')
maven {
url 'https://example.net/repoA'
}
if(flavor == 'B')
maven {
url 'https://example.net/repoB'
}
if(variant == 'debug')
maven {
url 'https://example.net/repoDebug'
}
}
}
productFlavors {
A {
repositories {
maven { url 'https://example.net/repoA'}
}
}
B {
repositories {
maven { url 'https://example.net/repoB'}
}
}
}
Source: this answer . 资料来源: 这个答案 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.