Hi Ivy,
Thanks for providing this great API, and more particularly the
IvyBuildList Ant task that I extend to generate my Hudson
configuration files automatically for continuous build of my
project.
I only had to slightly modify it to be able to get the list of
sorted modules, and the list of build files. See the attached
patch.
NOTE: this patch is based on Ivy 1.4.1, but it should be possible
to do the same thing on trunk (the patch does not apply on trunk).
If this change makes sense to you, I can file a JIRA issue.
WDYT?
--
Jean-Baptiste Quenot
aka John Banana Qwerty
http://caraldi.com/jbq/
@@ -47,6 +42,8 @@
private boolean _excludeRoot = false;
private String _leaf = "*";
private boolean _excludeLeaf = false;
+ private List sortedModules;
+ private Map buildFiles;
public void addFileset(FileSet buildFiles) {
@@ -106,7 +103,7 @@
Path path = new Path(getProject());
- Map buildFiles = new HashMap(); // Map (ModuleDescriptor -> File
buildFile)
+ buildFiles = new HashMap(); // Map (ModuleDescriptor -> File buildFile)
Collection mds = new ArrayList();
List independent = new ArrayList();
ModuleDescriptor rootModuleDescriptor = null;
@@ -168,7 +165,7 @@
mds = filterModulesFromLeaf(mds, leafModuleDescriptor);
}
- List sortedModules = ivy.sortModuleDescriptors(mds);
+ sortedModules = ivy.sortModuleDescriptors(mds);
for (ListIterator iter = independent.listIterator(); iter.hasNext();) {
File buildFile = (File)iter.next();
@@ -349,6 +346,22 @@
public void setReverse(boolean reverse) {
_reverse = reverse;
+ }
+
+ /**
+ * Get access to all module descriptors (of type [EMAIL PROTECTED]
ModuleDescriptor}) parsed during [EMAIL PROTECTED] #execute()}
+ * @return
+ */
+ public List<ModuleDescriptor> getSortedModules() {
+ return sortedModules;
+ }
+
+ /**
+ * Get access to all build files encountered during [EMAIL PROTECTED]
#execute()} as a Map. The keys of the Map are of type [EMAIL PROTECTED]
ModuleDescriptor}, see [EMAIL PROTECTED] #getSortedModules()} to get access to
the module descriptors.
+ * @return
+ */
+ public Map getBuildFiles() {
+ return buildFiles;
}
}