Raible's Wiki
Raible Designs AppFuseHomepage- Korean - Chinese - Italian - Japanese QuickStart Guide User Guide Tutorials Other ApplicationsStruts ResumeSecurity Example Struts Menu
Set your name in
UserPreferences
Referenced by
JSPWiki v2.2.33
Hide Menu |
This page will show you how to setup AppFuse 1.8 and Jalopy that you can format/beautify your code. This is useful if you're in a development team or if you like making your code more readable ;-). This tutorial is divided in two. First we have to setup an ant task that calls jalopy to format your code, once there we'll have to modify appfuse's source code (I hope it's not for long, since all we do is modify the javadoc comments in the code). Every file url starts at your projects root foolder, I used appfuse's source code for this tutorial, but have done it with several ant new projects (just change the org/appfuse package to whatever your using, but I'll recomend changing your root appfuse, that way, every new project will have jalopy setup). There are two attachments at the bottom of the page you'll need. AppFuse Setup
# # Jalopy - http://jalopy.sourceforge.net # jalopy.version=1.0b11 jalopy.dir=${lib.dir}/jalopy-${jalopy.version} jalopy.jar=${jalopy.dir}/jalopy-ant-0.6.2.jar
<path id="jalopy.classpath"> <path refid="dao.test.classpath"/> <path refid="service.test.classpath"/> <path refid="web.test.classpath"/> <fileset dir="${jalopy.dir}" includes="*.jar"/> </path>
<taskdef name="jalopy" classname="de.hunsicker.jalopy.plugin.ant.AntPlugin" classpath="${jalopy.jar}"/>
<target name="jalopy" depends="compile"> <jalopy convention="um.xml" loglevel="info" threads="2" classpathref="jalopy.classpath"> <fileset dir="${src}"> <include name="**/*.java"/> </fileset> </jalopy> </target>If you're looking at what we're doing you'll notice a convention xml named um.xml... this is the convention I use, and you can change it if you like, but I won't get into that, there are tools to do that (an Eclipse plugin, a standalone gui, etc.). By the way, the um.xml is attached at the bottom of this page as well as the jalopy-1.0b11.zip (you'll have to use this one, if you want the jalopy task you've just create it to format your javadoc comments, because it's patched to know what to do with the servlet-mapping tag found in some servlets). Thats it!!! Well... not quite, we still have to modify some javadocs :-)... Fixing AppFuse's javadocsBefore this it all was fun, now comes the ugly part... But be patient, it's worth it!!!
* <a href="StringUtil.java.html"><i>View Source</i></a>
@author <a href="mailto:[email protected]">Matt Raible</a>
* Contributed by:<br> * <br> * XEsoft GmbH<br> * Oskar-Messter-Strasse 18<br> * 85737 Ismaning, Germany<br> * http://www.xesoft.com<br> *Save all your edited files and try running ant jalopy. And as Matt so eloquently puts it: Yeah Baby, Yeah:
BUILD SUCCESSFUL
[#1]Just found out there's a limit to the chars jalopy can hold as a description, so if you don't want to lose the link to the html page, you will have to lose this section (Don't move the lines just erase them...). Attachments:
|