Browse Source

add a new quiet attribute to <get>, GitHub PR by hydra1983, closes #1

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1580482 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 11 years ago
parent
commit
444a953257
3 changed files with 27 additions and 0 deletions
  1. +4
    -0
      WHATSNEW
  2. +5
    -0
      manual/Tasks/get.html
  3. +18
    -0
      src/main/org/apache/tools/ant/taskdefs/Get.java

+ 4
- 0
WHATSNEW View File

@@ -140,6 +140,10 @@ Other changes:
have different base directories. have different base directories.
Bugzilla Report 48621 Bugzilla Report 48621


* <get> has a quiet attribute that makes the task log errors only
when enabled.
GitHub Pull Request #1

Changes from Ant 1.9.2 TO Ant 1.9.3 Changes from Ant 1.9.2 TO Ant 1.9.3
=================================== ===================================




+ 5
- 0
manual/Tasks/get.html View File

@@ -71,6 +71,11 @@ plain text' authentication is used. This is only secure over an HTTPS link.
<td valign="top">show verbose progress information (&quot;on&quot;/&quot;off&quot;).</td> <td valign="top">show verbose progress information (&quot;on&quot;/&quot;off&quot;).</td>
<td align="center" valign="top">No; default "false"</td> <td align="center" valign="top">No; default "false"</td>
</tr> </tr>
<tr>
<td valign="top">quiet</td>
<td valign="top">Log errors only.(&quot;true&quot;/&quot;false&quot;).</td>
<td align="center" valign="top">No; default "false"</td>
</tr>
<tr> <tr>
<td valign="top">ignoreerrors</td> <td valign="top">ignoreerrors</td>
<td valign="top">Log errors but don't treat as fatal.</td> <td valign="top">Log errors but don't treat as fatal.</td>


+ 18
- 0
src/main/org/apache/tools/ant/taskdefs/Get.java View File

@@ -74,6 +74,7 @@ public class Get extends Task {
private Resources sources = new Resources(); private Resources sources = new Resources();
private File destination; // required private File destination; // required
private boolean verbose = false; private boolean verbose = false;
private boolean quiet = false;
private boolean useTimestamp = false; //off by default private boolean useTimestamp = false; //off by default
private boolean ignoreErrors = false; private boolean ignoreErrors = false;
private String uname = null; private String uname = null;
@@ -253,6 +254,13 @@ public class Get extends Task {
return getThread.wasSuccessful(); return getThread.wasSuccessful();
} }


@Override
public void log(String msg, int msgLevel) {
if (!quiet || msgLevel >= Project.MSG_ERR) {
super.log(msg, msgLevel);
}
}

/** /**
* Check the attributes. * Check the attributes.
*/ */
@@ -331,6 +339,16 @@ public class Get extends Task {
verbose = v; verbose = v;
} }


/**
* If true, set default log level to Project.MSG_ERR.
*
* @param v if "true" then be quiet
* @since Ant 1.9.4
*/
public void setQuiet(boolean v){
this.quiet = v;
}

/** /**
* If true, log errors but do not treat as fatal. * If true, log errors but do not treat as fatal.
* *


Loading…
Cancel
Save