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


Java ApplicationVariant类代码示例

本文整理汇总了Java中com.android.build.gradle.api.ApplicationVariant的典型用法代码示例。如果您正苦于以下问题:Java ApplicationVariant类的具体用法?Java ApplicationVariant怎么用?Java ApplicationVariant使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ApplicationVariant类属于com.android.build.gradle.api包,在下文中一共展示了ApplicationVariant类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: LegacyPlaceholderTaskApplicator

import com.android.build.gradle.api.ApplicationVariant; //导入依赖的package包/类
LegacyPlaceholderTaskApplicator(Project project) throws Exception {
    super(project);

    method_getOutputs = ApplicationVariant.class.getMethod("getOutputs");
    method_getOutputs.setAccessible(true);

    method_setResDir = ProcessAndroidResources.class.getMethod("setResDir", File.class);
    method_setResDir.setAccessible(true);
}
 
开发者ID:benjamin-bader,项目名称:placeholders-plugin,代码行数:10,代码来源:LegacyPlaceholderTaskApplicator.java

示例2: writeFeatureFiles

import com.android.build.gradle.api.ApplicationVariant; //导入依赖的package包/类
private void writeFeatureFiles(final Project project) {
    checkProductFlavorsExist(project);
    for (ApplicationVariant applicationVariant : getApplicationVariants(project)) {
        setupFeaturesSource(project, applicationVariant);
        writeFeatureFile(project, applicationVariant);
    }
}
 
开发者ID:michaelengland,项目名称:FlipTheSwitch-Android,代码行数:8,代码来源:FlipTheSwitchPlugin.java

示例3: setupFeaturesSource

import com.android.build.gradle.api.ApplicationVariant; //导入依赖的package包/类
private void setupFeaturesSource(final Project project, final ApplicationVariant applicationVariant) {
    final JavaCompile javaCompile = applicationVariant.getJavaCompile();
    javaCompile.doFirst(new Action<Task>() {
        @Override
        public void execute(Task task) {
            writeFeatureFile(project, applicationVariant);
        }
    });
}
 
开发者ID:michaelengland,项目名称:FlipTheSwitch-Android,代码行数:10,代码来源:FlipTheSwitchPlugin.java

示例4: writeFeatureFile

import com.android.build.gradle.api.ApplicationVariant; //导入依赖的package包/类
private void writeFeatureFile(final Project project, final ApplicationVariant applicationVariant) {
    featuresFile(project, applicationVariant).mkdirs();
    FeaturesWriter featuresWriter = new FeaturesWriter(getFeatures(project, applicationVariant));
    try {
        featuresWriter.build().writeTo(featuresFile(project, applicationVariant));
    } catch (IOException e) {
        throw new GradleException("Failure writing to " + featuresFile(project, applicationVariant), e);
    }
}
 
开发者ID:michaelengland,项目名称:FlipTheSwitch-Android,代码行数:10,代码来源:FlipTheSwitchPlugin.java

示例5: getFeatures

import com.android.build.gradle.api.ApplicationVariant; //导入依赖的package包/类
private Collection<Feature> getFeatures(final Project project, final ApplicationVariant applicationVariant) {
    checkOverriddenFeaturesExist(project, applicationVariant);
    Collection<Feature> defaultFeatures = new ArrayList<>();
    for (FeatureDefinition featureDefinition : getDefaultConfig(project)) {
        boolean isEnabled;
        if (getOverrides(project, applicationVariant).containsKey(featureDefinition.name())) {
            isEnabled = getOverrides(project, applicationVariant).get(featureDefinition.name());
        } else {
            isEnabled = featureDefinition.enabled();
        }
        defaultFeatures.add(new Feature(featureDefinition.name(), featureDefinition.description(), isEnabled));
    }
    return defaultFeatures;
}
 
开发者ID:michaelengland,项目名称:FlipTheSwitch-Android,代码行数:15,代码来源:FlipTheSwitchPlugin.java

示例6: checkOverriddenFeaturesExist

import com.android.build.gradle.api.ApplicationVariant; //导入依赖的package包/类
private void checkOverriddenFeaturesExist(final Project project, final ApplicationVariant applicationVariant) {
    Collection<String> featureNames = getFeatureNames(project);
    for (String name : getOverrides(project, applicationVariant).keySet()) {
        if (!featureNames.contains(name)) {
            throw new GradleException("You cannot have feature overrides for a non-existent feature (" + name +
                    ")");
        }
    }
}
 
开发者ID:michaelengland,项目名称:FlipTheSwitch-Android,代码行数:10,代码来源:FlipTheSwitchPlugin.java

示例7: getOverrides

