Re: Reduce cut and paste waste was: Here is my Centipede scepticism
Mats Henricson <[email protected]>
| Newsgroups | gmane.comp.krysalis.user |
|---|---|
| Message-ID | <[email protected]> |
Nick Chalko wrote:
> Mats goes on to say
>
> 2. It is trying to automate/simplify something that is always going
> to have to be customized by hand.
> Take my JavaDoc ant task, as an example. It contains a LOT of things
> that are special to me and my project. I believe there is no way you
> can make it simpler than it already is.
> <target name="javadoc" depends="compile" description="Create Javadoc
> API documentation">
> <mkdir dir="${dist.home}/docs/api"/>
> <javadoc sourcepath="${src.home}"
> destdir="${dist.home}/docs/api"
> packagenames="*"
> author="true"
> version="true"
> use="true"
> protected="true"
> splitindex="true"
> windowtitle="UPL code">
> <doctitle>UPL code</doctitle>
> <header>UPL code</header>
> <bottom>< ![CDATA[<i>Copyright © 2003 Mats Henricson. All
> Rights Reserved.</i>] ]></bottom>
> <link href="http://java.sun.com/j2se/1.3/docs/api/"/>
> <link href="http://java.sun.com/products/servlet/2.2/javadoc/"/>
> <link href="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/"/>
> <link href="http://java.sun.com/xml/docs/api/"/>
> <link href="http://www.junit.org/junit/javadoc/3.8.1/"/>
> <link href="http://jakarta.apache.org/log4j/docs/api/"/>
> <link href="http://xml.apache.org/xerces2-j/javadocs/api/"/>
> <link href="http://xml.apache.org/xalan-j/apidocs/"/>
> <link href="http://tyrex.exolab.org/api/"/>
> <link href="http://hibernate.bluemars.net/hib_docs/api/"/>
> <classpath refid="compile.classpath"/>
> </javadoc>
> </target>
>
> I agree often you will want to do your own thing. No problem use the
> Javadoc target you just built. But instead of cut and pasting it
> everywhere. Make a cent out of it and share it between your projects. I
> have several custom cents I use at work.
>
> But perhaps the centipede Javadoc target is good enough. Lets take a
> look. Here is the Javadoc target from java.cent
> <http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/krysalis/krysalis-cents/java/src/xbuild.xml?rev=HEAD&content-type=text/vnd.viewcvs-markup>
>
>
> <!-- ===================================================================
> -->
> <!-- Creates the API documentation
> -->
> <!-- ===================================================================
> -->
> <target name="javadocs"
> description="Generates the API documentation in javadoc format">
> <if>
> <not> <isset property="java.cent.javadoc.overview"/></not>
> <then>
> <style in="module.xml"
> out="${java.cent.work.dir}/javadocs/overview.html"
>
> style="${java.cent.dir}/resources/stylesheets/module2overview.xsl">
> </style>
> <property name="java.cent.javadoc.overview"
>
> value="${java.cent.work.dir}/javadocs/overview.html"/>
> </then>
> </if>
>
> <mkdir dir="${java.cent.javadocs.dir}"/>
> <javadoc
> packagenames="${jxpath:/references/module.xml/root/module/project[@name=$project.name]/package}.*"
>
> sourcepath="${project.src.dir}"
> destdir="${java.cent.javadocs.dir}"
> author="true"
> version="true"
> use="true"
> failonerror="true"
> noindex="true"
> overview="${java.cent.javadoc.overview}"
> source= "${build.compiler.source}"
> group="${centipede.tools.java.cent.javadocs.group}"
> windowtitle="${project.name}
> ${project.version.package-version} API"
>
> stylesheetfile="${java.cent.dir}/resources/stylesheets/javadoc.css">
>
> <classpath>
> <path refid="${project.name}.classpath"/> </classpath>
>
> <doctitle>${project.name} ${project.version.package-version}
> API</doctitle>
> <bottom><![CDATA[<center><i>Copyright © ${YEAR}
> ${xgump.module.vendor}. All Rights Reserved.</i></center>]]></bottom>
> <header><![CDATA[${project.name}
> ${project.version.package-version}]]></header>
> <footer><![CDATA[${project.name}
> ${project.version.package-version}]]></footer>
> <tag name="todo" scope="all" description="To do:" />
> <link offline="true"
> href="http://java.sun.com/products/jdk/1.4/docs/api/"
> packagelistLoc="${java.cent.dir}/resources/jdk14-project.version.package-list"/>
>
> </javadoc>
> </target>
>
> This target does a pretty good job of producing generic Javadocs. Take a
> look at the Javadocs for the Krysalis Sample
> <http://www.krysalis.org/templates/krysalis-project/javadocs/index.html>
> project. Note the automatic version labeling. We also optionally create
> a simple overview.html from the infomation in the gump module.xml file.
> The main deficiency I see is, we only link to jdk 1.4 and jdk 1.4 is
> hardcoded. Looks like something we should fix. Perhaps you could supply
> a patch. ;-)
>
> I got tired of cutting and pasting the same Javadoc target into every
> build.xml I wrote. I never kept them all uptodate. It was a giant
> headache. So I joined the Krysalis <http://krysalis.org> team. I have
> only worked on one Javadoc target since then. The one in java.cent
> <http://www.krysalis.org/cents/cents/java/index.html>.
I can't use your cent, since you don't have the link's
I need for my project! See above! I have a ton of:
<link href="URL"/>
Your project uses different libraries than my project,
so we can't share javadoc cents!
Mats
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.