I’m trying to get all the contents on my main classpath to get written to a file by my Ant buildscript:
<path id="main.class.path">
<fileset dir="${lib.main.dir}">
<include name="**/*.*"/>
</fileset>
</path>
When I hover over main.class.path, Ant/Eclipse launches a tooltip that shows the items on that classpath:
C:\Users\myUser\workbench\eclipse\workspace\myProj\lib\main\ant-junit-1.6.5.jar
etc. (The actual list has about 30 JARs on it.)
I want this list written to a file called deps.txt under my dist/ directory.
I’m stuck because I can’t figure out how to make main.class.path an Ant variable, or how to at least access it in the <echo> task:
<echo file="${dist.dir}/deps.txt" message="${???}"/>
Am I way-off base here, or even remotely close?!?
And for those of you out there that, instead of answering this question, would just comment Why would you want to do this?, my answer is simple: I just want a small text file in my JAR that serves as a visual reminder (for my future me) for what its dependencies are.
Try this: