Java 类org.gradle.api.internal.component.Usage 实例源码

项目:Reer    文件:DefaultMavenPublication.java   
public void from(SoftwareComponent component) {
    if (this.component != null) {
        throw new InvalidUserDataException(String.format("Maven publication '%s' cannot include multiple components", name));
    }
    this.component = (SoftwareComponentInternal) component;

    for (Usage usage : this.component.getUsages()) {
        // TODO Need a smarter way to map usage to artifact classifier
        for (PublishArtifact publishArtifact : usage.getArtifacts()) {
            artifact(publishArtifact);
        }

        // TODO Need a smarter way to map usage to scope
        for (ModuleDependency dependency : usage.getDependencies()) {
            if (dependency instanceof ProjectDependency) {
                addProjectDependency((ProjectDependency) dependency);
            } else {
                addModuleDependency(dependency);
            }
        }
    }
}
项目:Pushjet-Android    文件:DefaultMavenPublication.java   
public void from(SoftwareComponent component) {
    if (this.component != null) {
        throw new InvalidUserDataException(String.format("Maven publication '%s' cannot include multiple components", name));
    }
    this.component = (SoftwareComponentInternal) component;

    for (Usage usage : this.component.getUsages()) {
        // TODO Need a smarter way to map usage to artifact classifier
        for (PublishArtifact publishArtifact : usage.getArtifacts()) {
            artifact(publishArtifact);
        }

        // TODO Need a smarter way to map usage to scope
        for (ModuleDependency dependency : usage.getDependencies()) {
            if (dependency instanceof ProjectDependency) {
                addProjectDependency((ProjectDependency) dependency);
            } else {
                addModuleDependency(dependency);
            }
        }
    }
}
项目:Pushjet-Android    文件:DefaultMavenPublication.java   
public void from(SoftwareComponent component) {
    if (this.component != null) {
        throw new InvalidUserDataException(String.format("Maven publication '%s' cannot include multiple components", name));
    }
    this.component = (SoftwareComponentInternal) component;

    for (Usage usage : this.component.getUsages()) {
        // TODO Need a smarter way to map usage to artifact classifier
        for (PublishArtifact publishArtifact : usage.getArtifacts()) {
            artifact(publishArtifact);
        }

        // TODO Need a smarter way to map usage to scope
        for (ModuleDependency dependency : usage.getDependencies()) {
            if (dependency instanceof ProjectDependency) {
                addProjectDependency((ProjectDependency) dependency);
            } else {
                addModuleDependency(dependency);
            }
        }
    }
}
项目:Reer    文件:DefaultIvyPublication.java   
public void from(SoftwareComponent component) {
    if (this.component != null) {
        throw new InvalidUserDataException(String.format("Ivy publication '%s' cannot include multiple components", name));
    }
    this.component = (SoftwareComponentInternal) component;

    configurations.maybeCreate("default");

    for (Usage usage : this.component.getUsages()) {
        String conf = usage.getName();
        configurations.maybeCreate(conf);
        configurations.getByName("default").extend(conf);

        for (PublishArtifact publishArtifact : usage.getArtifacts()) {
            artifact(publishArtifact).setConf(conf);
        }

        for (ModuleDependency dependency : usage.getDependencies()) {
            // TODO: When we support multiple components or configurable dependencies, we'll need to merge the confs of multiple dependencies with same id.
            String confMapping = String.format("%s->%s", conf, dependency.getTargetConfiguration() == null ? Dependency.DEFAULT_CONFIGURATION : dependency.getTargetConfiguration());
            if (dependency instanceof ProjectDependency) {
                addProjectDependency((ProjectDependency) dependency, confMapping);
            } else {
                addModuleDependency(dependency, confMapping);
            }
        }
    }
}
项目:Pushjet-Android    文件:DefaultIvyPublication.java   
public void from(SoftwareComponent component) {
    if (this.component != null) {
        throw new InvalidUserDataException(String.format("Ivy publication '%s' cannot include multiple components", name));
    }
    this.component = (SoftwareComponentInternal) component;

    configurations.maybeCreate("default");

    for (Usage usage : this.component.getUsages()) {
        String conf = usage.getName();
        configurations.maybeCreate(conf);
        configurations.getByName("default").extend(conf);

        for (PublishArtifact publishArtifact : usage.getArtifacts()) {
            artifact(publishArtifact).setConf(conf);
        }

        for (ModuleDependency dependency : usage.getDependencies()) {
            // TODO: When we support multiple components or configurable dependencies, we'll need to merge the confs of multiple dependencies with same id.
            String confMapping = String.format("%s->%s", conf, dependency.getConfiguration());
            if (dependency instanceof ProjectDependency) {
                addProjectDependency((ProjectDependency) dependency, confMapping);
            } else {
                addModuleDependency(dependency, confMapping);
            }
        }
    }
}
项目:Pushjet-Android    文件:DefaultIvyPublication.java   
public void from(SoftwareComponent component) {
    if (this.component != null) {
        throw new InvalidUserDataException(String.format("Ivy publication '%s' cannot include multiple components", name));
    }
    this.component = (SoftwareComponentInternal) component;

    configurations.maybeCreate("default");

    for (Usage usage : this.component.getUsages()) {
        String conf = usage.getName();
        configurations.maybeCreate(conf);
        configurations.getByName("default").extend(conf);

        for (PublishArtifact publishArtifact : usage.getArtifacts()) {
            artifact(publishArtifact).setConf(conf);
        }

        for (ModuleDependency dependency : usage.getDependencies()) {
            // TODO: When we support multiple components or configurable dependencies, we'll need to merge the confs of multiple dependencies with same id.
            String confMapping = String.format("%s->%s", conf, dependency.getConfiguration());
            if (dependency instanceof ProjectDependency) {
                addProjectDependency((ProjectDependency) dependency, confMapping);
            } else {
                addModuleDependency(dependency, confMapping);
            }
        }
    }
}
项目:Reer    文件:JavaLibrary.java   
public Set<Usage> getUsages() {
    return Collections.singleton(runtimeUsage);
}
项目:Reer    文件:WebApplication.java   
public Set<Usage> getUsages() {
    return Collections.singleton(webArchiveUsage);
}
项目:atlas    文件:AndroidComponent.java   
@Override
public Set<Usage> getUsages() {
    return Collections.singleton(runtimeUsage);
}
项目:Pushjet-Android    文件:JavaLibrary.java   
public Set<Usage> getUsages() {
    return Collections.singleton(runtimeUsage);
}
项目:Pushjet-Android    文件:WebApplication.java   
public Set<Usage> getUsages() {
    return Collections.singleton(webArchiveUsage);
}
项目:Pushjet-Android    文件:JavaLibrary.java   
public Set<Usage> getUsages() {
    return Collections.singleton(runtimeUsage);
}
项目:Pushjet-Android    文件:WebApplication.java   
public Set<Usage> getUsages() {
    return Collections.singleton(webArchiveUsage);
}