本文整理汇总了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);
}
示例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();
}
示例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);
}
示例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;
}
示例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);
}
});
}
示例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);
}
示例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;
}
示例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;
}
示例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));
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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;
}
示例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;
}
示例14: isConvertable
import org.gradle.api.artifacts.ExcludeRule; //导入依赖的package包/类
private boolean isConvertable(ExcludeRule excludeRule) {
return excludeRule.getGroup()!= null || excludeRule.getModule()!= null;
}
示例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);
}