Ant在属性上的错误目录

时间:2021-08-14 18:38:09

I'm a newbie on Ant so instead of posting this on the official buglist(because its probably not a bug), I decided to post here:

我是Ant的新手,所以不要在官方的bug列表上发布这个(因为它可能不是一个bug),我决定在这里发帖:

When I run my Ant build.xml file everything works well except for the build directory, that instead of translating the property ${classes.dir} into build/ver_2.0.0/classes it creates a file ${cv.build.dir}/classes

当我运行我的Ant build.xml文件时,一切都运行良好,除了构建目录,而不是将属性$ {classes.dir}转换为build / ver_2.0.0 / classes,它创建一个文件$ {cv.build.dir} /班

Here is part of the ant code:

这是蚂蚁代码的一部分:

<!--Properties-->
<property name="build.ver"   value="2.0.0"/> 
<property name="src.dir"     value="src"/>
<property name="lib.dir"     value="lib"/>
<property name="build.dir"   value="build"/>
<property name="classes.dir" value="${cv.build.dir}/classes"/>
<property name="jar.dir"     value="${cv.build.dir}/jar"/>
<property name="main-class"  value="br.uesc.computacao.estagio.controlador.ControladorModoExecucao"/>
<property name="cv.dir"      value="ver_${build.ver}"/>
<property name="cv.src.dir"  value="${src.dir}/${cv.dir}"/>
<property name="cv.build.dir" value="${build.dir}/${cv.dir}"/>
...
<target name="compile">
    <mkdir dir="${classes.dir}"/>

1 个解决方案

#1


5  

<property name="before" value="${after}"/>
<property name="after" value="MyBuildDirectory"/>

<target name="test" >
<mkdir dir="${before}"/>
</target>

It will create directory named ${after}... You must initialize your parameters first before use!

它将创建名为$ {after}的目录...您必须在使用前首先初始化您的参数!

#1


5  

<property name="before" value="${after}"/>
<property name="after" value="MyBuildDirectory"/>

<target name="test" >
<mkdir dir="${before}"/>
</target>

It will create directory named ${after}... You must initialize your parameters first before use!

它将创建名为$ {after}的目录...您必须在使用前首先初始化您的参数!