2010-03-31 130 views

回答

6

没关系,我得到它的工作:

<target name="svnversion"> 
    <echo file="${srcDir}/${packagePath}/svnversion.properties">svnversion=</echo> 
    <exec executable="svnversion" 
     output="${srcDir}/${packagePath}/svnversion.properties" append="true"> 
    </exec> 
</target> 
3

我使用的是执行svn info --xml,然后使用<XmlProperty> task加载得到的xml文件,最后只是替换构建路径路径的属性文件中的一个令牌。

因此,像这样:

<target name="svn-build-number"> 
    <tempfile property="svninfo.file"/> 
    <exec dir="." executable="svn" output="${svninfo.file}"> 
    <arg line="info --xml"/> 
    </exec> 
    <echo message="${svninfo.file}" /> 
    <xmlproperty file="${svninfo.file}" collapseAttributes="true" /> 
    <echo message="${info.entry.revision}" /> 
</target> 

${info.entry.revision}是在当前目录库的修订。

+0

,而不是温度。文件,你可以使用一个属性: < propertyresource name =“svninfo.xml”/> kabado 2010-08-06 10:30:28

相关问题