You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by ma...@apache.org on 2012/12/10 22:40:15 UTC
svn commit: r1419802 - in /ant/ivy/core/trunk: CHANGES.txt
doc/settings/include.html
src/java/org/apache/ivy/core/settings/XmlSettingsParser.java
Author: maartenc
Date: Mon Dec 10 21:40:13 2012
New Revision: 1419802
URL: http://svn.apache.org/viewvc?rev=1419802&view=rev
Log:
IMPROVEMENT: Optional <include> ivysettings directives (IVY-1392) (thanks to Yanus Poluektovich)
Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/doc/settings/include.html
ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java
Modified: ant/ivy/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=1419802&r1=1419801&r2=1419802&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Mon Dec 10 21:40:13 2012
@@ -96,6 +96,7 @@ for detailed view of each issue, please
Douglas Palmer
Jesper Pedersen
Emmanuel Pellereau
+ Yanus Poluektovich
Roshan Punnoose
Jean-Baptiste Quenot
Carl Quinn
@@ -136,6 +137,7 @@ for detailed view of each issue, please
- NEW: Exposing some parent metadata (organisation, module, revision, branch) as properties (IVY-1288)
- NEW: symlinkmass feature based on symlink feature of ivy:retrieve (IVY-1252) (Thanks to Gene Smith)
+- IMPROVEMENT: Optional <include> ivysettings directives (IVY-1392) (thanks to Yanus Poluektovich)
- IMPROVEMENT: add support for source bundles from p2 repositories
- IMPROVEMENT: add support for source URI from OBR repositories
Modified: ant/ivy/core/trunk/doc/settings/include.html
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/settings/include.html?rev=1419802&r1=1419801&r2=1419802&view=diff
==============================================================================
--- ant/ivy/core/trunk/doc/settings/include.html (original)
+++ ant/ivy/core/trunk/doc/settings/include.html Mon Dec 10 21:40:13 2012
@@ -40,6 +40,8 @@ The included ivysettings file has to be
<td>Yes, unless file is specified</td></tr>
<tr><td>file</td><td>a path to the ivysettings file to include</td>
<td>Yes, unless url is specified</td></tr>
+ <tr><td>optional</td><td>indicates whether Ivy should throw an error if the specified file doesn't exist. <span class="since">(Since 2.4)</span>.</td>
+ <td>No, default to false</td></tr>
</tbody>
</table>
<h1>Examples</h1>
Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java?rev=1419802&r1=1419801&r2=1419802&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java Mon Dec 10 21:40:13 2012
@@ -419,6 +419,11 @@ public class XmlSettingsParser extends D
if ("file".equals(settingsURL.getProtocol())) {
try {
File settingsFile = new File(new URI(settingsURL.toExternalForm()));
+ String optional = (String) attributes.get("optional");
+ if ("true".equals(optional) && !settingsFile.exists()) {
+ return;
+ }
+
ivy.setSettingsVariables(
Checks.checkAbsolute(settingsFile,
"settings include path"));