Some clarification about how ant copy some files into a folder?

橙三吉。 提交于 2019-12-25 03:18:52

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!