OK, I'm stumped.
I have a Java tree that looks like a fairly typical Eclipse Java build:
myproject
src
com
example
test
// Java files in com.example.test here
bin
com
example
test
// Compiled class files will go here
Now I have a MyClass.properties
file in myproject/src/com/example/test
along with the source Java files. How can I write an appropriate ant task to copy all the changed .properties files in the source tree, to their corresponding places in the build (myproject/bin
) tree?
(The easier half of this is to do the actual copy; the harder half of this I'm guessing is checking for dependencies)
resource collections are used to select groups of URLs to download. If the collection contains more than one resource, the dest attribute must point to a directory if it exists or a directory will be created if it doesn't exist.
The 'basedir' is the base directory from which any relative directories used within the Ant build file are referenced from. If this is omitted the parent directory of the build file will be used.
How about:
<copy todir="myproject/bin">
<fileset dir="myproject/src" includes="**/*.properties"/>
</copy>
From the Ant manual about the task:
Copies a file or resource collection to a new file or directory. By default, files are only copied if the source file is newer than the destination file, or when the destination file does not exist. However, you can explicitly overwrite files with the overwrite attribute.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With