- If you don't already have one, create a task that will store and retrieve environment variables, you're definitely going to need them doing anything java related (I believe there is one in the MSBuild extension pack)
- Create a custom task to wrap Ant or use the Script task from the MSBuild Community Tasks collection
- Run it a million times and fix the problems as you go, it's usually easier and faster to do this from the command line, so make friends with msbuild.exe inside the terminal
You should be able to pass around any info you want between environment variables, making whatever you want to do possible. I'm not going to recommend hard-coding paths to you, but you have to put the config somewhere and it's all a trade off of what you want to change and how you want things organized. If you really need to, you can push all the config into a database and suck it down with one of the SQL tasks in the above links, but just remember you're adding a considerable amount of complexity that may be unnecessary.
Ask yourself:
- how often is this value likely to change?
- what is the full set of tasks that would need to be done if it changes?
Write the answers to that down somewhere and make sure everybody on the team understands it. When it comes to build systems in my opinion "less is more". Find the simplest way to do it, and do that until that becomes unacceptable and only then add complexity... TFS is complicated enough already.