* Fixed build_lcl_docs to include files in the lcl subfolders recursively

* Added --make-searchable to default fpdoc options when the format is chm

git-svn-id: trunk@21630 -
This commit is contained in:
andrew 2009-09-09 00:50:52 +00:00
parent c023781b29
commit ad18ccca04
4 changed files with 32 additions and 49 deletions

View File

@ -20,7 +20,7 @@ htmldocs: build_lcl_docs
./$< --outfmt html
chmdocs: build_lcl_docs
./$< --outfmt chm --arg --make-searchable
./$< --outfmt chm
build_lcl_docs: build_lcl_docs.lpi build_lcl_docs.lpr
ifeq (${LAZBUILD},)

View File

@ -7,5 +7,5 @@ REM 1 - Please fix the path in this file for your installation
REM 2 - Before running this file, first compile the project build_lcl_docs.lpi
REM
PATH=D:\programming\fpc\bin\i386-win32\
build_lcl_docs.exe --outfmt chm --arg --make-searchable
pause
build_lcl_docs.exe --outfmt chm
pause

View File

@ -2,17 +2,18 @@
<CONFIG>
<ProjectOptions>
<PathDelim Value="\"/>
<Version Value="6"/>
<Version Value="7"/>
<General>
<Flags>
<LRSInOutputDirectory Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<TargetFileExt Value=".exe"/>
<Title Value="build_lcl_docs"/>
<ActiveEditorIndexAtStart Value="0"/>
</General>
<VersionInfo>
<ProjectVersion Value=""/>
<Language Value=""/>
<CharSet Value=""/>
</VersionInfo>
<PublishOptions>
<Version Value="2"/>
@ -23,7 +24,7 @@
<RunParams>
<local>
<FormatVersion Value="1"/>
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
<LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
<Units Count="1">
@ -31,46 +32,14 @@
<Filename Value="build_lcl_docs.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="build_lcl_docs"/>
<CursorPos X="19" Y="258"/>
<TopLine Value="231"/>
<EditorIndex Value="0"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
</Unit0>
</Units>
<JumpHistory Count="3" HistoryIndex="2">
<Position1>
<Filename Value="build_lcl_docs.lpr"/>
<Caret Line="10" Column="1" TopLine="1"/>
</Position1>
<Position2>
<Filename Value="build_lcl_docs.lpr"/>
<Caret Line="168" Column="12" TopLine="144"/>
</Position2>
<Position3>
<Filename Value="build_lcl_docs.lpr"/>
<Caret Line="11" Column="6" TopLine="1"/>
</Position3>
</JumpHistory>
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>
<Version Value="8"/>
<PathDelim Value="\"/>
<CodeGeneration>
<Generate Value="Faster"/>
</CodeGeneration>
<Other>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
<Debugging>
<Exceptions Count="2">
<Item1>
<Name Value="ECodetoolError"/>
</Item1>
<Item2>
<Name Value="EFOpenError"/>
</Item2>
</Exceptions>
</Debugging>
</CONFIG>

View File

@ -145,21 +145,33 @@ begin
if OutFormat='chm' then
begin
ArgParams:=ArgParams+' --output='+ ChangeFileExt(PackageName, '.chm')
+' --auto-toc --auto-index'
+' --auto-toc --auto-index --make-searchable'
+' --css-file=..'+PathDelim+'fpdoc.css ';
end;
ArgParams:=ArgParams+' --format='+OutFormat+' ';
end;
procedure AddFilesToList(Ext: String; List: TStrings);
procedure AddFilesToList(Dir: String; Ext: String; List: TStrings);
var
FRec: TSearchRec;
Res: Longint;
SubDirs: String; // we dont want the PasSrcDir in this string but the subfolders only
begin
Res := FindFirst(PasSrcDir+'*.'+Ext, faAnyFile, FRec);
Res := FindFirst(Dir+'*', faAnyFile, FRec);
while Res = 0 do begin
List.Add(FRec.Name);
//WriteLn('Checking file ' +FRec.Name);
if ((FRec.Attr and faDirectory) <> 0) and (FRec.Name[1] <> '.')then
begin
AddFilesToList(IncludeTrailingPathDelimiter(Dir)+FRec.Name, Ext, List);
//WriteLn('Checking Subfolder ',Dir+ FRec.Name);
end
else if Lowercase(ExtractFileExt(FRec.Name)) = Ext then
begin
SubDirs := IncludeTrailingPathDelimiter(Copy(Dir, Length(PasSrcDir)+1, Length(Dir)));
List.Add(SubDirs+FRec.Name);
end;
Res := FindNext(FRec);
end;
FindClose(FRec);
@ -198,16 +210,18 @@ var
begin
FileList := TStringList.Create;
InputList := TStringList.Create;
AddFilesToList('pas', FileList);
AddFilesToList('pp', FileList);
AddFilesToList(PasSrcDir, '.pas', FileList);
AddFilesToList(PasSrcDir, '.pp', FileList);
FileList.Sort;
for I := 0 to FileList.Count-1 do
begin
InputList.Add('..'+PathDelim+PasSrcDir+FileList[I] + ' -Fi..'+PathDelim+PasSrcDir+'include');
XMLFile := XMLSrcDir+ChangeFileExt(FileList[I],'.xml');
if FileExists(PackageName+PathDelim+XMLFile) then
ArgParams:=ArgParams+' --descr='+XMLSrcDir+ChangeFileExt(FileList[I],'.xml')
begin
InputList.Add('..'+PathDelim+PasSrcDir+FileList[I] + ' -Fi..'+PathDelim+PasSrcDir+'include');
ArgParams:=ArgParams+' --descr='+XMLSrcDir+ChangeFileExt(FileList[I],'.xml');
end
else
WriteLn('Warning! No corresponding xml file for unit ' + FileList[I]);
end;