Search in sources :

Example 1 with MavenPomInternal

use of org.gradle.api.publish.maven.internal.publication.MavenPomInternal in project gradle by gradle.

the class GenerateMavenPom method doGenerate.

@TaskAction
public void doGenerate() {
    MavenPomInternal pomInternal = (MavenPomInternal) getPom();
    MavenPomFileGenerator pomGenerator = new MavenPomFileGenerator(pomInternal.getProjectIdentity(), getVersionRangeMapper());
    pomGenerator.setPackaging(pomInternal.getPackaging());
    for (MavenDependencyInternal runtimeDependency : pomInternal.getApiDependencies()) {
        pomGenerator.addApiDependency(runtimeDependency);
    }
    for (MavenDependencyInternal runtimeDependency : pomInternal.getRuntimeDependencies()) {
        pomGenerator.addRuntimeDependency(runtimeDependency);
    }
    pomGenerator.withXml(pomInternal.getXmlAction());
    pomGenerator.writeTo(getDestination());
}
Also used : MavenPomInternal(org.gradle.api.publish.maven.internal.publication.MavenPomInternal) MavenPomFileGenerator(org.gradle.api.publish.maven.internal.tasks.MavenPomFileGenerator) MavenDependencyInternal(org.gradle.api.publish.maven.internal.dependencies.MavenDependencyInternal) TaskAction(org.gradle.api.tasks.TaskAction)

Aggregations

MavenDependencyInternal (org.gradle.api.publish.maven.internal.dependencies.MavenDependencyInternal)1 MavenPomInternal (org.gradle.api.publish.maven.internal.publication.MavenPomInternal)1 MavenPomFileGenerator (org.gradle.api.publish.maven.internal.tasks.MavenPomFileGenerator)1 TaskAction (org.gradle.api.tasks.TaskAction)1