diff --git a/src/main/java/rife/bld/BaseProject.java b/src/main/java/rife/bld/BaseProject.java index 4487b56..9f17e95 100644 --- a/src/main/java/rife/bld/BaseProject.java +++ b/src/main/java/rife/bld/BaseProject.java @@ -534,7 +534,22 @@ public class BaseProject extends BuildExecutor { @BuildCommand(help = DownloadHelp.class) public void download() throws Exception { - downloadOperation().executeOnce(() -> downloadOperation().fromProject(this)); + var auto = false; + var arguments = this.arguments(); + while (!arguments.isEmpty()) { + var argument = arguments.get(0); + if (DownloadOperation.AUTO_OPTION.equals(argument)) { + arguments.remove(0); + auto = true; + } else { + break; + } + } + if (auto) { + performAutoDownloadPurge(); + } else { + downloadOperation().executeOnce(() -> downloadOperation().fromProject(this)); + } } /** diff --git a/src/main/java/rife/bld/help/DownloadHelp.java b/src/main/java/rife/bld/help/DownloadHelp.java index 85726e5..b755a13 100644 --- a/src/main/java/rife/bld/help/DownloadHelp.java +++ b/src/main/java/rife/bld/help/DownloadHelp.java @@ -5,7 +5,7 @@ package rife.bld.help; import rife.bld.CommandHelp; -import rife.tools.StringUtils; +import rife.bld.operations.DownloadOperation; /** * Provides help for the download command. @@ -15,13 +15,13 @@ import rife.tools.StringUtils; */ public class DownloadHelp implements CommandHelp { public String getSummary() { - return "Downloads all dependencies of the project"; + return "Downloads all dependencies of the project (take option)"; } public String getDescription(String topic) { - return StringUtils.replace(""" - Downloads all dependencies of the project - - Usage : ${topic}""", "${topic}", topic); + return String.format(""" + Downloads all dependencies of the project + + Usage : %s [%s]""", topic, DownloadOperation.AUTO_OPTION); } -} +} \ No newline at end of file diff --git a/src/main/java/rife/bld/operations/DownloadOperation.java b/src/main/java/rife/bld/operations/DownloadOperation.java index be6d397..2dbb019 100644 --- a/src/main/java/rife/bld/operations/DownloadOperation.java +++ b/src/main/java/rife/bld/operations/DownloadOperation.java @@ -25,6 +25,7 @@ import static rife.bld.dependencies.Dependency.CLASSIFIER_SOURCES; * @since 1.5 */ public class DownloadOperation extends AbstractOperation { + public static final String AUTO_OPTION = "--auto"; private boolean offline_ = false; private HierarchicalProperties properties_ = null; private ArtifactRetriever retriever_ = null;