简体   繁体   English

我们可以按风味组织存储库并构建变体吗?

[英]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.

相关问题 如何结合构建类型和风格来获得构建变体调试<Flavor> - How combine build type and flavor to get a build variant debug<Flavor> Vector Drawable 不会被 Build Variant Flavor Dimension 覆盖 - Vector Drawable Not Overwritten by Build Variant Flavor Dimension 基于 App Variant 的构建配置(BuildType + Flavor) - Build Configurations based on App Variant (BuildType + Flavor) 在Android应用程序中获取产品风味或构建变体 - Get product flavor or build variant in an android app 使用flavor Dimensions时是否可以排除特定的构建变体? - Is it possible to exclude specific build variant when using flavor Dimensions? 根据风格在 gradle 同步/构建变体更改后复制文件 - Copy a file after gradle sync/build variant change depending on flavor Android风格和构建变体特定的appboy.xml文件 - Android flavor and build variant specific appboy.xml file Android Gradle 使用 API 声明 Variant Build Flavor 依赖项并在 KTS 中排除 - Android Gradle declare a Variant Build Flavor dependency using API and Exclude in KTS 由于生成风格问题,无法添加动态功能模块 - Can't add a dynamic feature module because of build flavor problems 如何在build.gradle中获取风味尺寸列表? - How can I get the list of flavor dimensions in build.gradle?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM