Examples of DefaultExcludeRule


Examples of org.gradle.api.internal.artifacts.DefaultExcludeRule

        excludeRuleConverter = new DefaultExcludeRuleConverter();  
    }
   
    @Test
    public void convertableRule() {
        DefaultExcludeRule excludeRule = new DefaultExcludeRule(GUtil.map(ExcludeRule.GROUP_KEY, TEST_ORG, ExcludeRule.MODULE_KEY, TEST_MODULE));
        Exclusion mavenExclude = excludeRuleConverter.convert(excludeRule);
        assertEquals(TEST_ORG, mavenExclude.getGroupId());
        assertEquals(TEST_MODULE, mavenExclude.getArtifactId());
    }
View Full Code Here

Examples of org.gradle.api.internal.artifacts.DefaultExcludeRule

        assertEquals(TEST_MODULE, mavenExclude.getArtifactId());
    }
   
    @Test
    public void unconvertableRules() {
        checkForNull(new DefaultExcludeRule(WrapUtil.toMap(ExcludeRule.GROUP_KEY, TEST_ORG)));
        checkForNull(new DefaultExcludeRule(WrapUtil.toMap(ExcludeRule.MODULE_KEY, TEST_MODULE)));
    }
View Full Code Here

Examples of org.gradle.api.internal.artifacts.DefaultExcludeRule

        this.excludeRules = excludeRules;
    }

    public DefaultConfiguration exclude(Map<String, String> excludeRuleArgs) {
        throwExceptionIfNotInUnresolvedState();
        excludeRules.add(new DefaultExcludeRule(excludeRuleArgs));
        return this;
    }
View Full Code Here

Examples of org.gradle.api.internal.artifacts.DefaultExcludeRule

        // todo An ExcludeRule is a value object but we don't enforce immutability for DefaultExcludeRule as strong as we
        // should (we expose the Map). We should provide a better API for ExcludeRule (I don't want to use unmodifiable Map).
        // As soon as DefaultExcludeRule is truly immutable, we don't need to create a new instance of DefaultExcludeRule.
        for (ExcludeRule excludeRule : getExcludeRules()) {
            copiedConfiguration.excludeRules.add(new DefaultExcludeRule(excludeRule.getExcludeArgs()));
        }

        for (Dependency dependency : dependencies) {
            copiedConfiguration.addDependency(dependency.copy());
        }
View Full Code Here

Examples of org.gradle.api.internal.artifacts.DefaultExcludeRule

        getDependency().exclude(excludeArgs1);
        getDependency().exclude(excludeArgs2);

        assertThat(getDependency().getExcludeRules().size(), equalTo(2));
        assertThat(getDependency().getExcludeRules(), hasItem((ExcludeRule) new DefaultExcludeRule(excludeArgs1)));
        assertThat(getDependency().getExcludeRules(), hasItem((ExcludeRule) new DefaultExcludeRule(excludeArgs2)));
    }
View Full Code Here

Examples of org.gradle.api.internal.artifacts.DefaultExcludeRule

        Map<String, String> excludeArgs1 = toMap("org", "value");
        Map<String, String> excludeArgs2 = toMap("org2", "value2");
        assertThat(configuration.exclude(excludeArgs1), sameInstance(configuration));
        configuration.exclude(excludeArgs2);
        assertThat(configuration.getExcludeRules(), equalTo(WrapUtil.<ExcludeRule>toSet(
                new DefaultExcludeRule(excludeArgs1), new DefaultExcludeRule(excludeArgs2))));
    }
View Full Code Here

Examples of org.gradle.api.internal.artifacts.DefaultExcludeRule

                new DefaultExcludeRule(excludeArgs1), new DefaultExcludeRule(excludeArgs2))));
    }

    @Test
    public void setExclude() {
        Set<ExcludeRule> excludeRules = WrapUtil.<ExcludeRule>toSet(new DefaultExcludeRule(toMap("org", "value")));
        configuration.setExcludeRules(excludeRules);
        assertThat(configuration.getExcludeRules(), equalTo(excludeRules));
    }
View Full Code Here

Examples of org.gradle.api.internal.artifacts.DefaultExcludeRule

    }

    @Test
    public void testInitWithRules() {
        Set<ExcludeRule> sourceExcludeRules = new HashSet<ExcludeRule>();
        sourceExcludeRules.add(new DefaultExcludeRule(WrapUtil.toMap("key", "value")));
        DefaultExcludeRuleContainer defaultExcludeRuleContainer = new DefaultExcludeRuleContainer(sourceExcludeRules);
        assertThat(defaultExcludeRuleContainer.getRules(), equalTo(sourceExcludeRules));
        assertThat(defaultExcludeRuleContainer.getRules(), not(sameInstance(sourceExcludeRules)));
    }
View Full Code Here

Examples of org.gradle.api.internal.artifacts.DefaultExcludeRule

        + dependency);
  }

  private void addExcludeRule(ModuleDependency dependency, Exclusion exclusion) {
    logger.info("Adding managed exclusion rule " + exclusion + " to " + dependency);
    DefaultExcludeRule rule = new DefaultExcludeRule(exclusion.getGroupId(),
        exclusion.getArtifactId());
    dependency.getExcludeRules().add(rule);
  }
View Full Code Here

Examples of org.gradle.api.internal.artifacts.DefaultExcludeRule

  private void addImplicitExcludeRules(ModuleDependency dependency) {
    if (isStarter(dependency)) {
      logger.info("Adding implicit managed exclusion rules to starter "
          + dependency);
      dependency.getExcludeRules().add(
          new DefaultExcludeRule("commons-logging", "commons-logging"));
      dependency.getExcludeRules().add(
          new DefaultExcludeRule("commons-logging", "commons-logging-api"));
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.