From f1c77a5c7b878ea6abf0886f12a0060a3f307360 Mon Sep 17 00:00:00 2001 From: mattias Date: Fri, 2 Jun 2017 17:49:46 +0000 Subject: [PATCH] docs: build_lcl_docs: updated, simulate shows both lazutils and lcl git-svn-id: branches/fixes_1_8@55160 - --- docs/html/build_lcl_docs.lpi | 5 +-- docs/html/build_lcl_docs.lpr | 61 ++++++++++++++++++++++-------------- 2 files changed, 38 insertions(+), 28 deletions(-) diff --git a/docs/html/build_lcl_docs.lpi b/docs/html/build_lcl_docs.lpi index aa2cd52ff9..f301737b0b 100644 --- a/docs/html/build_lcl_docs.lpi +++ b/docs/html/build_lcl_docs.lpi @@ -1,7 +1,7 @@ - + @@ -11,9 +11,6 @@ </General> - <VersionInfo> - <StringTable ProductVersion=""/> - </VersionInfo> <BuildModes Count="1"> <Item1 Name="default" Default="True"/> </BuildModes> diff --git a/docs/html/build_lcl_docs.lpr b/docs/html/build_lcl_docs.lpr index 6530994c12..fe662b1a51 100644 --- a/docs/html/build_lcl_docs.lpr +++ b/docs/html/build_lcl_docs.lpr @@ -71,7 +71,7 @@ type procedure SetXCTDir(AValue: string); procedure SetXMLSrcDir(AValue: string); public - Params: String; + Params: TStringList; ParseParams: string; constructor Create(aPackageName: string); destructor Destroy; override; @@ -273,7 +273,8 @@ begin OutDir:=PackageName; FPDocExe:=TrimFilename(DefaultFPDocExe); CSSFile:=DefaultCSSFile; - Params:=DefaultFPDocParams; + Params:=TStringList.Create; + SplitCmdLineParams(DefaultFPDocParams,Params); OutFormat:=DefaultOutFormat; FooterFilename:=DefaultFooterFilename; XCTDir:=DefaultXCTDir; @@ -289,7 +290,7 @@ end; procedure TFPDocRun.InitVars; var - Pkg, Prefix, IncludeDir: String; + Pkg, Prefix, IncludeDir, Param: String; p: Integer; begin if ord(Step)>=ord(frsVarsInitialized) then @@ -306,14 +307,14 @@ begin FXCTFile:=AppendPathDelim(OutDir)+PackageName+'.xct'; - Params += ' --content='+CreateRelativePath(XCTFile,OutDir) - + ' --package='+PackageName - + ' --descr='+CreateRelativePath(AppendPathDelim(XMLSrcDir)+PackageName+'.xml',OutDir) - + ' --format='+OutFormat; + Params.Add('--content='+CreateRelativePath(XCTFile,OutDir)); + Params.Add('--package='+PackageName); + Params.Add('--descr='+CreateRelativePath(AppendPathDelim(XMLSrcDir)+PackageName+'.xml',OutDir)); + Params.Add('--format='+OutFormat); if FilenameIsAbsolute(InputFile) then - Params += ' --input=@'+CreateRelativePath(InputFile,OutDir) + Params.Add('--input=@'+CreateRelativePath(InputFile,OutDir)) else - Params += ' --input=@'+InputFile; + Params.Add('--input=@'+InputFile); if XCTDir <> '' then begin @@ -328,22 +329,25 @@ begin Prefix:=''; GetEnvDef(Prefix, Prefix, UpperCase(Pkg)+'LINKPREFIX'); - Params+=' --import='+CreateRelativePath(AppendPathDelim(XCTDir)+LowerCase(Pkg)+'.xct',OutDir); + Param:='--import='+CreateRelativePath(AppendPathDelim(XCTDir)+LowerCase(Pkg)+'.xct',OutDir); if Prefix<>'' then - Params+=','+Prefix; + Param+=','+Prefix; + Params.Add(Param); end; end; if OutFormat='chm' then begin - Params+=' --output='+ ChangeFileExt(PackageName, '.chm') - +' --auto-toc --auto-index --make-searchable'; + Params.Add('--output='+ ChangeFileExt(PackageName, '.chm')); + Params.Add('--auto-toc'); + Params.Add('--auto-index'); + Params.Add('--make-searchable'); if CSSFile<>'' then - Params+=' --css-file='+ExtractFileName(CSSFile); // the css file is copied to the OutDir + Params.Add('--css-file='+ExtractFileName(CSSFile)); // the css file is copied to the OutDir end; if EnvParams<>'' then - Params += ' '+EnvParams; + SplitCmdLineParams(EnvParams,Params); if Verbosity>0 then begin @@ -354,8 +358,10 @@ begin writeln('FooterFilename=',FooterFilename); writeln('InputFile=',InputFile); writeln('OutDir=',OutDir); - writeln('ParseParams=',ParseParams); - writeln('FPDocParams=',Params); + writeln('ParseParams='); + writeln(ParseParams); + writeln('FPDocParams='); + writeln(Params.Text); writeln('----------------------------------'); end; @@ -410,7 +416,7 @@ begin if FileExistsUTF8(XMLFile) then begin InputList.Add(CreateRelativePath(FileList[I],OutDir) + ParseParams); - Params:=Params+' --descr='+CreateRelativePath(XMLFile,OutDir); + Params.Add('--descr='+CreateRelativePath(XMLFile,OutDir)); end else begin @@ -471,13 +477,12 @@ begin if ord(Step)<ord(frsOutDirCreated) then CreateOuputDir; - CmdLine := FPDocExe + Params; if ShowCmd then begin Writeln('WorkDirectory:',OutDir); - WriteLn(CmdLine); - writeln('Not executing, simulation ended. Stop'); - Halt(0); + WriteLn('Exe:',FPDocExe); + WriteLn(Params.Text); + exit; end; {$IFDEF MSWINDOWS}FPDocExe := ChangeFileExt(FPDocExe,'.exe');{$ENDIF} if not FileInEnvPATH(FPDocExe) then @@ -490,16 +495,20 @@ begin try Process.Options := Process.Options + [poWaitOnExit]; Process.CurrentDirectory := OutDir; - Process.CommandLine := CmdLine; + Process.Executable:=FPDocExe; + Process.Parameters.Assign(Params); + CmdLine:=Process.Executable+' '+MergeCmdLineParams(Params); if Verbosity>0 then - writeln('Command="',Process.CommandLine,'"'); + writeln('CmdLine: ',CmdLine); try Process.Execute; if Process.ExitCode<>0 then raise Exception.Create('fpdoc failed with code '+IntToStr(Process.ExitCode)); except if WarningsCount >= 0 then + begin WriteLn('Error running fpdoc, command line: '+CmdLine) + end else Dec(WarningsCount); end; @@ -545,6 +554,7 @@ end; procedure TFPDocRun.Execute; begin + writeln('==================================================================='); if ord(Step)>=ord(frsComplete) then raise Exception.Create('TFPDocRun.Execute not again'); if ord(Step)<ord(frsCopiedToXCTDir) then @@ -575,5 +585,8 @@ begin Run.IncludePath := Run.PasSrcDir+PathDelim+'include'; Run.Execute; Run.Free; + + if ShowCmd then + writeln('Not executing, simulation ended. Stop'); end.