From daf1c91d108e2a14bed6c6a845e19a9e2b4b0969 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Wed, 16 Feb 2005 12:44:57 +0000 Subject: [PATCH] Add some more common attributes git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277672 13f79535-47bb-0310-9956-ffa450edef68 --- proposal/sandbox/svn/docs/svn.html | 24 ++++ .../ant/taskdefs/svn/AbstractSvnTask.java | 105 ++++++++++++++++++ 2 files changed, 129 insertions(+) diff --git a/proposal/sandbox/svn/docs/svn.html b/proposal/sandbox/svn/docs/svn.html index 7dd456efa..73eefbbb7 100644 --- a/proposal/sandbox/svn/docs/svn.html +++ b/proposal/sandbox/svn/docs/svn.html @@ -60,6 +60,30 @@ from the command line in the target directory in which you are working. report only, don't change any files. No, default to "false" + + file + Uses the contents of the file passed as an + argument to this switch for the specified subcommand. + No. + + + force + Forces a particular command or operation to run. + No, defaults to false. + + + recursive + Makes a subcommand recurse into + subdirectories. Most subcommands recurse by default. + No. + + + targets + Tells Subversion to get the list of files that you wish to + operate on from the filename you provide instead of listing all + the files on the command line. + No. + output the file to direct standard output from the command. diff --git a/proposal/sandbox/svn/src/main/org/apache/tools/ant/taskdefs/svn/AbstractSvnTask.java b/proposal/sandbox/svn/src/main/org/apache/tools/ant/taskdefs/svn/AbstractSvnTask.java index d40976f02..0d77e8ada 100644 --- a/proposal/sandbox/svn/src/main/org/apache/tools/ant/taskdefs/svn/AbstractSvnTask.java +++ b/proposal/sandbox/svn/src/main/org/apache/tools/ant/taskdefs/svn/AbstractSvnTask.java @@ -103,6 +103,29 @@ public abstract class AbstractSvnTask extends Task { */ private boolean failOnError = false; + /** + * Uses the contents of the file passed as an argument to this + * switch for the specified subcommand. + */ + private File file; + + /** + * Forces a particular command or operation to run. + */ + private boolean force; + + /** + * Makes a subcommand recurse into subdirectories. + */ + private Boolean recursive = null; + + /** + * Tells Subversion to get the list of files that you wish to + * operate on from the filename you provide instead of listing all + * the files on the command line. + */ + private File targets; + /** * Create accessors for the following, to allow different handling of * the output. @@ -426,6 +449,70 @@ public abstract class AbstractSvnTask extends Task { } } + /** + * Uses the contents of the file passed as an argument to this + * switch for the specified subcommand. + */ + public void setFile(File file) { + this.file = file; + } + + /** + * Uses the contents of the file passed as an argument to this + * switch for the specified subcommand. + */ + public File getFile() { + return file; + } + + /** + * Forces a particular command or operation to run. + */ + public void setForce(boolean force) { + this.force = force; + } + + /** + * Forces a particular command or operation to run. + */ + public boolean getForce() { + return force; + } + + /** + * Makes a subcommand recurse into subdirectories. Most + * subcommands recurse by default. + */ + public void setRecursive(Boolean recursive) { + this.recursive = recursive; + } + + /** + * Makes a subcommand recurse into subdirectories. Most + * subcommands recurse by default. + */ + public Boolean getRecursive() { + return recursive; + } + + /** + * Tells Subversion to get the list of files that you wish to + * operate on from the filename you provide instead of listing all + * the files on the command line. + */ + public void setTargets(File targets) { + this.targets = targets; + } + + /** + * Tells Subversion to get the list of files that you wish to + * operate on from the filename you provide instead of listing all + * the files on the command line. + */ + public File getTargets() { + return targets; + } + /** * This needs to be public to allow configuration * of commands externally. @@ -554,6 +641,24 @@ public abstract class AbstractSvnTask extends Task { if (dryrun) { c.createArgument(true).setValue("--dry-run"); } + if (file != null) { + c.createArgument(true).setValue("--file"); + c.createArgument(true).setFile(file); + } + if (force) { + c.createArgument(true).setValue("--force"); + } + if (recursive != null) { + if (recursive.booleanValue()) { + c.createArgument(true).setValue("--recursive"); + } else { + c.createArgument(true).setValue("--non-recursive"); + } + } + if (targets != null) { + c.createArgument(true).setValue("--targets"); + c.createArgument(true).setFile(targets); + } } /**