use of org.shipkit.gradle.configuration.AndroidPublishConfiguration in project shipkit by mockito.
the class AndroidPublishPlugin method apply.
public void apply(final Project project) {
final AndroidPublishConfiguration androidPublishConfiguration = project.getExtensions().create(ANDROID_PUBLISH_EXTENSION, AndroidPublishConfiguration.class);
final ShipkitConfiguration conf = project.getPlugins().apply(ShipkitConfigurationPlugin.class).getConfiguration();
project.getPlugins().apply(LocalSnapshotPlugin.class);
Task snapshotTask = project.getTasks().getByName(LocalSnapshotPlugin.SNAPSHOT_TASK);
snapshotTask.dependsOn(MAVEN_LOCAL_TASK);
project.getPlugins().apply("maven-publish");
BintrayExtension bintray = project.getExtensions().getByType(BintrayExtension.class);
bintray.setPublications(PUBLICATION_NAME);
project.getPlugins().withId("com.android.library", plugin -> {
deferredConfiguration(project, () -> {
GradleDSLHelper.publications(project, publications -> {
MavenPublication p = publications.create(PUBLICATION_NAME, MavenPublication.class, publication -> {
publication.setArtifactId(androidPublishConfiguration.getArtifactId());
SoftwareComponent releaseComponent = project.getComponents().findByName("release");
if (releaseComponent == null) {
throw new GradleException("'release' component not found in project. " + "Make sure you are using Android Gradle Plugin 3.6.0-beta05 or newer.");
}
publication.from(releaseComponent);
PomCustomizer.customizePom(project, conf, publication);
});
LOG.info("{} - configured '{}' publication", project.getPath(), p.getArtifactId());
});
});
// so that we flesh out problems with maven publication during the build process
project.getTasks().getByName("build").dependsOn(MAVEN_LOCAL_TASK);
});
}
Aggregations