As for best practices, I believe that you should have your license text in a separate file and have a build tool (i.e. ant) ββto add it at the beginning of all other files. Since you're talking about an open source project, you still need a build process to think about how to generate javadocs, publish releases, etc.
BTW, ant tasks are simple Java classes, so it's easy to write them yourself if you don't find the ant plugin that does just that.
Having come to an eclipse, as far as I know, he cannot do something like that. The fastest way I can do is bash (if you are using Linux). Suppose the msg file contains the text you want to add at the beginning of each file.
Create a new directory for storing files:
mkdir ~ / outdir
Add msg at the beginning of each file and put the result in outdir
for I'm in ls "*.java" ; do cat msg $ i> ~ / outdir / $ i; done
Similarly, you can write a command that does the same recursively, with an extra step to create the strucutre directory:
mkdir ~/outdir for i in `find -type d | sed 's/\.//' | grep -v "^$"`; do mkdir ~/outdir$i; done for i in `find -name "*.java"`; do cat msg $i > ~/outdir/$i ; done
idrosid Oct. 15 '08 at 14:28 2008-10-15 14:28
source share