Browse Source

Add some more common attributes

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277672 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 20 years ago
parent
commit
daf1c91d10
2 changed files with 129 additions and 0 deletions
  1. +24
    -0
      proposal/sandbox/svn/docs/svn.html
  2. +105
    -0
      proposal/sandbox/svn/src/main/org/apache/tools/ant/taskdefs/svn/AbstractSvnTask.java

+ 24
- 0
proposal/sandbox/svn/docs/svn.html View File

@@ -60,6 +60,30 @@ from the command line in the target directory in which you are working.
<td valign="top">report only, don't change any files.</td>
<td align="center" valign="top">No, default to &quot;false&quot;</td>
</tr>
<tr>
<td valign="top">file</td>
<td valign="top">Uses the contents of the file passed as an
argument to this switch for the specified subcommand.</td>
<td align="center" valign="top">No.</td>
</tr>
<tr>
<td valign="top">force</td>
<td valign="top">Forces a particular command or operation to run.</td>
<td align="center" valign="top">No, defaults to false.</td>
</tr>
<tr>
<td valign="top">recursive</td>
<td valign="top">Makes a subcommand recurse into
subdirectories. Most subcommands recurse by default.</td>
<td align="center" valign="top">No.</td>
</tr>
<tr>
<td valign="top">targets</td>
<td valign="top">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.</td>
<td align="center" valign="top">No.</td>
</tr>
<tr>
<td valign="top">output</td>
<td valign="top">the file to direct standard output from the command.</td>


+ 105
- 0
proposal/sandbox/svn/src/main/org/apache/tools/ant/taskdefs/svn/AbstractSvnTask.java View File

@@ -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);
}
}

/**


Loading…
Cancel
Save