Added useful logging.
Makes the build easier to understand.
@@ -4,6 +4,8 @@ import org.gradle.api.Action;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.Task;
+import org.gradle.api.logging.Logger;
+import org.gradle.api.logging.Logging;
import org.shipkit.gradle.exec.ShipkitExecTask;
import org.shipkit.internal.gradle.ReleaseNotesPlugin;
import org.shipkit.internal.gradle.VersioningPlugin;
@@ -35,6 +37,8 @@ import static org.shipkit.internal.gradle.release.ReleaseNeededPlugin.RELEASE_NE
*/
public class ReleasePlugin implements Plugin<Project> {
+ private final static Logger LOG = Logging.getLogger(ReleasePlugin.class);
+
public static final String PERFORM_RELEASE_TASK = "performRelease";
public static final String TEST_RELEASE_TASK = "testRelease";
public static final String RELEASE_CLEAN_UP_TASK = "releaseCleanUp";
@@ -56,12 +60,18 @@ public class ReleasePlugin implements Plugin<Project> {
});
TaskMaker.task(project, TEST_RELEASE_TASK, ShipkitExecTask.class, new Action<ShipkitExecTask>() {
- public void execute(ShipkitExecTask task) {
- task.setDescription("Tests the release procedure and cleans up. Safe to be invoked multiple times.");
+ public void execute(ShipkitExecTask t) {
+ t.setDescription("Tests the release procedure and cleans up. Safe to be invoked multiple times.");
//releaseCleanUp is already set up to run all his "subtasks" after performRelease is performed
//releaseNeeded is used here only to execute the code paths in the release needed task (extra testing)
- task.getExecCommands().add(execCommand("Performing relase in dry run, with cleanup"
+ t.getExecCommands().add(execCommand("Performing relase in dry run, with cleanup"
, asList("./gradlew", RELEASE_NEEDED, PERFORM_RELEASE_TASK, RELEASE_CLEAN_UP_TASK, "-PdryRun")));
+ t.doLast(new Action<Task>() {
+ @Override
+ public void execute(Task task) {
+ LOG.lifecycle(" The release test was successful. Ship it!");
+ }
+ });
}
});
