use of org.gradle.api.publish.internal.PublicationInternal in project gradle by gradle.
the class GenerateModuleMetadata method run.
@TaskAction
void run() {
File file = outputFile.get().getAsFile();
PublicationInternal publication = (PublicationInternal) this.publication.get();
List<PublicationInternal> publications = Cast.uncheckedCast(this.publications.get());
try {
Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), "utf8"));
try {
new ModuleMetadataFileGenerator(getBuildInvocationScopeId(), getProjectDependencyPublicationResolver()).generateTo(publication, publications, writer);
} finally {
writer.close();
}
} catch (IOException e) {
throw new UncheckedIOException("Could not generate metadata file " + outputFile.get(), e);
}
}
Aggregations