mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-21 16:04:09 -08:00
Fix release tasks
This commit is contained in:
parent
9036093da5
commit
350cff776e
|
@ -45,11 +45,16 @@ public abstract class PublishTeaVMPlugin implements Plugin<Project> {
|
||||||
target.getExtensions().add(PublishTeaVMExtension.class, EXTENSION_NAME, extension);
|
target.getExtensions().add(PublishTeaVMExtension.class, EXTENSION_NAME, extension);
|
||||||
|
|
||||||
target.afterEvaluate(p -> target.getExtensions().configure(PublishingExtension.class, publishing -> {
|
target.afterEvaluate(p -> target.getExtensions().configure(PublishingExtension.class, publishing -> {
|
||||||
publishing.publications(publications -> {
|
var pluginMavenPublication = publishing.getPublications().findByName("pluginMaven");
|
||||||
publications.create("java", MavenPublication.class, publication -> {
|
if (pluginMavenPublication == null) {
|
||||||
customizePublication(target, publication, extension);
|
publishing.publications(publications -> {
|
||||||
|
publications.create("java", MavenPublication.class, publication -> {
|
||||||
|
customizePublication(target, publication, extension, true);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
} else {
|
||||||
|
customizePublication(target, (MavenPublication) pluginMavenPublication, extension, false);
|
||||||
|
}
|
||||||
if (publish) {
|
if (publish) {
|
||||||
var signing = target.getExtensions().getByType(SigningExtension.class);
|
var signing = target.getExtensions().getByType(SigningExtension.class);
|
||||||
publishing.getPublications().configureEach(signing::sign);
|
publishing.getPublications().configureEach(signing::sign);
|
||||||
|
@ -90,12 +95,15 @@ public abstract class PublishTeaVMPlugin implements Plugin<Project> {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void customizePublication(Project project, MavenPublication publication, ExtensionImpl extension) {
|
private void customizePublication(Project project, MavenPublication publication, ExtensionImpl extension,
|
||||||
|
boolean includeComponent) {
|
||||||
publication.setGroupId("org.teavm");
|
publication.setGroupId("org.teavm");
|
||||||
if (extension.getArtifactId() != null) {
|
if (extension.getArtifactId() != null) {
|
||||||
publication.setArtifactId(extension.getArtifactId());
|
publication.setArtifactId(extension.getArtifactId());
|
||||||
}
|
}
|
||||||
publication.from(project.getComponents().getByName("java"));
|
if (includeComponent) {
|
||||||
|
publication.from(project.getComponents().getByName("java"));
|
||||||
|
}
|
||||||
if (extension.packaging != null) {
|
if (extension.packaging != null) {
|
||||||
publication.getPom().setPackaging(extension.packaging);
|
publication.getPom().setPackaging(extension.packaging);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user