Search in sources :

Example 1 with IvyModuleDescriptorSpecInternal

use of org.gradle.api.publish.ivy.internal.publication.IvyModuleDescriptorSpecInternal in project gradle by gradle.

the class GenerateIvyDescriptor method doGenerate.

@TaskAction
public void doGenerate() {
    IvyModuleDescriptorSpecInternal descriptorInternal = toIvyModuleDescriptorInternal(getDescriptor());
    IvyDescriptorFileGenerator ivyGenerator = new IvyDescriptorFileGenerator(descriptorInternal.getProjectIdentity());
    ivyGenerator.setStatus(descriptorInternal.getStatus());
    ivyGenerator.setBranch(descriptorInternal.getBranch());
    ivyGenerator.setExtraInfo(descriptorInternal.getExtraInfo().asMap());
    for (IvyConfiguration ivyConfiguration : descriptorInternal.getConfigurations()) {
        ivyGenerator.addConfiguration(ivyConfiguration);
    }
    for (IvyArtifact ivyArtifact : descriptorInternal.getArtifacts()) {
        ivyGenerator.addArtifact(ivyArtifact);
    }
    for (IvyDependencyInternal ivyDependency : descriptorInternal.getDependencies()) {
        ivyGenerator.addDependency(ivyDependency);
    }
    ivyGenerator.withXml(descriptorInternal.getXmlAction()).writeTo(getDestination());
}
Also used : IvyDescriptorFileGenerator(org.gradle.api.publish.ivy.internal.publisher.IvyDescriptorFileGenerator) IvyDependencyInternal(org.gradle.api.publish.ivy.internal.dependency.IvyDependencyInternal) IvyModuleDescriptorSpecInternal(org.gradle.api.publish.ivy.internal.publication.IvyModuleDescriptorSpecInternal) IvyConfiguration(org.gradle.api.publish.ivy.IvyConfiguration) IvyArtifact(org.gradle.api.publish.ivy.IvyArtifact) TaskAction(org.gradle.api.tasks.TaskAction)

Aggregations

IvyArtifact (org.gradle.api.publish.ivy.IvyArtifact)1 IvyConfiguration (org.gradle.api.publish.ivy.IvyConfiguration)1 IvyDependencyInternal (org.gradle.api.publish.ivy.internal.dependency.IvyDependencyInternal)1 IvyModuleDescriptorSpecInternal (org.gradle.api.publish.ivy.internal.publication.IvyModuleDescriptorSpecInternal)1 IvyDescriptorFileGenerator (org.gradle.api.publish.ivy.internal.publisher.IvyDescriptorFileGenerator)1 TaskAction (org.gradle.api.tasks.TaskAction)1