0

Is it possible to pass the output of an ant target as the value of something else? Such as:

<target name="svnrevision">
        <exec executable="svnversion" outputproperty="svnversion" />
    </target>

<target name="jar">
        ...
            <manifest>
                <attribute name="irrelevant" value="${svnversion}"/>
            </manifest> 
    </target>

Where ${svnversion} would be something like 12345.

Dumpcats
  • 453
  • 5
  • 21

2 Answers2

2

Try adding a dependency between he targets

<target name="jar" depends="svnversion">
Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185
0

I ended up solving my own problem by having the

<exec executable="svnversion" outputproperty="svnversion" />

line be within the jar target itself. Ant didn't seem to be able to figure out what I was trying to do when it was in a separate target.

Dumpcats
  • 453
  • 5
  • 21