AQFileSet should not be designed after ANT file set.
Instead, it should be a container of files. The user should be able to add files incrementally, using different criteria. ANT file set was designed specifically for XML build script, not for aquascript.
We can't use existing implementation in AQVersionControl.
Please re-design.
Andy, can we discuss this before I close it?
Niels,
I want you to write me an example script that does aqua.filesystem.chgrp() on three types of files, let's say all files within a single directory that fit the following wildcards: *.doc, *.txt, and CVS/Entries.
Then we could discuss improper design of AQFileSet.
The call in question is public void chgrp(String group, AQFileSet[] fileSets).
We should re-resign CoreFileSet to be a simple collection of files (avoiding duplicates) with a wide array of collectXXX() methods which would allow the user to build a file set in multiple stages.
Niels,
I want you to write me an example script that does aqua.filesystem.chgrp() on three types of files, let's say all files within a single directory that fit the following wildcards: *.doc, *.txt, and CVS/Entries.
Then we could discuss improper design of AQFileSet.
The call in question is public void chgrp(String group, AQFileSet[] fileSets).
We should re-resign CoreFileSet to be a simple collection of files (avoiding duplicates) with a wide array of collectXXX() methods which would allow the user to build a file set in multiple stages.
Allan, can you write the example in Andy's comments?
Allan, can you write the example in Andy's comments?
this example will recurse
var fileSet = aqua.filesystem.newFileSet();
fileSet.setBaseDir("/tmp/svn/ibatis/");
fileSet.setIncludes("**/*.doc");
fileSet.setIncludes("**/*.txt");
fileSet.setIncludes("**/cvs/entries");
var files = aqua.filesystem.scan(fileSet);
// see the files
for (var i=0; i<files.length; i++){
aqua.console.println(files[i]);
}
// change the files
aqua.filesystem.chgrp("andy", fileSet);
this example will not recurse
var fileSet = aqua.filesystem.newFileSet();
fileSet.setBaseDir("/tmp/svn/ibatis/trunk/doc/en/");
fileSet.setIncludes("*.doc");
fileSet.setIncludes("*.txt");
fileSet.setIncludes("cvs/entries");
var files = aqua.filesystem.scan(fileSet);
// see the files
for (var i=0; i<files.length; i++){
aqua.console.println(files[i]);
}
// change the files
aqua.filesystem.chgrp("andy", fileSet);
this example will recurse
var fileSet = aqua.filesystem.newFileSet();
fileSet.setBaseDir("/tmp/svn/ibatis/");
fileSet.setIncludes("**/*.doc");
fileSet.setIncludes("**/*.txt");
fileSet.setIncludes("**/cvs/entries");
var files = aqua.filesystem.scan(fileSet);
// see the files
for (var i=0; i<files.length; i++){
aqua.console.println(files[i]);
}
// change the files
aqua.filesystem.chgrp("andy", fileSet);
this example will not recurse
var fileSet = aqua.filesystem.newFileSet();
fileSet.setBaseDir("/tmp/svn/ibatis/trunk/doc/en/");
fileSet.setIncludes("*.doc");
fileSet.setIncludes("*.txt");
fileSet.setIncludes("cvs/entries");
var files = aqua.filesystem.scan(fileSet);
// see the files
for (var i=0; i<files.length; i++){
aqua.console.println(files[i]);
}
// change the files
aqua.filesystem.chgrp("andy", fileSet);
How about collecting files from three different directories? Can we do that?
How about collecting files from three different directories? Can we do that?
like this?
var a = aqua.filesystem.newFileSet();
a.setBaseDir("/tmp/directory-one/");
a.setIncludes("*.txt");
a.setIncludes("cvs/entries");
var b = aqua.filesystem.newFileSet();
b.setBaseDir("/tmp/directory-two/");
b.setIncludes("*.doc");
b.setIncludes("cvs/entries");
var c = aqua.filesystem.newFileSet();
c.setBaseDir("/tmp/directory-three/");
c.setIncludes("*.pdf");
c.setIncludes("cvs/entries");
var fileSets = new Array(a, b, c);
// change the files
aqua.filesystem.chgrp("andy", fileSets);
like this?
var a = aqua.filesystem.newFileSet();
a.setBaseDir("/tmp/directory-one/");
a.setIncludes("*.txt");
a.setIncludes("cvs/entries");
var b = aqua.filesystem.newFileSet();
b.setBaseDir("/tmp/directory-two/");
b.setIncludes("*.doc");
b.setIncludes("cvs/entries");
var c = aqua.filesystem.newFileSet();
c.setBaseDir("/tmp/directory-three/");
c.setIncludes("*.pdf");
c.setIncludes("cvs/entries");
var fileSets = new Array(a, b, c);
// change the files
aqua.filesystem.chgrp("andy", fileSets);
it boggles the mind...
why don't we make it more complicated?
it boggles the mind...
why don't we make it more complicated?
Issue #3894 |
Closed |
Invalid |
Resolved |
Completion |
No due date |
No fixed build |
No time estimate |
Andy, can we discuss this before I close it?