From 974835b10b4137384cac1b923ff875f74280e0ed Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Tue, 9 May 2017 08:04:03 +0200 Subject: [PATCH] #51 - Add command to trigger distribution build for train iteration. --- .../data/release/build/BuildCommands.java | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/springframework/data/release/build/BuildCommands.java b/src/main/java/org/springframework/data/release/build/BuildCommands.java index 0dc1b24..beaac45 100644 --- a/src/main/java/org/springframework/data/release/build/BuildCommands.java +++ b/src/main/java/org/springframework/data/release/build/BuildCommands.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 the original author or authors. + * Copyright 2016-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,6 +37,7 @@ import org.springframework.util.Assert; /** * @author Oliver Gierke + * @author Mark Paluch */ @CliComponent @RequiredArgsConstructor @@ -50,7 +51,7 @@ class BuildCommands extends TimedCommand { /** * Removes all Spring Data artifacts from the local repository. - * + * * @throws IOException */ @CliCommand("build purge artifacts") @@ -65,7 +66,7 @@ class BuildCommands extends TimedCommand { /** * Triggers a build for all modules of the given {@link TrainIteration}. - * + * * @param iteration must not be {@literal null}. * @param projectKey can be {@literal null} or empty. */ @@ -80,7 +81,19 @@ class BuildCommands extends TimedCommand { if (!project.isPresent()) { git.prepare(iteration); - iteration.forEach(module -> build.triggerBuild(module)); + iteration.forEach(build::triggerBuild); } } + + /** + * @param iteration must not be {@literal null}. + */ + @CliCommand("build distribute") + public void buildDistribute(@CliOption(key = "", mandatory = true) TrainIteration iteration) { + + Assert.notNull(iteration, "Train iteration must not be null!"); + + git.prepare(iteration); + build.distributeResources(iteration); + } }