From 820b49e20c58dd258af97e3336209e61470bf939 Mon Sep 17 00:00:00 2001 From: vincents Date: Fri, 5 Nov 2010 11:25:47 +0000 Subject: [PATCH] lcl docs: pass units in order of dependencies to fpdoc, to work around the fact that fpdoc doesn't reorder them, so that it can create the links correctly. patch by: Marco van de Voort Issue #17246 git-svn-id: trunk@28095 - --- docs/html/build_lcl_html.sh | 53 +++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/docs/html/build_lcl_html.sh b/docs/html/build_lcl_html.sh index 77b236ff62..5d0f7a5ed6 100755 --- a/docs/html/build_lcl_html.sh +++ b/docs/html/build_lcl_html.sh @@ -5,7 +5,8 @@ # Creates the fpdoc HTML output for the LCL # Creates an chm file, if HTMLFMT is set to chm, # otherwise it create html docs - +# +# #set -x set -e @@ -22,14 +23,62 @@ XMLSrcDir=../xml/lcl/ PasSrcDir=../../lcl/ InputFileList=inputfile.txt +# list with units in a preseeded order. +# missing units will be dropped from this list, other units added. +# units not in import order will mutilate links. + +PreorderUnitList=( lclbase fpcadds lclstrconsts masks fileutil utf8process lcltype lclproc tmschema lresources lclclasses ) +PreorderUnitList+=( avglvltree graphmath graphtype lmessages interfacebase lclrescache graphics imglist themes actnlist clipbrd stdactns ) +PreorderUnitList+=( graphics controls forms stdctrls extctrls buttons dialogs comctrls ) +PreorderUnitList+=( lazhelpintf printers grids dbgrids menus ) + +#------------------ + +inarray() +{ local tofind=$1 element; + shift; for element; do [[ $element = "$tofind" ]] && return; done; return 1; +} +# Usage: inarray "$value" "${array[@]}" + + +UnitListArr=() + # create output directory mkdir -p $PackageName # create unit list cd $PasSrcDir -UnitList=`echo *.pp *.pas` +FindUnitList=(*.pp *.pas) cd - +# test for preorder unit existance, add them to unitlist. +for preorder in ${PreorderUnitList[@]}; do + if [ -f $PasSrcDir/$preorder.pp ] + then + UnitListArr+=($preorder.pp) + fi + if [ -f $PasSrcDir/$preorder.pas ] + then + UnitListArr+=($preorder.pas) + fi +done + +#echo 1 ${UnitListArr[@]} + +for foundunit in ${FindUnitList[@]}; do + if ! inarray "$foundunit" "${UnitListArr[@]}" + then + UnitListArr+=($foundunit) + fi +done + +UnitList= +for foundunit in ${UnitListArr[@]}; do + UnitList+="$foundunit " +done + +# echo 2 $UnitList + # create description file list DescrFiles='' for unit in $UnitList; do