Hello fellow stackoverflowers,
Most Ant build files I've seen online involve a "clean" target that always removes a directory using deltree and recreates that directory, where all the binaries will be outputted to. Is this a performance problem? That is, a source file should only be compiled if it has been changed, but if the directory holding all the binaries is deleted after every build, then all files have to be recompiled on each build. Is this what happens, and if so, am I wrong in saying that this could really hurt performance.
As a follow up question, is doing this absolutely necessary or highly recommended when using Ant? My team happens to be using dropbox to sync to multiple machines, and we may not want this step to occur on every run.
Thanks for any input!
-alanhorizon
Clean is generally superfluous if you are adding or changing existing classes. javac checks the timestamp ofclass files to keep them up to date.
It becomes essential if some classes have been deleted. If you don't clean up first, you end up with outdated class files sometimes causing dependency issues.
And no, performing a clean up is not a performance impact worth to mention compared to other tasks involved in the build/deployment process.
You can often avoid the clean step and javac will only compile changes. For rapid development you can probably get away with it and just run clean when you run into a problem. For builds that you'll deploy it's safest to always do a clean first to deal with any intricate dependencies that might not work otherwise.
That said, why in the world are you sharing source with a team through Dropbox? You should use Subversion or Git (or plenty of others) for source control management. They're designed for this and you're going to want them as soon as you deal with anything potentially complex like branching and merging. Consider using GitHub if you want to avoid setting much up.
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