Bug 38915

Summary: ${property_value} doesn't expand in description (FEATURE REQUEST)
Product: Ant Reporter: Dennis Bednar <dennis.bednar>
Component: CoreAssignee: Ant Notifications List <notifications>
Status: NEW ---    
Severity: enhancement    
Priority: P2    
Version: 1.6.5   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   

Description Dennis Bednar 2006-03-10 05:53:00 UTC
Given this small demo file:

<?xml version="1.0" ?>
<project default="compile">

	<property name="jarfile" value="Hello.jar" />

	<target name="init" description="initialization stuff">
		<echo>FAKE init step</echo>
	</target>
	
	<target name="compile" description="compile java stuff step and builds 
${jarfile}"
		depends="init">
		<echo>FAKE compile step</echo>
		<echo>building ${jarfile}</echo>
	</target>

</project>

when I run "ant -p" i see this:

Buildfile: build.xml

Main targets:

 compile  compile java stuff step and builds ${jarfile}
 init     initialization stuff
Default target: compile

I expect the ${jarfile} to be expanded in the description.  It would be
nicer ...
Comment 1 Steve Loughran 2006-03-10 11:19:02 UTC
The problem here is that we dont want to execute the build file before printing
the description --imagine the consequences if -p had side effects. 

I'm not sure we should even try to fix this, as it would fundamentally change
the semantics of a -p operation. You are free to use <echo> statements to in a
help target to provide more detail.
Comment 2 Jesse Glick 2006-03-10 19:36:56 UTC
Note that -p already does have side effects, if you have top-level tasks.

<project>
    <echo>Run first!</echo>
    <description>Some text</description>
</project>

->

Run first!
Some text
Main targets:

Other targets:
Comment 3 Peter Reilly 2006-03-13 09:20:31 UTC
Opps, that is not good.