Ant目标依赖关系树查看器

是否有一个软件(或一个eclipse插件),

给定目标,是否允许我将目标依赖关系视为树?

树不需要是图形的,可以是基于文本的 – 只是一个工具,可以帮助我遍历某人的ant文件网格来调试它们。

不需要是Eclipse插件。 但是,单击一个节点会将该目标的源抛出到编辑器上会很好。

类似于Eclipse中的问题ant调试 。

根据Apache的ANT手册 ,您可以从-projecthelp选项开始。 之后可能会更加困难,因为各种目标可能具有交叉依赖性,因此根本不可能将层次结构表示为树。

您可以修改build.xml以检测环境变量,例如在每个项目目标中测试的NO_PRINT,如果找到,则只打印出项目名称而不打印任何其他内容。 项目的依赖关系将保留,并允许ANT遍历树并生成将被触摸的不同目标的打印输出。

我想要同样的东西,但是,像大卫一样,我最后只是编写了一些代码(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)