mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 01:02:41 +02:00
Docs: build_lcl_docs. Removes use of default footer file name.
* No default footer file is assumed. Allows output formats to be generated without footers when the --footer option is omitted. * Removes unused unit LazUtilities from uses clause. * Renames TFPDocRun.CreateOuputDir to TFPDocRun.CreateOutputDir. * Fixes strings used in exception and logging messages.
This commit is contained in:
parent
6f9144a584
commit
5e581ce962
@ -1,14 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<CONFIG>
|
<CONFIG>
|
||||||
<ProjectOptions>
|
<ProjectOptions>
|
||||||
<Version Value="11"/>
|
<Version Value="12"/>
|
||||||
<PathDelim Value="\"/>
|
<PathDelim Value="\"/>
|
||||||
<General>
|
<General>
|
||||||
<Flags>
|
<Flags>
|
||||||
<LRSInOutputDirectory Value="False"/>
|
<LRSInOutputDirectory Value="False"/>
|
||||||
|
<CompatibilityMode Value="True"/>
|
||||||
</Flags>
|
</Flags>
|
||||||
<SessionStorage Value="InIDEConfig"/>
|
<SessionStorage Value="InIDEConfig"/>
|
||||||
<MainUnit Value="0"/>
|
|
||||||
<Title Value="build_lcl_docs"/>
|
<Title Value="build_lcl_docs"/>
|
||||||
</General>
|
</General>
|
||||||
<BuildModes Count="1">
|
<BuildModes Count="1">
|
||||||
@ -19,13 +19,13 @@
|
|||||||
</PublishOptions>
|
</PublishOptions>
|
||||||
<RunParams>
|
<RunParams>
|
||||||
<local>
|
<local>
|
||||||
<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>
|
</local>
|
||||||
<FormatVersion Value="2"/>
|
<FormatVersion Value="2"/>
|
||||||
<Modes Count="1">
|
<Modes Count="1">
|
||||||
<Mode0 Name="default">
|
<Mode0 Name="default">
|
||||||
<local>
|
<local>
|
||||||
<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>
|
</local>
|
||||||
</Mode0>
|
</Mode0>
|
||||||
</Modes>
|
</Modes>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
program update_lcl_docs;
|
program update_lcl_docs;
|
||||||
|
|
||||||
{ Runs FPC's fpdoc document generator to generate LCL documentation,
|
{ Runs the FPC fpdoc document generator to generate LCL and LazUtils
|
||||||
e.g. in CHM format }
|
documentation in CHM or HTML format }
|
||||||
|
|
||||||
{$mode objfpc}{$H+}
|
{$mode objfpc}{$H+}
|
||||||
{$IFDEF MSWINDOWS}
|
{$IFDEF MSWINDOWS}
|
||||||
@ -9,7 +9,7 @@ program update_lcl_docs;
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, Sysutils, GetOpts, LazFileUtils, FileUtil, UTF8Process, LazUtilities,
|
Classes, Sysutils, GetOpts, LazFileUtils, FileUtil, UTF8Process,
|
||||||
LazStringUtils, Process;
|
LazStringUtils, Process;
|
||||||
|
|
||||||
var
|
var
|
||||||
@ -22,7 +22,7 @@ var
|
|||||||
DefaultXCTDir: String;
|
DefaultXCTDir: String;
|
||||||
DefaultFPDocParams: string = '';
|
DefaultFPDocParams: string = '';
|
||||||
DefaultOutFormat: string = 'html';
|
DefaultOutFormat: string = 'html';
|
||||||
DefaultFooterFilename: string = 'locallclfooter.xml'; // ToDo
|
DefaultFooterFilename: string = ''; // default is no footer(s)
|
||||||
|
|
||||||
type
|
type
|
||||||
TFPDocRunStep = (
|
TFPDocRunStep = (
|
||||||
@ -79,7 +79,7 @@ type
|
|||||||
procedure InitVars;
|
procedure InitVars;
|
||||||
procedure AddFilesToList(Dir: String; List: TStrings);
|
procedure AddFilesToList(Dir: String; List: TStrings);
|
||||||
procedure FindSourceFiles;
|
procedure FindSourceFiles;
|
||||||
procedure CreateOuputDir;
|
procedure CreateOutputDir;
|
||||||
procedure RunFPDoc;
|
procedure RunFPDoc;
|
||||||
procedure CopyToXCTDir;
|
procedure CopyToXCTDir;
|
||||||
procedure Execute;
|
procedure Execute;
|
||||||
@ -94,7 +94,7 @@ type
|
|||||||
property PackageName: string read FPackageName;
|
property PackageName: string read FPackageName;
|
||||||
property PasSrcDir: string read FPasSrcDir write SetPasSrcDir;
|
property PasSrcDir: string read FPasSrcDir write SetPasSrcDir;
|
||||||
property Step: TFPDocRunStep read FStep;
|
property Step: TFPDocRunStep read FStep;
|
||||||
property UsedPkgs: TStringList read FUsedPkgs; // e.g. 'rtl','fcl', 'lazutils'
|
property UsedPkgs: TStringList read FUsedPkgs; // e.g. 'rtl','fcl', 'lcl', 'lazutils'
|
||||||
property XCTDir: string read FXCTDir write SetXCTDir;
|
property XCTDir: string read FXCTDir write SetXCTDir;
|
||||||
property XMLSrcDir: string read FXMLSrcDir write SetXMLSrcDir;
|
property XMLSrcDir: string read FXMLSrcDir write SetXMLSrcDir;
|
||||||
property XCTFile: string read FXCTFile;
|
property XCTFile: string read FXCTFile;
|
||||||
@ -205,7 +205,7 @@ begin
|
|||||||
|
|
||||||
if DefaultOutFormat = '' then
|
if DefaultOutFormat = '' then
|
||||||
begin
|
begin
|
||||||
writeln('Error: Param outfmt wrong');
|
writeln('Error: Parameter outfmt is missing');
|
||||||
PrintHelp;
|
PrintHelp;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -405,7 +405,7 @@ var
|
|||||||
XMLFile, Filename: String;
|
XMLFile, Filename: String;
|
||||||
begin
|
begin
|
||||||
if ord(Step)>=ord(frsFilesGathered) then
|
if ord(Step)>=ord(frsFilesGathered) then
|
||||||
raise Exception.Create('TFPDocRun.FindSourceFiles not again');
|
raise Exception.Create('TFPDocRun.FindSourceFiles already called');
|
||||||
if ord(Step)<ord(frsVarsInitialized) then
|
if ord(Step)<ord(frsVarsInitialized) then
|
||||||
InitVars;
|
InitVars;
|
||||||
|
|
||||||
@ -446,18 +446,18 @@ begin
|
|||||||
FStep:=frsFilesGathered;
|
FStep:=frsFilesGathered;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFPDocRun.CreateOuputDir;
|
procedure TFPDocRun.CreateOutputDir;
|
||||||
var
|
var
|
||||||
TargetCSSFile: String;
|
TargetCSSFile: String;
|
||||||
begin
|
begin
|
||||||
if ord(Step)>=ord(frsOutDirCreated) then
|
if ord(Step)>=ord(frsOutDirCreated) then
|
||||||
raise Exception.Create('TFPDocRun.CreateOuputDir not again');
|
raise Exception.Create('TFPDocRun.CreateOutputDir already called');
|
||||||
|
|
||||||
if Not DirectoryExistsUTF8(OutDir) then
|
if Not DirectoryExistsUTF8(OutDir) then
|
||||||
begin
|
begin
|
||||||
writeln('Creating directory "',OutDir,'"');
|
writeln('Creating directory "',OutDir,'"');
|
||||||
if not CreateDirUTF8(OutDir) then
|
if not CreateDirUTF8(OutDir) then
|
||||||
raise Exception.Create('unable to create directory "'+OutDir+'"');
|
raise Exception.Create('Unable to create directory "'+OutDir+'"');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if ord(Step)<ord(frsFilesGathered) then
|
if ord(Step)<ord(frsFilesGathered) then
|
||||||
@ -469,7 +469,7 @@ begin
|
|||||||
if CompareFilenames(TargetCSSFile,CSSFile)<>0 then
|
if CompareFilenames(TargetCSSFile,CSSFile)<>0 then
|
||||||
begin
|
begin
|
||||||
if not CopyFile(CSSFile,TargetCSSFile) then
|
if not CopyFile(CSSFile,TargetCSSFile) then
|
||||||
raise Exception.Create('unable to copy css file: CSSfile="'+CSSFile+'" to "'+TargetCSSFile+'"');
|
raise Exception.Create('Unable to copy css file: CSSfile="'+CSSFile+'" to "'+TargetCSSFile+'"');
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -482,9 +482,9 @@ var
|
|||||||
CmdLine: String;
|
CmdLine: String;
|
||||||
begin
|
begin
|
||||||
if ord(Step)>=ord(frsFPDocExecuted) then
|
if ord(Step)>=ord(frsFPDocExecuted) then
|
||||||
raise Exception.Create('TFPDocRun.Run not again');
|
raise Exception.Create('TFPDocRun.Run already called');
|
||||||
if ord(Step)<ord(frsOutDirCreated) then
|
if ord(Step)<ord(frsOutDirCreated) then
|
||||||
CreateOuputDir;
|
CreateOutputDir;
|
||||||
|
|
||||||
if ShowCmd then
|
if ShowCmd then
|
||||||
begin
|
begin
|
||||||
@ -537,7 +537,7 @@ var
|
|||||||
TargetXCTFile, SrcCHMFile, TargetCHMFile: String;
|
TargetXCTFile, SrcCHMFile, TargetCHMFile: String;
|
||||||
begin
|
begin
|
||||||
if ord(Step)>=ord(frsCopiedToXCTDir) then
|
if ord(Step)>=ord(frsCopiedToXCTDir) then
|
||||||
raise Exception.Create('TFPDocRun.CopyToXCTDir not again');
|
raise Exception.Create('TFPDocRun.CopyToXCTDir already called');
|
||||||
if ord(Step)<ord(frsFPDocExecuted) then
|
if ord(Step)<ord(frsFPDocExecuted) then
|
||||||
RunFPDoc;
|
RunFPDoc;
|
||||||
|
|
||||||
@ -548,7 +548,7 @@ begin
|
|||||||
if ShowCmd then
|
if ShowCmd then
|
||||||
writeln('cp ',XCTFile,' ',TargetXCTFile)
|
writeln('cp ',XCTFile,' ',TargetXCTFile)
|
||||||
else if not CopyFile(XCTFile,TargetXCTFile) then
|
else if not CopyFile(XCTFile,TargetXCTFile) then
|
||||||
raise Exception.Create('unable to copy xct file: "'+XCTFile+'" to "'+TargetXCTFile+'"');
|
raise Exception.Create('Unable to copy xct file: "'+XCTFile+'" to "'+TargetXCTFile+'"');
|
||||||
writeln('Created ',TargetXCTFile);
|
writeln('Created ',TargetXCTFile);
|
||||||
if OutFormat='chm' then
|
if OutFormat='chm' then
|
||||||
begin
|
begin
|
||||||
@ -557,7 +557,7 @@ begin
|
|||||||
if ShowCmd then
|
if ShowCmd then
|
||||||
writeln('cp ',SrcCHMFile,' ',TargetCHMFile)
|
writeln('cp ',SrcCHMFile,' ',TargetCHMFile)
|
||||||
else if not CopyFile(SrcCHMFile,TargetCHMFile) then
|
else if not CopyFile(SrcCHMFile,TargetCHMFile) then
|
||||||
raise Exception.Create('unable to copy chm file: "'+SrcCHMFile+'" to "'+TargetCHMFile+'"');
|
raise Exception.Create('Unable to copy chm file: "'+SrcCHMFile+'" to "'+TargetCHMFile+'"');
|
||||||
writeln('Created ',TargetCHMFile);
|
writeln('Created ',TargetCHMFile);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -569,7 +569,7 @@ procedure TFPDocRun.Execute;
|
|||||||
begin
|
begin
|
||||||
writeln('===================================================================');
|
writeln('===================================================================');
|
||||||
if ord(Step)>=ord(frsComplete) then
|
if ord(Step)>=ord(frsComplete) then
|
||||||
raise Exception.Create('TFPDocRun.Execute not again');
|
raise Exception.Create('TFPDocRun.Execute already called');
|
||||||
if ord(Step)<ord(frsCopiedToXCTDir) then
|
if ord(Step)<ord(frsCopiedToXCTDir) then
|
||||||
CopyToXCTDir;
|
CopyToXCTDir;
|
||||||
|
|
||||||
@ -602,6 +602,5 @@ begin
|
|||||||
Run.Free;
|
Run.Free;
|
||||||
|
|
||||||
if ShowCmd then
|
if ShowCmd then
|
||||||
writeln('Not executing, simulation ended. Stop');
|
writeln('Not executed... simulation ended');
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user