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


Java ExcludeRule类代码示例

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


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

示例1: addDependency

import org.gradle.api.artifacts.ExcludeRule; //导入依赖的package包/类
private void addDependency(MavenDependencyInternal dependency, String artifactId, String scope, String type, String classifier) {
    Dependency mavenDependency = new Dependency();
    mavenDependency.setGroupId(dependency.getGroupId());
    mavenDependency.setArtifactId(artifactId);
    mavenDependency.setVersion(mapToMavenSyntax(dependency.getVersion()));
    mavenDependency.setType(type);
    mavenDependency.setScope(scope);
    mavenDependency.setClassifier(classifier);

    for (ExcludeRule excludeRule : dependency.getExcludeRules()) {
        Exclusion exclusion = new Exclusion();
        exclusion.setGroupId(GUtil.elvis(excludeRule.getGroup(), "*"));
        exclusion.setArtifactId(GUtil.elvis(excludeRule.getModule(), "*"));
        mavenDependency.addExclusion(exclusion);
    }

    getModel().addDependency(mavenDependency);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:19,代码来源:MavenPomFileGenerator.java

示例2: writeDependencies

import org.gradle.api.artifacts.ExcludeRule; //导入依赖的package包/类
private void writeDependencies(OptionalAttributeXmlWriter xmlWriter) throws IOException {
    xmlWriter.startElement("dependencies");
    for (IvyDependencyInternal dependency : dependencies) {
        xmlWriter.startElement("dependency")
                .attribute("org", dependency.getOrganisation())
                .attribute("name", dependency.getModule())
                .attribute("rev", dependency.getRevision())
                .attribute("conf", dependency.getConfMapping());

        if (!dependency.isTransitive()) {
            xmlWriter.attribute("transitive", "false");
        }

        for (DependencyArtifact dependencyArtifact : dependency.getArtifacts()) {
            printDependencyArtifact(dependencyArtifact, xmlWriter);
        }
        for(ExcludeRule excludeRule : dependency.getExcludeRules()) {
            writeDependencyExclude(excludeRule, xmlWriter);
        }
        xmlWriter.endElement();
    }
    xmlWriter.endElement();
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:24,代码来源:IvyDescriptorFileGenerator.java

示例3: addDependency

import org.gradle.api.artifacts.ExcludeRule; //导入依赖的package包/类
private void addDependency(MavenDependencyInternal dependency, String artifactId, String scope, String type, String classifier) {
    Dependency mavenDependency = new Dependency();
    mavenDependency.setGroupId(dependency.getGroupId());
    mavenDependency.setArtifactId(artifactId);
    mavenDependency.setVersion(dependency.getVersion());
    mavenDependency.setType(type);
    mavenDependency.setScope(scope);
    mavenDependency.setClassifier(classifier);

    for (ExcludeRule excludeRule : dependency.getExcludeRules()) {
        Exclusion exclusion = new Exclusion();
        exclusion.setGroupId(GUtil.elvis(excludeRule.getGroup(), "*"));
        exclusion.setArtifactId(GUtil.elvis(excludeRule.getModule(), "*"));
        mavenDependency.addExclusion(exclusion);
    }

    getModel().addDependency(mavenDependency);
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:19,代码来源:MavenPomFileGenerator.java

示例4: convert

import org.gradle.api.artifacts.ExcludeRule; //导入依赖的package包/类
public Exclusion convert(ExcludeRule excludeRule) {
    if (isConvertable(excludeRule)) {
        Exclusion exclusion = new Exclusion();
        exclusion.setGroupId(determineExclusionExpression(excludeRule.getGroup()));
        exclusion.setArtifactId(determineExclusionExpression(excludeRule.getModule()));
        return exclusion;
    }
    return null;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:10,代码来源:DefaultExcludeRuleConverter.java

示例5: convertExcludeRules

import org.gradle.api.artifacts.ExcludeRule; //导入依赖的package包/类
protected List<Exclude> convertExcludeRules(final String configuration, Set<ExcludeRule> excludeRules) {
    return CollectionUtils.collect((Iterable<ExcludeRule>) excludeRules, new Transformer<Exclude, ExcludeRule>() {
        @Override
        public Exclude transform(ExcludeRule excludeRule) {
            return excludeRuleConverter.convertExcludeRule(configuration, excludeRule);
        }
    });
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:AbstractIvyDependencyDescriptorFactory.java

示例6: parseMap

import org.gradle.api.artifacts.ExcludeRule; //导入依赖的package包/类
protected ExcludeRule parseMap(@MapKey(ExcludeRule.GROUP_KEY) @Optional String group,
                     @MapKey(ExcludeRule.MODULE_KEY) @Optional String module) {
    if (group == null && module == null) {
        throw new InvalidUserDataException("Dependency exclude rule requires 'group' and/or 'module' specified. For example: [group: 'com.google.collections']");
    }
    return new DefaultExcludeRule(group, module);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:ExcludeRuleNotationConverter.java

示例7: convert

import org.gradle.api.artifacts.ExcludeRule; //导入依赖的package包/类
public Exclusion convert(ExcludeRule excludeRule) {
    if (isConvertable(excludeRule)) {
        Exclusion exclusion = new Exclusion();
        exclusion.setGroupId(excludeRule.getGroup());
        exclusion.setArtifactId(excludeRule.getModule());
        return exclusion;
    }
    return null;
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:10,代码来源:DefaultExcludeRuleConverter.java

示例8: createExcludeRule

import org.gradle.api.artifacts.ExcludeRule; //导入依赖的package包/类
public DefaultExcludeRule createExcludeRule(String configurationName, ExcludeRule excludeRule) {
    String org = GUtil.elvis(excludeRule.getGroup(), PatternMatcher.ANY_EXPRESSION);
    String module = GUtil.elvis(excludeRule.getModule(), PatternMatcher.ANY_EXPRESSION);
    DefaultExcludeRule ivyExcludeRule = new DefaultExcludeRule(new ArtifactId(
            IvyUtil.createModuleId(org, module), PatternMatcher.ANY_EXPRESSION,
            PatternMatcher.ANY_EXPRESSION,
            PatternMatcher.ANY_EXPRESSION),
            ExactPatternMatcher.INSTANCE, null);
    ivyExcludeRule.addConfiguration(configurationName);
    return ivyExcludeRule;
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:12,代码来源:DefaultExcludeRuleConverter.java

示例9: addExcludes

import org.gradle.api.artifacts.ExcludeRule; //导入依赖的package包/类
private void addExcludes(String configuration, Set<ExcludeRule> excludeRules,
                         DefaultDependencyDescriptor dependencyDescriptor) {
    for (ExcludeRule excludeRule : excludeRules) {
        dependencyDescriptor.addExcludeRule(configuration, excludeRuleConverter.createExcludeRule(configuration,
                excludeRule));
    }
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:8,代码来源:AbstractIvyDependencyDescriptorFactory.java

示例10: addExcludeRules

import org.gradle.api.artifacts.ExcludeRule; //导入依赖的package包/类
private void addExcludeRules(MutableLocalComponentMetaData metaData, Collection<? extends Configuration> configurations) {
    for (Configuration configuration : configurations) {
        for (ExcludeRule excludeRule : configuration.getExcludeRules()) {
            org.apache.ivy.core.module.descriptor.ExcludeRule rule = excludeRuleConverter.createExcludeRule(
                    configuration.getName(), excludeRule);
            metaData.addExcludeRule(rule);
        }
    }
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:10,代码来源:DefaultDependenciesToModuleDescriptorConverter.java

示例11: addExcludeRules

import org.gradle.api.artifacts.ExcludeRule; //导入依赖的package包/类
private void addExcludeRules(DefaultModuleDescriptor moduleDescriptor, Collection<? extends Configuration> configurations) {
    for (Configuration configuration : configurations) {
        for (ExcludeRule excludeRule : configuration.getExcludeRules()) {
            org.apache.ivy.core.module.descriptor.ExcludeRule rule = excludeRuleConverter.createExcludeRule(
                    configuration.getName(), excludeRule);
            moduleDescriptor.addExcludeRule(rule);
        }
    }
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:10,代码来源:DefaultDependenciesToModuleDescriptorConverter.java

示例12: getExcludeArgs

import org.gradle.api.artifacts.ExcludeRule; //导入依赖的package包/类
public Map<String, String> getExcludeArgs() {
    DeprecationLogger.nagUserOfDeprecated("The getExcludeArgs method", "Please use the getGroup() method or the getModule() method instead");
    Map excludeArgsAsMap = new HashMap();
    excludeArgsAsMap.put(ExcludeRule.GROUP_KEY, group);
    excludeArgsAsMap.put(ExcludeRule.MODULE_KEY, module);
    return excludeArgsAsMap;
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:8,代码来源:DefaultExcludeRule.java

示例13: parseMap

import org.gradle.api.artifacts.ExcludeRule; //导入依赖的package包/类
protected ExcludeRule parseMap(@MapKey(ExcludeRule.GROUP_KEY) @Optional String group,
                     @MapKey(ExcludeRule.MODULE_KEY) @Optional String module) {
    if (group == null && module == null) {
        throw new InvalidUserDataException("Either a group or module must be specified. For example: [group:'org.gradle']");
    }
    DefaultExcludeRule excluderule = new DefaultExcludeRule();
    excluderule.setGroup(group);
    excluderule.setModule(module);
    return excluderule;
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:11,代码来源:ExcludeRuleNotationParser.java

示例14: isConvertable

import org.gradle.api.artifacts.ExcludeRule; //导入依赖的package包/类
private boolean isConvertable(ExcludeRule excludeRule) {
    return excludeRule.getGroup()!= null || excludeRule.getModule()!= null;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:4,代码来源:DefaultExcludeRuleConverter.java

示例15: DefaultMavenDependency

import org.gradle.api.artifacts.ExcludeRule; //导入依赖的package包/类
public DefaultMavenDependency(String groupId, String artifactId, String version, Collection<DependencyArtifact> artifacts, Collection<ExcludeRule> excludeRules) {
    this(groupId, artifactId, version, artifacts);
    this.excludeRules.addAll(excludeRules);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:5,代码来源:DefaultMavenDependency.java


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