static boolean configureTask(Task snapshotTask, List<String> taskNames) { boolean isSnapshot = taskNames.contains(SNAPSHOT_TASK); if (isSnapshot) { snapshotTask.getProject().getTasks().matching(withName("javadoc", "groovydoc")).all(doc -> { LOG.info("{} - disabled to speed up the 'snapshot' build", snapshotTask.getPath()); doc.setEnabled(false); }); } return isSnapshot; }
static boolean configureTask(Task snapshotTask, List<String> taskNames) { boolean isSnapshot = taskNames.contains(SNAPSHOT_TASK); if (isSnapshot) { snapshotTask.getProject().getTasks().matching(withName("javadoc", "groovydoc")).all(doc -> { LOG.info("{} - disabled to speed up the 'snapshot' build", snapshotTask.getPath()); doc.setEnabled(false); }); } return isSnapshot; }
@Override public void apply(final Project project) { project.getPlugins().apply(GitHubContributorsPlugin.class); final Task fetcher = project.getTasks().getByName(GitHubContributorsPlugin.FETCH_CONTRIBUTORS); project.allprojects(subproject -> subproject.getPlugins().withType(JavaBintrayPlugin.class, plugin -> { //Because maven-publish plugin uses new configuration model, we cannot get the task directly //So we use 'matching' technique. subproject.getTasks().matching(withName(POM_TASK)).all(t -> t.mustRunAfter(fetcher)); //Pom task needs data from fetcher hence 'mustRunAfter' above. //We don't use 'dependsOn' because we want the fetcher to be included only when we are publishing to Bintray Task upload = subproject.getTasks().getByName(ShipkitBintrayPlugin.BINTRAY_UPLOAD_TASK); upload.dependsOn(fetcher); })); } }
@Override public void apply(final Project project) { project.getPlugins().apply(GitHubContributorsPlugin.class); final Task fetcher = project.getTasks().getByName(GitHubContributorsPlugin.FETCH_CONTRIBUTORS); project.allprojects(subproject -> subproject.getPlugins().withType(JavaBintrayPlugin.class, plugin -> { //Because maven-publish plugin uses new configuration model, we cannot get the task directly //So we use 'matching' technique. subproject.getTasks().matching(withName(POM_TASK)).all(t -> t.mustRunAfter(fetcher)); //Pom task needs data from fetcher hence 'mustRunAfter' above. //We don't use 'dependsOn' because we want the fetcher to be included only when we are publishing to Bintray Task upload = subproject.getTasks().getByName(ShipkitBintrayPlugin.BINTRAY_UPLOAD_TASK); upload.dependsOn(fetcher); })); } }