当前位置: 首页>>代码示例>>Java>>正文


Java ProductFlavorContainer.getProductFlavor方法代码示例

本文整理汇总了Java中com.android.builder.model.ProductFlavorContainer.getProductFlavor方法的典型用法代码示例。如果您正苦于以下问题:Java ProductFlavorContainer.getProductFlavor方法的具体用法?Java ProductFlavorContainer.getProductFlavor怎么用?Java ProductFlavorContainer.getProductFlavor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.android.builder.model.ProductFlavorContainer的用法示例。


在下文中一共展示了ProductFlavorContainer.getProductFlavor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAndroidSources

import com.android.builder.model.ProductFlavorContainer; //导入方法依赖的package包/类
private Map<String, Set<File>> getAndroidSources(ProductFlavorContainer defaultConfig) {

    Map<String, Set<File>> sources = new HashMap<>();
    ProductFlavor productFlavor = defaultConfig.getProductFlavor();
    String name = productFlavor.getName();

    SourceProvider sourceProvider = defaultConfig.getSourceProvider();
    AndroidSupport.setAndroidSources(sources, sourceProvider, false);

    // extra
    Collection<SourceProviderContainer> extraSourceProviders =
        defaultConfig.getExtraSourceProviders();
    extraSourceProviders.forEach(
        sourceProviderContainer -> {
          String artifactName = sourceProviderContainer.getArtifactName();
          SourceProvider provider = sourceProviderContainer.getSourceProvider();
          boolean isTest = artifactName.contains(TEST_SUFFIX);
          AndroidSupport.setAndroidSources(sources, provider, isTest);
        });

    return sources;
  }
 
开发者ID:mopemope,项目名称:meghanada-server,代码行数:23,代码来源:AndroidSupport.java

示例2: addResConfigsFromFlavor

import com.android.builder.model.ProductFlavorContainer; //导入方法依赖的package包/类
/**
 * Adds in the resConfig values specified by the given flavor container, assuming
 * it's in one of the relevant variantFlavors, into the given set
 */
private static void addResConfigsFromFlavor(@NonNull Set<String> relevantDensities,
        @Nullable List<String> variantFlavors,
        @NonNull ProductFlavorContainer container) {
    ProductFlavor flavor = container.getProductFlavor();
    if (variantFlavors == null || variantFlavors.contains(flavor.getName())) {
        if (!flavor.getResourceConfigurations().isEmpty()) {
            for (String densityName : flavor.getResourceConfigurations()) {
                Density density = Density.getEnum(densityName);
                if (density != null && density.isRecommended()
                        && density != Density.NODPI && density != Density.ANYDPI) {
                    relevantDensities.add(densityName);
                }
            }
        }
    }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:IconDetector.java

示例3: addResConfigsFromFlavor

import com.android.builder.model.ProductFlavorContainer; //导入方法依赖的package包/类
/**
 * Adds in the resConfig values specified by the given flavor container, assuming
 * it's in one of the relevant variantFlavors, into the given set
 */
private static void addResConfigsFromFlavor(@NonNull Set<String> relevantLanguages,
        @Nullable List<String> variantFlavors,
        @NonNull ProductFlavorContainer container) {
    ProductFlavor flavor = container.getProductFlavor();
    if (variantFlavors == null || variantFlavors.contains(flavor.getName())) {
        if (!flavor.getResourceConfigurations().isEmpty()) {
            for (String resConfig : flavor.getResourceConfigurations()) {
                // Look for languages; these are of length 2. (ResConfigs
                // can also refer to densities, etc.)
                if (resConfig.length() == 2) {
                    relevantLanguages.add(resConfig);
                }
            }
        }
    }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:TranslationDetector.java


注:本文中的com.android.builder.model.ProductFlavorContainer.getProductFlavor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。