org.gradle.api.artifacts.ComponentModuleMetadataDetails Java Examples

The following examples show how to use org.gradle.api.artifacts.ComponentModuleMetadataDetails. 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: ComponentModuleMetadataContainer.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public ComponentModuleMetadataDetails module(final Object sourceModule) {
    final NotationParser<Object, ModuleIdentifier> parser = parser();
    final ModuleIdentifier source = parser.parseNotation(sourceModule);
    return new ComponentModuleMetadataDetails() {
        public void replacedBy(final Object targetModule) {
            ModuleIdentifier target = parser.parseNotation(targetModule);
            detectCycles(replacements, source, target);
            replacements.put(source, target);
        }

        public ModuleIdentifier getId() {
            return source;
        }

        public ModuleIdentifier getReplacedBy() {
            return replacements.get(source);
        }
    };
}
 
Example #2
Source File: ClojureCommonPlugin.java    From clojurephant with Apache License 2.0 6 votes vote down vote up
private void configureDependencyConstraints(Project project) {
  project.getDependencies().getModules().module("org.clojure:tools.nrepl", module -> {
    ComponentModuleMetadataDetails details = (ComponentModuleMetadataDetails) module;
    details.replacedBy("nrepl:nrepl", "nREPL was moved out of Clojure Contrib to its own project.");
  });

  if (JavaVersion.current().isJava9Compatible()) {
    project.getDependencies().constraints(constraints -> {
      constraints.add("devImplementation", "org.clojure:java.classpath:0.3.0", constraint -> {
        constraint.because("Java 9 has a different classloader architecture. 0.3.0 adds support for this.");
      });
      constraints.add("devRuntimeOnly", "org.clojure:java.classpath:0.3.0", constraint -> {
        constraint.because("Java 9 has a different classloader architecture. 0.3.0 adds support for this.");
      });
    });
  }
}
 
Example #3
Source File: ComponentModuleMetadataContainer.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public ComponentModuleMetadataDetails module(final Object sourceModule) {
    final NotationParser<Object, ModuleIdentifier> parser = parser();
    final ModuleIdentifier source = parser.parseNotation(sourceModule);
    return new ComponentModuleMetadataDetails() {
        public void replacedBy(final Object targetModule) {
            ModuleIdentifier target = parser.parseNotation(targetModule);
            detectCycles(replacements, source, target);
            replacements.put(source, target);
        }

        public ModuleIdentifier getId() {
            return source;
        }

        public ModuleIdentifier getReplacedBy() {
            return replacements.get(source);
        }
    };
}