Java Code Examples for org.apache.ivy.plugins.matcher.ExactPatternMatcher#INSTANCE

The following examples show how to use org.apache.ivy.plugins.matcher.ExactPatternMatcher#INSTANCE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IvyTranslations.java    From jeka with Apache License 2.0 6 votes vote down vote up
private static DefaultExcludeRule toExcludeRule(JkDepExclude depExclude, Iterable<String> allRootConfs) {
    final String type = depExclude.getType() == null ? PatternMatcher.ANY_EXPRESSION : depExclude
            .getType();
    final String ext = depExclude.getExt() == null ? PatternMatcher.ANY_EXPRESSION : depExclude
            .getExt();
    final ArtifactId artifactId = new ArtifactId(toModuleId(depExclude.getModuleId()), "*", type,
            ext);
    final DefaultExcludeRule result = new DefaultExcludeRule(artifactId,
            ExactPatternMatcher.INSTANCE, null);
    for (final JkScope scope : depExclude.getScopes()) {
        result.addConfiguration(scope.getName());
    }
    if (depExclude.getScopes().isEmpty()) {
        for (final String conf : allRootConfs) {
            result.addConfiguration(conf);
        }

    }
    return result;
}
 
Example 2
Source File: IvyEventFilter.java    From ant-ivy with Apache License 2.0 6 votes vote down vote up
public IvyEventFilter(String event, String filterExpression, PatternMatcher matcher) {
    this.matcher = (matcher == null) ? ExactPatternMatcher.INSTANCE : matcher;
    if (event == null) {
        nameFilter = NoFilter.instance();
    } else {
        final Matcher eventNameMatcher = this.matcher.getMatcher(event);
        nameFilter = new Filter<IvyEvent>() {
            public boolean accept(IvyEvent e) {
                return eventNameMatcher.matches(e.getName());
            }
        };
    }
    if (isNullOrEmpty(filterExpression)) {
        attFilter = NoFilter.instance();
    } else {
        attFilter = parseExpression(filterExpression);
    }
}
 
Example 3
Source File: IvyConfigurationProvider.java    From walkmod-core with GNU Lesser General Public License v3.0 6 votes vote down vote up
public void addArtifact(String groupId, String artifactId, String version) throws Exception {

		artifacts.add(groupId+":"+artifactId+":"+version);

		String[] dep = null;
		dep = new String[] { groupId, artifactId, version };
		if (md == null) {
			md = DefaultModuleDescriptor.newDefaultInstance(ModuleRevisionId.newInstance(dep[0], dep[1] + "-caller",
					"working"));
		}
		DefaultDependencyDescriptor dd = new DefaultDependencyDescriptor(md, ModuleRevisionId.newInstance(dep[0],
				dep[1], dep[2]), false, false, true);
		md.addDependency(dd);
		ExcludeRule er = new DefaultExcludeRule(new ArtifactId(new ModuleId("org.walkmod", "walkmod-core"),
				PatternMatcher.ANY_EXPRESSION, PatternMatcher.ANY_EXPRESSION, PatternMatcher.ANY_EXPRESSION),
				ExactPatternMatcher.INSTANCE, null);
		dd.addExcludeRule(null, er);
	}
 
Example 4
Source File: IvyConfigurationProvider.java    From walkmod-core with GNU Lesser General Public License v3.0 6 votes vote down vote up
public void addArtifact(String groupId, String artifactId, String version) throws Exception {

		artifacts.add(groupId+":"+artifactId+":"+version);

		String[] dep = null;
		dep = new String[] { groupId, artifactId, version };
		if (md == null) {
			md = DefaultModuleDescriptor.newDefaultInstance(ModuleRevisionId.newInstance(dep[0], dep[1] + "-caller",
					"working"));
		}
		DefaultDependencyDescriptor dd = new DefaultDependencyDescriptor(md, ModuleRevisionId.newInstance(dep[0],
				dep[1], dep[2]), false, false, true);
		md.addDependency(dd);
		ExcludeRule er = new DefaultExcludeRule(new ArtifactId(new ModuleId("org.walkmod", "walkmod-core"),
				PatternMatcher.ANY_EXPRESSION, PatternMatcher.ANY_EXPRESSION, PatternMatcher.ANY_EXPRESSION),
				ExactPatternMatcher.INSTANCE, null);
		dd.addExcludeRule(null, er);
	}
 
Example 5
Source File: DefaultExcludeRuleConverter.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
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;
}
 
Example 6
Source File: DefaultExcludeRuleConverter.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
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;
}
 
Example 7
Source File: DefaultExcludeRuleConverter.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
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;
}
 
Example 8
Source File: DefaultExcludeRuleConverter.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
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;
}
 
Example 9
Source File: IvyNodeUsage.java    From ant-ivy with Apache License 2.0 5 votes vote down vote up
private static IncludeRule includeAllArtifacts() {
    final ArtifactId aid = new ArtifactId(
            new ModuleId(PatternMatcher.ANY_EXPRESSION, PatternMatcher.ANY_EXPRESSION),
            PatternMatcher.ANY_EXPRESSION, PatternMatcher.ANY_EXPRESSION,
            PatternMatcher.ANY_EXPRESSION);
    return new DefaultIncludeRule(aid, ExactPatternMatcher.INSTANCE, null);
}