Hey guys,
Is there an ant4eclipse target that lets you query for which projects a given project depends on?
For instance, I'd like to make a macro (something like <buildJdtProjectRecursive>
) that builds a project and any sub-projects it depends on. However, I can't seem to find any way to get a list of dependent projects.
Project dependencies appear to be tracked in .classpath:
<classpathentry combineaccessrules="false" kind="src" path="/project-i-depend-on"/>
Is there a way to get these that I'm overlooking? buildJdtProject
doesn't compile them automatically, and getJdtSourcePath
seems to ignore them as well.
Alternatively, is there some flag to <buildJdtProject>
to tell it to build recursively?
Thanks!
-Gordon
- Login to post comments
GetUsedProjects
Hi Gordon,
you can use the - yet undocumented -
getUsedProjects
task:The reason why this task is not documented is that it is an 'old-style' task that only sets a property (or a path) but doesn't let you iterate over the projects. To do so, you have to use the ant-contrib task (
for
orforeach
)Hope that solves your problem...
Regards,
gerd
In case anyone comes looking
In case anyone comes looking for this later, here is a simple recursive build macro. Requires ant-contrib-1.0b3.jar and
xmlns:ac="antlib:net.sf.antcontrib"
.Usage:
<buildJdtProjectRecursively projectName="myproject" />
-Gordon
Thank you!
Thanks for the info, that's exactly what I needed!
I also found this open Jira issue discussing the upcoming
getReferencedProjects/getProjectDependencies
tasks. It sounds like they will do something similar.getUsedProjects
is a million times better than what I had, which was a macro using getJdtClassPath and regular expressions to parse project names out of non-jar classpath entries. :)Thanks!
-Gordon