You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2004/01/20 09:38:23 UTC

DO NOT REPLY [Bug 25705] - Various broken links and other errors in Ant documentation

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25705>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25705

Various broken links and other errors in Ant documentation





------- Additional Comments From jan@materne.de  2004-01-20 08:38 -------
Nice class. But it seems that it can´t handle anchors inside html pages. E.g. 
it reported on my machine

C:\seu\cvs-downloads\ant\ant\docs\manual\tutorial-tasks-filesets-
properties.html:24:14: broken link: file:/C:/seu/cvs-
downloads/ant/ant/docs/manual/tutorial-tasks-filesets-properties.html#filesets

But the tutorial*.html exists and has an anchor "filesets". MSIE shows the 
right place inside the file.


For more comfortable use I tried to make an automated download of the JAR, but 
couldn´t find the location. Searches on the netbeans site said that you have to 
compile that class for your own. So I did a little bit automatisation here. 

I can publish thoughts here, but I´m not sure whether this can be part of the 
official release, becuase it downloads sources from Sun ...


<?xml version="1.0" encoding="ISO-8859-1"?>
<project>

    <!-- Where is the basedir for the project to check -->
    <property name="project.base" location="ant"/>

    <!-- proxy settings -->
    <property name="proxy.host" value="---your-proxyhost---"/>
    <property name="proxy.port" value="---your-proxyport---"/>
    <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"/>


    <target name="checklinks.check">
        <available property="checklinks.present" file="checklinks.jar"/>
    </target>

    <target name="checklinks.create" unless="checklinks.present">
        <!-- Load source of the task and compile it if not present -->
        <!-- see http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25705 -->
        <mkdir dir="__src/org/netbeans/nbbuild"/>
        <get dest="__src/org/netbeans/nbbuild/CheckLinks.java" 
src="http://www.netbeans.org/unbranded-
source/browse/~checkout~/nbbuild/antsrc/org/netbeans/nbbuild/CheckLinks.java?
content-type=text/plain"/>
        <javac srcdir="__src"/>
        <tstamp><format property="date" pattern="dd.MM.yyyy - 
HH:mm:ss"/></tstamp>
        <jar destfile="checklinks.jar" basedir="__src">
            <manifest>
                <attribute name="Built-By" value="${user.name}"/>
                <attribute name="Built-On" value="${date}"/>
            </manifest>
        </jar>
        <delete includeemptydirs="true"><fileset dir="__src"/></delete>
    </target>

    <target name="checklinks" description="Checks Ant-Docs for broken Links" 
depends="checklinks.check,checklinks.create">
        <taskdef name="checklinks"
                 classpath="checklinks.jar"
                 classname="org.netbeans.nbbuild.CheckLinks"/>
        <!-- delete old reports -->
        <delete><fileset dir="." 
includes="checklinks.tmp,checklinks.log"/></delete>

        <!-- check for broken links and report to checklinks.log -->
        <record name="checklinks.tmp" action="start"/>
        <checklinks basedir="${project.base}/docs" checkexternal="false">
            <include name="**/*.html"/>
            <exclude name="manual/api/"/>
        </checklinks>
        <record name="checklinks.tmp" action="stop"/>

        <!-- clean the logfile -->
        <copy file="checklinks.tmp" tofile="checklinks.all.log">  <!-- 
tofile="${project.base}/checklinks.log" -->
            <filterchain>
                <linecontains>
                    <contains value="[checklinks]"/>
                </linecontains>
                <tokenfilter>
                    <linetokenizer/>
                    <replacestring from="[checklinks] " to=""/>
                    <trim/>
                </tokenfilter>
            </filterchain>
        </copy>

        <!-- split logfile according to error message -->
        <copy file="checklinks.all.log" tofile="checklinks.broken-links.log">
            <filterchain>
                <linecontains>
                    <contains value=" broken link:"/>
                </linecontains>
            </filterchain>
        </copy>
        <copy file="checklinks.all.log" tofile="checklinks.bad-uri.log">
            <filterchain>
                <linecontains>
                    <contains value=" bad relative URI:"/>
                </linecontains>
            </filterchain>
        </copy>
        <delete file="checklinks.tmp"/>
    </target>

</project>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org