Bug 38915 - ${property_value} doesn't expand in description (FEATURE REQUEST)
Summary: ${property_value} doesn't expand in description (FEATURE REQUEST)
Status: NEW
Alias: None
Product: Ant
Classification: Unclassified
Component: Core (show other bugs)
Version: 1.6.5
Hardware: PC Windows XP
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Ant Notifications List
Depends on:
Reported: 2006-03-10 05:53 UTC by Dennis Bednar
Modified: 2008-11-24 03:58 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
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 name="compile" description="compile java stuff step and builds 
		<echo>FAKE compile step</echo>
		<echo>building ${jarfile}</echo>


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.

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


Run first!
Some text
Main targets:

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