问题
I am pretty new to ant (I came from Maven and Ant is a nightmare for me !!!)
I have this target:
<target name="linuxdriver"
description="Linux Driver">
<copy file="${deps.linuxdriver.dir}/${deps.linuxdriver.name}" tofile="${project.datadir}/${deps.linuxdriver.name}"/>
<copy file="${deps.linuxdriver.dir}/${deps.linuxdriver.name}" tofile="${project.deploy}/data/${deps.linuxdriver.name}"/>
<chmod perm="+x" file="${project.datadir}/${deps.linuxdriver.name}"/>
<chmod perm="+x" file="${project.deploy}/data/${deps.linuxdriver.name}"/>
</target>
and I have also a property file in which there is definied the "variable" (are named variable?) used in the previous ant code, specifically I have:
project.datadir = ${basedir}/data
project.deploy.dir = Release
project.deploy = ${basedir}/../${project.deploy.dir}
And now I have some doubts:
1) What represents ${basedir}? A specific directory? What?
2) Using the previous information what exactly are the two destination folder in which the files are copied (using the "copy file...to file" tag)?
回答1:
That concept of basedir is described in the ANT manual:
- Built-in properties
- Writing a simple Buildfile
It's normally set to be the directory from where you run the build (can be overridden).
If you need to see how properties are resolved, consider running your build in debug mode
来源:https://stackoverflow.com/questions/19187535/some-clarification-about-how-ant-copy-some-files-into-a-folder