org.gradle.api.internal.component.SoftwareComponentInternal Java Examples

The following examples show how to use org.gradle.api.internal.component.SoftwareComponentInternal. 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: DefaultMavenPublication.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
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);
            }
        }
    }
}
 
Example #2
Source File: DefaultMavenPublication.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
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);
            }
        }
    }
}
 
Example #3
Source File: DefaultMavenPublication.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
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);
            }
        }
    }
}
 
Example #4
Source File: DefaultMavenPublication.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
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);
            }
        }
    }
}
 
Example #5
Source File: DefaultIvyPublication.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
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);
            }
        }
    }
}
 
Example #6
Source File: DefaultIvyPublication.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
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);
            }
        }
    }
}
 
Example #7
Source File: DefaultIvyPublication.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
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);
            }
        }
    }
}
 
Example #8
Source File: DefaultIvyPublication.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
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);
            }
        }
    }
}