ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject [1/3] ant git commit: allow for java.nio.file.Path based target attributes
Date Fri, 28 Apr 2017 14:34:42 GMT
Repository: ant
Updated Branches:
  refs/heads/master cec95817b -> 2ec41afdc


allow for java.nio.file.Path based target attributes


Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/c5728b31
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/c5728b31
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/c5728b31

Branch: refs/heads/master
Commit: c5728b3120ddef34721677f2322b53a695a51451
Parents: cec9581
Author: Dave Brosius <dbrosius@mebigfatguy.com>
Authored: Tue Apr 25 21:06:07 2017 -0400
Committer: Stefan Bodewig <bodewig@apache.org>
Committed: Fri Apr 28 16:23:13 2017 +0200

----------------------------------------------------------------------
 src/main/org/apache/tools/ant/IntrospectionHelper.java | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant/blob/c5728b31/src/main/org/apache/tools/ant/IntrospectionHelper.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/IntrospectionHelper.java b/src/main/org/apache/tools/ant/IntrospectionHelper.java
index 5368042..c5fc9bf 100644
--- a/src/main/org/apache/tools/ant/IntrospectionHelper.java
+++ b/src/main/org/apache/tools/ant/IntrospectionHelper.java
@@ -1118,6 +1118,16 @@ public final class IntrospectionHelper {
                 }
             };
         }
+        // resolve relative nio paths through Project
+        if (java.nio.file.Path.class.equals(reflectedArg)) {
+            return new AttributeSetter(m, arg) {
+                @Override
+                public void set(final Project p, final Object parent, final String value)
throws InvocationTargetException, IllegalAccessException {
+                    m.invoke(parent, new Object[] { p.resolveFile(value).toPath() });
+                }
+            };
+        }
+        
         // resolve Resources/FileProviders as FileResources relative to Project:
         if (Resource.class.equals(reflectedArg) || FileProvider.class.equals(reflectedArg))
{
             return new AttributeSetter(m, arg) {


Mime
View raw message