import com.android.build.gradle.api.ApplicationVariant; //导入依赖的package包/类
private Map<String, Boolean> getOverrides(final Project project, final ApplicationVariant applicationVariant) {
    ProductFlavorConfig productFlavorConfig = getProductFlavorConfigs(project)
            .findByName(applicationVariant.getFlavorName());
    if (productFlavorConfig == null) {
        return new HashMap<>();
    } else {
        return getOverrides(productFlavorConfig);
    }
}
 
开发者ID:michaelengland,项目名称:FlipTheSwitch-Android,代码行数:10,代码来源:FlipTheSwitchPlugin.java

示例8: getApkFile

import com.android.build.gradle.api.ApplicationVariant; //导入依赖的package包/类
private File getApkFile(AndroidPublisherExtension publisherExtension) {
	String variantName = publisherExtension.getVariantName();
	DomainObjectSet<ApplicationVariant> variants = getProject().getExtensions().getByType(AppExtension.class).getApplicationVariants();
	ApplicationVariant variant = null;
	getLogger().info(String.format("Looking for %s variant in outputs", variantName));
	for (ApplicationVariant v : variants) {
		getLogger().debug(String.format("Found variant %s", v.getName()));
		if (v.getName().equals(variantName)) {
			getLogger().debug(String.format("Variant %s will be used", variantName));
			variant = v;
			break;
		}
	}
	if (variant == null) {
		throw new InvalidUserDataException(String.format(
				"Cannot find %s variant for android configuration", variantName));
	}

	for(BaseVariantOutput output : variant.getOutputs()) {
		getLogger().debug(String.format("Found output %s (%s)", output.getName(), output.getBaseName()));
		if (output!=null) {
			getLogger().debug(String.format("Output %s will be used", output.getName()));
			return output.getOutputFile();
		}
	}
	throw new InvalidUserDataException(String.format(
			"Cannot find APK output file for %s variant", variantName));
}
 
开发者ID:bluesliverx,项目名称:gradle-android-publisher,代码行数:29,代码来源:AndroidPublishTask.java

示例9: getApplicationVariants

import com.android.build.gradle.api.ApplicationVariant; //导入依赖的package包/类
private Collection<ApplicationVariant> getApplicationVariants(final Project project) {
    return findAndroidAppExtension(project).getApplicationVariants();
}
 
开发者ID:michaelengland,项目名称:FlipTheSwitch-Android,代码行数:4,代码来源:FlipTheSwitchPlugin.java

示例10: featuresFile

import com.android.build.gradle.api.ApplicationVariant; //导入依赖的package包/类
private File featuresFile(final Project project, final ApplicationVariant applicationVariant) {
    return new File(project.getBuildDir() + "/generated/source/buildConfig/" + applicationVariant.getDirName());
}
 
开发者ID:michaelengland,项目名称:FlipTheSwitch-Android,代码行数:4,代码来源:FlipTheSwitchPlugin.java

示例11: addVariant

import com.android.build.gradle.api.ApplicationVariant; //导入依赖的package包/类
@Override
public void addVariant(BaseVariant variant) {
    applicationVariantList.add((ApplicationVariant) variant);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:TestExtension.java

示例12: apply

import com.android.build.gradle.api.ApplicationVariant; //导入依赖的package包/类
@Override
public Consumer<BufferedImage> apply(ApplicationVariant variant, File iconFile) {
    return new ColorRibbonFilter(variant.getBuildType().getName(), Color.decode(nm));
}
 
开发者ID:maskarade,项目名称:gradle-android-ribbonizer-plugin,代码行数:5,代码来源:CustomColorRibbonBuilder.java

示例13: grayScaleFilter

import com.android.build.gradle.api.ApplicationVariant; //导入依赖的package包/类
public Consumer<BufferedImage> grayScaleFilter(ApplicationVariant variant, File iconFile) {
    return new GrayScaleBuilder().apply(variant, iconFile);
}
 
开发者ID:maskarade,项目名称:gradle-android-ribbonizer-plugin,代码行数:4,代码来源:RibbonizerExtension.java

示例14: grayRibbonFilter

import com.android.build.gradle.api.ApplicationVariant; //导入依赖的package包/类
public Consumer<BufferedImage> grayRibbonFilter(ApplicationVariant variant, File iconFile) {
    return new GrayRibbonBuilder().apply(variant, iconFile);
}
 
开发者ID:maskarade,项目名称:gradle-android-ribbonizer-plugin,代码行数:4,代码来源:RibbonizerExtension.java

示例15: yellowRibbonFilter

import com.android.build.gradle.api.ApplicationVariant; //导入依赖的package包/类
public Consumer<BufferedImage> yellowRibbonFilter(ApplicationVariant variant, File iconFile) {
    return new YellowRibbonBuilder().apply(variant, iconFile);
}
 
开发者ID:maskarade,项目名称:gradle-android-ribbonizer-plugin,代码行数:4,代码来源:RibbonizerExtension.java


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