ant任务将属性文件复制到java build dir中的相应位置

Jas*_*n S 6 java ant properties

好的,我很难过.

我有一个看起来像一个相当典型的Eclipse Java构建的Java树:

myproject
  src
    com
      example
        test
          // Java files in com.example.test here
  bin
    com
      example
        test
          // Compiled class files will go here
Run Code Online (Sandbox Code Playgroud)

现在我有一个MyClass.properties文件myproject/src/com/example/test和源Java文件.如何编写适当的ant任务来将源树中所有已更改的.properties文件复制到build(myproject/bin)树中的相应位置?

(更容易的一半是做实际的副本;我猜的更难的一半是检查依赖项)

Chr*_*ill 16

怎么样:

<copy todir="myproject/bin">
   <fileset dir="myproject/src" includes="**/*.properties"/>
</copy>
Run Code Online (Sandbox Code Playgroud)