【问题标题】:Can we organize repositories by flavor and build variant我们可以按风格组织存储库并构建变体吗
【发布时间】:2019-07-20 09:59:45
【问题描述】:

我正在接管一个可以在许多国家/地区部署的 android 项目。现在我在自定义 Jfrog Artifactory 服务器上有一组库。

我很好奇的是我可以将这个库集克隆到不同的工件存储库中(具有相同的组 ID 和工件 ID)并按照 android 项目的风格使用它们并构建变体。

类似的东西

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'
        }
    }
}

【问题讨论】:

    标签: android artifactory variant android-flavors


    【解决方案1】:
    productFlavors {
     A {
      repositories {
        maven { url 'https://example.net/repoA'} 
      }
     }
     B {
      repositories {
        maven { url 'https://example.net/repoB'} 
      }
     }
    }
    

    来源:this answer

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-04-03
      • 2016-03-31
      • 1970-01-01
      • 1970-01-01
      • 2020-03-08
      • 1970-01-01
      • 2018-12-23
      • 1970-01-01
      相关资源
      最近更新 更多