20100409

Wasting time with bash scripting

Netbeans was building Javadoc for me just fine 6 hours ago, and I figured out how to use javadoc from the command line about 2 hours ago, and I could have just pasted a list of packages in my project into a shell script and been done with everything about an hour ago.

But.. but... but...

I want to figure out how to make javadoc automatically document all packages in my source directory. Again, Netbeans does this but I'm trying to learn how to do coding projects efficiently in a simple linux environment.

So, I guess I want some way to automatically generate something like javadoc -d $DOC_DIR [list of automatically generated package references for a given source directory]

Solution : I can't actually express the full solution here because it involves strings that Blogger can't handle... that is, if I enter them into the post editor they will be interpreted as control characters. Anyway, here is the important bits :

mkdir $DOC
cd src
javadoc -d $DOC $(find . -type d | tr '\n' ' ' | sed -e 's/[./]//g' | sed -e 's/^ //g' | sed -e 's/ $//g' | tr ' ' '\n')
cp *.css $DOC


I bet there was some combination for flags for javadoc that would have made this significantly more simple, but I need to get more familiar with shell scripting.

No comments:

Post a Comment