Ant Target Dependency Dependency Viewer

Is there a piece of software (or an eclipse plugin) that,

for a given purpose, will allow me to view the target dependency like a tree?

The tree does not have to be graphic, it can be textual - just a tool that will help me get through someone’s grid from ant files to debug them.

No need to be an Eclipse plugin. However, it would be nice if you click on node, this will lead to the fact that the source of this goal will be transferred to the editor.

+8
java eclipse eclipse-plugin ant
source share
2 answers

Similar to the issue of ant debugging in Eclipse .

Based on the Apache ANT manual, you can start with the -projecthelp option. After that, it can be more difficult, because different goals can have mutual dependencies and, therefore, it is impossible to imagine the hierarchy as a tree in general.

You can modify the build.xml file to define an environment variable, for example. NO_PRINT, which is tested in each target project and, if found, prints only the project name and nothing more. The descriptions for the project will remain and allow ANT to walk on the tree and print out the various goals that will be affected.

+4
source share

I wanted the same thing, but like David, I just wrote some code (Python):

 from xml.etree import ElementTree build_file_path = r'/path/to/build.xml' root = ElementTree.parse(build_file_path) # target name to list of names of dependencies target_deps = {} for t in root.iter('target'): if 'depends' in t.attrib: deps = [d.strip() for d in t.attrib['depends'].split(',')] else: deps = [] name = t.attrib['name'] target_deps[name] = deps def print_target(target, depth=0): indent = ' ' * depth print indent + target for dep in target_deps[target]: print_target(dep, depth+1) for t in target_deps: print print_target(t) 
+4
source share

All Articles