build_lcl_docs: added --verbose parameter

git-svn-id: trunk@50658 -
This commit is contained in:
mattias 2015-12-05 19:05:36 +00:00
parent eeeb237080
commit eb52ff3c86
2 changed files with 18 additions and 10 deletions

View File

@ -1,4 +1,4 @@
<?xml version="1.0"?> <?xml version="1.0" encoding="UTF-8"?>
<CONFIG> <CONFIG>
<ProjectOptions> <ProjectOptions>
<Version Value="9"/> <Version Value="9"/>
@ -7,7 +7,7 @@
<Flags> <Flags>
<LRSInOutputDirectory Value="False"/> <LRSInOutputDirectory Value="False"/>
</Flags> </Flags>
<SessionStorage Value="InProjectDir"/> <SessionStorage Value="InIDEConfig"/>
<MainUnit Value="0"/> <MainUnit Value="0"/>
<Title Value="build_lcl_docs"/> <Title Value="build_lcl_docs"/>
</General> </General>
@ -41,7 +41,7 @@
<Unit0> <Unit0>
<Filename Value="build_lcl_docs.lpr"/> <Filename Value="build_lcl_docs.lpr"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="build_lcl_docs"/> <UnitName Value="update_lcl_docs"/>
</Unit0> </Unit0>
</Units> </Units>
</ProjectOptions> </ProjectOptions>
@ -53,8 +53,5 @@
<UseAnsiStrings Value="False"/> <UseAnsiStrings Value="False"/>
</SyntaxOptions> </SyntaxOptions>
</Parsing> </Parsing>
<Other>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions> </CompilerOptions>
</CONFIG> </CONFIG>

View File

@ -14,7 +14,7 @@ uses
var var
fpdoc: String = 'fpdoc'; fpdoc: String = 'fpdoc';
ArgParams: String; ArgParams: String;
CSSFile: String; CSSFile: String = 'fpdoc.css';
EnvParams: String; EnvParams: String;
fpdocfooter: String; fpdocfooter: String;
FPCDocsPath: String; FPCDocsPath: String;
@ -23,6 +23,7 @@ var
RTLPrefix: String; RTLPrefix: String;
FCLPrefix: String; FCLPrefix: String;
WarningsCount: Integer; WarningsCount: Integer;
Verbosity: integer = 0;
const const
PackageName = 'lcl'; PackageName = 'lcl';
@ -46,8 +47,8 @@ begin
WriteLn('Usage for '+ ExtractFileName(ParamStr(0)), ':'); WriteLn('Usage for '+ ExtractFileName(ParamStr(0)), ':');
WriteLn; WriteLn;
Writeln(' --css-file <value> (CHM format only) CSS file to be used by fpdoc'); Writeln(' --css-file <value> (CHM format only) CSS file to be used by fpdoc');
Writeln(' for the layout of the help pages.'); Writeln(' for the layout of the help pages. Default is "',CSSFile,'"');
WriteLn(' --fpdoc <value> The full path to fpdoc to use. Default is "fpdoc"'); WriteLn(' --fpdoc <value> The full path to fpdoc to use. Default is "',fpdoc,'"');
WriteLn(' --fpcdocs <value> The directory that contains the fcl and rtl .xct files.'); WriteLn(' --fpcdocs <value> The directory that contains the fcl and rtl .xct files.');
WriteLn(' Use this to make help that contains links to the rtl and fcl'); WriteLn(' Use this to make help that contains links to the rtl and fcl');
WriteLn(' --footer <value> Filename of a file to use a footer used in the generated pages.'); WriteLn(' --footer <value> Filename of a file to use a footer used in the generated pages.');
@ -57,6 +58,7 @@ begin
WriteLn(' --outfmt html|chm Use value as the format fpdoc will use. Default is "html"'); WriteLn(' --outfmt html|chm Use value as the format fpdoc will use. Default is "html"');
WriteLn(' --showcmd Print the command that would be run instead if running it.'); WriteLn(' --showcmd Print the command that would be run instead if running it.');
WriteLn(' --warnings Show warnings while working.'); WriteLn(' --warnings Show warnings while working.');
WriteLn(' --verbose be more verbose');
WriteLn; WriteLn;
WriteLn('The following are environment variables that will override the above params if set:'); WriteLn('The following are environment variables that will override the above params if set:');
WriteLn(' FPDOCFORMAT, FPDOCPARAMS, FPDOC, FPDOCFOOTER, FPCDOCS, RTLLINKPREFIX, FCLLINKPREFIX'); WriteLn(' FPDOCFORMAT, FPDOCPARAMS, FPDOC, FPDOCFOOTER, FPCDOCS, RTLLINKPREFIX, FCLLINKPREFIX');
@ -89,9 +91,10 @@ begin
Options[7].Name:='warnings'; Options[7].Name:='warnings';
Options[8].Name:='css-file'; Options[8].Name:='css-file';
Options[8].Has_arg:=1; Options[8].Has_arg:=1;
Options[9].Name:='verbose';
OptIndex:=0; OptIndex:=0;
repeat repeat
c := GetLongOpts('help:arg:fpdoc:outfmt:showcmd:fpcdocs:footer:warnings:css-file', @Options[0], OptIndex); c := GetLongOpts('help arg: fpdoc: outfmt: showcmd fpcdocs: footer: warnings css-file verbose', @Options[0], OptIndex);
case c of case c of
#0: #0:
begin begin
@ -106,6 +109,7 @@ begin
6: fpdocfooter := OptArg; 6: fpdocfooter := OptArg;
7: WarningsCount:=0; 7: WarningsCount:=0;
8: CssFile := OptArg; 8: CssFile := OptArg;
9: inc(Verbosity);
else else
WriteLn('Unknown Value: ', OptIndex); WriteLn('Unknown Value: ', OptIndex);
end; end;
@ -214,6 +218,8 @@ var
I: Integer; I: Integer;
XMLFile: String; XMLFile: String;
begin begin
if Verbosity>0 then
writeln('PasSrcDir="',PasSrcDir,'"');
FileList := TStringList.Create; FileList := TStringList.Create;
InputList := TStringList.Create; InputList := TStringList.Create;
AddFilesToList(PasSrcDir, '.pas', FileList); AddFilesToList(PasSrcDir, '.pas', FileList);
@ -267,6 +273,8 @@ begin
Process.Options := Process.Options + [poWaitOnExit]; Process.Options := Process.Options + [poWaitOnExit];
Process.CurrentDirectory := WorkDir; Process.CurrentDirectory := WorkDir;
Process.CommandLine := CmdLine; Process.CommandLine := CmdLine;
if Verbosity>0 then
writeln('Command="',Process.CommandLine,'"');
try try
Process.Execute; Process.Execute;
except except
@ -285,7 +293,10 @@ end;
begin begin
ReadOptions; ReadOptions;
if Not DirectoryExistsUTF8(PackageName) then if Not DirectoryExistsUTF8(PackageName) then
begin
writeln('Creating directory "',PackageName,'"');
mkdir(PackageName); mkdir(PackageName);
end;
InitVars; InitVars;
MakeFileList; MakeFileList;
Run; Run;