public void execute(XmlProvider xml) { String archivesBaseName = (String) project.getProperties().get("archivesBaseName"); File contributorsFile = contributorsFile(project); LOG.info(" Read project contributors from file: " + contributorsFile.getAbsolutePath()); // It can happens that contributorsFile doesn't exist e.g. when shipkit.team.contributors is NOT empty ProjectContributorsSet contributorsFromGitHub = new ProjectContributorsSerializer() .deserialize(IOUtil.readFullyOrDefault(contributorsFile, "[]")); LOG.info(" Customizing pom for publication " + publication.getName() + " in " + project.toString() + "\n - Module name (project.archivesBaseName): " + archivesBaseName + "\n - Description (project.description): " + project.getDescription() + "\n - GitHub repository (project.rootProject.shipkit.gitHub.repository): " + conf.getGitHub().getRepository() + "\n - Developers (project.rootProject.shipkit.team.developers): " + StringUtil.join(conf.getTeam().getDevelopers(), ", ") + "\n - Contributors (project.rootProject.shipkit.team.contributors): " + StringUtil.join(conf.getTeam().getContributors(), ", ") + "\n - Contributors read from GitHub: " + StringUtil.join(contributorsFromGitHub.toConfigNotation(), ", ")); customizePom(xml.asNode(), conf, archivesBaseName, project.getDescription(), contributorsFromGitHub); } });
public void execute(XmlProvider xml) { String archivesBaseName = (String) project.getProperties().get("archivesBaseName"); File contributorsFile = contributorsFile(project); LOG.info(" Read project contributors from file: " + contributorsFile.getAbsolutePath()); // It can happens that contributorsFile doesn't exist e.g. when shipkit.team.contributors is NOT empty ProjectContributorsSet contributorsFromGitHub = new AllContributorsSerializer() .deserialize(IOUtil.readFullyOrDefault(contributorsFile, "[]")); LOG.info(" Customizing pom for publication " + publication.getName() + " in " + project.toString() + "\n - Module name (project.archivesBaseName): " + archivesBaseName + "\n - Description (project.description): " + project.getDescription() + "\n - GitHub repository (project.rootProject.shipkit.gitHub.repository): " + conf.getGitHub().getRepository() + "\n - Developers (project.rootProject.shipkit.team.developers): " + StringUtil.join(conf.getTeam().getDevelopers(), ", ") + "\n - Contributors (project.rootProject.shipkit.team.contributors): " + StringUtil.join(conf.getTeam().getContributors(), ", ") + "\n - Contributors read from GitHub: " + StringUtil.join(contributorsFromGitHub.toConfigNotation(), ", ")); customizePom(xml.asNode(), conf, archivesBaseName, project.getDescription(), contributorsFromGitHub); } });
public void execute(XmlProvider xml) { String archivesBaseName = (String) project.getProperties().get("archivesBaseName"); File contributorsFile = contributorsFile(project); LOG.info(" Read project contributors from file: " + contributorsFile.getAbsolutePath()); // It can happens that contributorsFile doesn't exist e.g. when shipkit.team.contributors is NOT empty ProjectContributorsSet contributorsFromGitHub = new ProjectContributorsSerializer() .deserialize(IOUtil.readFullyOrDefault(contributorsFile, "[]")); LOG.info(" Customizing pom for publication " + publication.getName() + " in " + project.toString() + "\n - Module name (project.archivesBaseName): " + archivesBaseName + "\n - Description (project.description): " + project.getDescription() + "\n - GitHub repository (project.rootProject.shipkit.gitHub.repository): " + conf.getGitHub().getRepository() + "\n - Developers (project.rootProject.shipkit.team.developers): " + StringUtil.join(conf.getTeam().getDevelopers(), ", ") + "\n - Contributors (project.rootProject.shipkit.team.contributors): " + StringUtil.join(conf.getTeam().getContributors(), ", ") + "\n - Contributors read from GitHub: " + StringUtil.join(contributorsFromGitHub.toConfigNotation(), ", ")); customizePom(xml.asNode(), conf, archivesBaseName, project.getDescription(), contributorsFromGitHub); } });
public void apply(final Project project) { 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(JavaLibraryPlugin.class); project.getPlugins().apply("maven-publish"); final Jar sourcesJar = (Jar) project.getTasks().getByName(JavaLibraryPlugin.SOURCES_JAR_TASK); final Jar javadocJar = (Jar) project.getTasks().getByName(JavaLibraryPlugin.JAVADOC_JAR_TASK); GradleDSLHelper.publications(project, publications -> { MavenPublication p = publications.create(PUBLICATION_NAME, MavenPublication.class, publication -> { publication.from(project.getComponents().getByName("java")); publication.artifact(sourcesJar); publication.artifact(javadocJar); DeferredConfiguration.deferredConfiguration(project, () -> { publication.setArtifactId(((Jar) project.getTasks().getByName("jar")).getBaseName()); }); 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); } }
public void apply(final Project project) { 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(JavaLibraryPlugin.class); project.getPlugins().apply("maven-publish"); final Jar sourcesJar = (Jar) project.getTasks().getByName(JavaLibraryPlugin.SOURCES_JAR_TASK); final Jar javadocJar = (Jar) project.getTasks().getByName(JavaLibraryPlugin.JAVADOC_JAR_TASK); GradleDSLHelper.publications(project, publications -> { MavenPublication p = publications.create(PUBLICATION_NAME, MavenPublication.class, publication -> { publication.from(project.getComponents().getByName("java")); publication.artifact(sourcesJar); publication.artifact(javadocJar); DeferredConfiguration.deferredConfiguration(project, () -> { publication.setArtifactId(((Jar) project.getTasks().getByName("jar")).getBaseName()); }); 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); } }