[GitHub] ant pull request #:
Github user bodewig commented on the pull request: https://github.com/apache/ant/commit/1c80d507f496dde98869890e671edf635bef8dec#commitcomment-28426956 In src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java: In src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java on line 1818: similar case to [above](https://github.com/apache/ant/commit/1c80d507f496dde98869890e671edf635bef8dec#r28426843), although in the case of FTP large lists are probably less likely than in `sync`. --- - To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org For additional commands, e-mail: dev-h...@ant.apache.org
[GitHub] ant pull request #:
Github user bodewig commented on the pull request: https://github.com/apache/ant/commit/1c80d507f496dde98869890e671edf635bef8dec#commitcomment-28426843 In src/main/org/apache/tools/ant/taskdefs/Sync.java: In src/main/org/apache/tools/ant/taskdefs/Sync.java on line 242: I think here and in the next hunk the classical loop was easier to read (in particular given the comment above the loop :-) than the foreach version - and the `Arrays.sort` may become expensive when the arrays are big. --- - To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org For additional commands, e-mail: dev-h...@ant.apache.org
[GitHub] ant-ivy issue #71: Ivy main/standalone: Patch to include 'makepom' function
Github user jaikiran commented on the issue: https://github.com/apache/ant-ivy/pull/71 @aanno, thank you for this PR. I have gone ahead and included your patch with minor modifications to upstream and also included a test along with it. I have also included your name in our release notes. Since I couldn't find your full name in your github profile, I used `aanno`, if you prefer to have your full name included in the release notes, please let me know and I'll update it accordingly. --- - To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org For additional commands, e-mail: dev-h...@ant.apache.org
Re: File type mapping in external task
Thank you Stefan ! I was a bit afraid of duplicating the logic for String to File mapping, but if it's just about using Project#resolveFile then I'll do it. Gilles On Wed, Apr 4, 2018 at 1:40 PM, Stefan Bodewigwrote: > On 2018-04-03, Gilles Querret wrote: > > > If I have an attribute mapped to a File type (such as setSrcDir(File > file) > > { this.srcDir = file; } ), then passing an empty string (as in > srcDir="" ) leads to srcDir set to baseDir (or current directory, not > sure). > > baseDir :-) > > > Is there a way to trap the empty string in the setter ? Or is it required > > to change the setter to accept a String parameter, and create the File > > object from the string ? > > You will need the String-arg setter for that. The File (or Path) -arg > versions simply go through Project#resolveFile. > > If you are using typed attribute setters you are all in on Ant's > behavior without any chance to tweak it. > > An alternative may be a type of your own with a Project and String-arg > constructor, something like > > public class MyFileWrapper { > private final File file; > > public MyFileWrapper(Project p, String fileName) { > if ("".equals(fileName)) { > throw new BuildException("file name must not be empty"); > } > this.file = p.resolveFile(fileName); > } > > public File getFile() { > return file; > } > } > > public void setSrcDir(MyFileWrapper w) { > this.srcDir = w.getFile(); > } > > which may be slightly better. > > Stefan > > - > To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org > For additional commands, e-mail: dev-h...@ant.apache.org > > -- Gilles QUERRET Riverside Software 15d route de Bellevue • 69440 Mornant • France Mob : +33 662.525.532
JunitTestRunner commit
Hi, Since this is more or less my first commit to the Ant codebase, could someone please review my change to JunitTestRunner ?And if all is ok, what is the correct way to merge this into the 1.9.x branch? Maarten
Re: File type mapping in external task
On 2018-04-03, Gilles Querret wrote: > If I have an attribute mapped to a File type (such as setSrcDir(File file) > { this.srcDir = file; } ), then passing an empty string (as in srcDir="" ) leads to srcDir set to baseDir (or current directory, not sure). baseDir :-) > Is there a way to trap the empty string in the setter ? Or is it required > to change the setter to accept a String parameter, and create the File > object from the string ? You will need the String-arg setter for that. The File (or Path) -arg versions simply go through Project#resolveFile. If you are using typed attribute setters you are all in on Ant's behavior without any chance to tweak it. An alternative may be a type of your own with a Project and String-arg constructor, something like public class MyFileWrapper { private final File file; public MyFileWrapper(Project p, String fileName) { if ("".equals(fileName)) { throw new BuildException("file name must not be empty"); } this.file = p.resolveFile(fileName); } public File getFile() { return file; } } public void setSrcDir(MyFileWrapper w) { this.srcDir = w.getFile(); } which may be slightly better. Stefan - To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org For additional commands, e-mail: dev-h...@ant.apache.org