mirror of
				https://gitlab.com/freepascal.org/lazarus/lazarus.git
				synced 2025-11-04 11:24:40 +01:00 
			
		
		
		
	chmhelp: migration to external tools
git-svn-id: trunk@45114 -
This commit is contained in:
		
							parent
							
								
									bc15322505
								
							
						
					
					
						commit
						c7485a4696
					
				@ -17,6 +17,7 @@
 | 
				
			|||||||
        <CompilerMessages>
 | 
					        <CompilerMessages>
 | 
				
			||||||
          <UseMsgFile Value="True"/>
 | 
					          <UseMsgFile Value="True"/>
 | 
				
			||||||
        </CompilerMessages>
 | 
					        </CompilerMessages>
 | 
				
			||||||
 | 
					        <CustomOptions Value="$(IDEBuildOptions)"/>
 | 
				
			||||||
        <CompilerPath Value="$(CompPath)"/>
 | 
					        <CompilerPath Value="$(CompPath)"/>
 | 
				
			||||||
      </Other>
 | 
					      </Other>
 | 
				
			||||||
    </CompilerOptions>
 | 
					    </CompilerOptions>
 | 
				
			||||||
 | 
				
			|||||||
@ -27,8 +27,11 @@ interface
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
uses
 | 
					uses
 | 
				
			||||||
  Classes, SysUtils, FileUtil, LazLogger, LazFileUtils, LazHelpIntf, HelpIntfs,
 | 
					  Classes, SysUtils, FileUtil, LazLogger, LazFileUtils, LazHelpIntf, HelpIntfs,
 | 
				
			||||||
  LazConfigStorage, PropEdits, LazIDEIntf, IDEDialogs, LHelpControl, Controls,
 | 
					  LazConfigStorage, PropEdits, LazIDEIntf, IDEDialogs,
 | 
				
			||||||
  UTF8Process, ChmLangRef, ChmLcl, ChmProg;
 | 
					  {$IFDEF EnableNewExtTools}
 | 
				
			||||||
 | 
					  IDEExternToolIntf,
 | 
				
			||||||
 | 
					  {$ENDIF}
 | 
				
			||||||
 | 
					  LHelpControl, Controls, UTF8Process, ChmLangRef, ChmLcl, ChmProg;
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
resourcestring
 | 
					resourcestring
 | 
				
			||||||
  HELP_CURRENT_MENU  = '&Help';
 | 
					  HELP_CURRENT_MENU  = '&Help';
 | 
				
			||||||
@ -245,16 +248,20 @@ end;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
function TChmHelpViewer.CheckBuildLHelp: Integer;
 | 
					function TChmHelpViewer.CheckBuildLHelp: Integer;
 | 
				
			||||||
var
 | 
					var
 | 
				
			||||||
  Proc: TProcessUTF8;
 | 
					 | 
				
			||||||
  Lazbuild: String;
 | 
					  Lazbuild: String;
 | 
				
			||||||
  LHelpProject: String;
 | 
					  LHelpProject: String;
 | 
				
			||||||
 | 
					  LHelpProjectDir: String;
 | 
				
			||||||
  WS: String;
 | 
					  WS: String;
 | 
				
			||||||
  LastWasEOL: Boolean;
 | 
					  PCP: String;
 | 
				
			||||||
  BufC: Char;
 | 
					  {$IFDEF EnableNewExtTools}
 | 
				
			||||||
 | 
					  Tool: TIDEExternalToolOptions;
 | 
				
			||||||
 | 
					  {$ELSE}
 | 
				
			||||||
 | 
					  Proc: TProcessUTF8;
 | 
				
			||||||
  Buffer: array[0..511] of char;
 | 
					  Buffer: array[0..511] of char;
 | 
				
			||||||
  BufP: Integer;
 | 
					  BufP: Integer;
 | 
				
			||||||
  PCP: String;
 | 
					  BufC: Char;
 | 
				
			||||||
  LHelpProjectDir: String;
 | 
					  LastWasEOL: Boolean;
 | 
				
			||||||
 | 
					  {$ENDIF}
 | 
				
			||||||
begin
 | 
					begin
 | 
				
			||||||
  Result := mrCancel;
 | 
					  Result := mrCancel;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -275,6 +282,7 @@ begin
 | 
				
			|||||||
    debugln(['TChmHelpViewer.CheckBuildLHelp failed because lhelp.lpi not found']);
 | 
					    debugln(['TChmHelpViewer.CheckBuildLHelp failed because lhelp.lpi not found']);
 | 
				
			||||||
    Exit;
 | 
					    Exit;
 | 
				
			||||||
  end;
 | 
					  end;
 | 
				
			||||||
 | 
					  LHelpProjectDir := ExtractFilePath(LHelpProject);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  WS := '--ws='+LCLPlatformDirNames[WidgetSet.LCLPlatform];
 | 
					  WS := '--ws='+LCLPlatformDirNames[WidgetSet.LCLPlatform];
 | 
				
			||||||
  PCP := '--pcp='+LazarusIDE.GetPrimaryConfigPath;
 | 
					  PCP := '--pcp='+LazarusIDE.GetPrimaryConfigPath;
 | 
				
			||||||
@ -283,6 +291,22 @@ begin
 | 
				
			|||||||
  //if Result <> mrYes then
 | 
					  //if Result <> mrYes then
 | 
				
			||||||
  //  Exit;
 | 
					  //  Exit;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  {$IFDEF EnableNewExtTools}
 | 
				
			||||||
 | 
					  Tool:=TIDEExternalToolOptions.Create;
 | 
				
			||||||
 | 
					  try
 | 
				
			||||||
 | 
					    Tool.Title:='- Building lhelp -';
 | 
				
			||||||
 | 
					    Tool.WorkingDirectory:=LHelpProjectDir;
 | 
				
			||||||
 | 
					    Tool.Executable:=Lazbuild;
 | 
				
			||||||
 | 
					    Tool.CmdLineParams:=QuotedStr(WS)+' '+QuotedStr(PCP)+' '+QuotedStr(LHelpProject);
 | 
				
			||||||
 | 
					    Tool.Scanners.Add(SubToolFPC);
 | 
				
			||||||
 | 
					    Tool.Scanners.Add(SubToolMake);
 | 
				
			||||||
 | 
					    if RunExternalTool(Tool) then
 | 
				
			||||||
 | 
					      Result:=mrOk;
 | 
				
			||||||
 | 
					  finally
 | 
				
			||||||
 | 
					    Tool.Free;
 | 
				
			||||||
 | 
					  end;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  {$ELSE}
 | 
				
			||||||
  Proc := TProcessUTF8.Create(nil);
 | 
					  Proc := TProcessUTF8.Create(nil);
 | 
				
			||||||
  {$if FPC_FULLVERSION<20604}
 | 
					  {$if FPC_FULLVERSION<20604}
 | 
				
			||||||
  Proc.InheritHandles := false;
 | 
					  Proc.InheritHandles := false;
 | 
				
			||||||
@ -306,7 +330,6 @@ begin
 | 
				
			|||||||
  IDEMessagesWindow.BeginBlock;
 | 
					  IDEMessagesWindow.BeginBlock;
 | 
				
			||||||
  IDEMessagesWindow.AddMsg('- Building lhelp -','',0);
 | 
					  IDEMessagesWindow.AddMsg('- Building lhelp -','',0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  LHelpProjectDir := ExtractFilePath(LHelpProject);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  while Proc.Running do begin
 | 
					  while Proc.Running do begin
 | 
				
			||||||
    while Proc.Output.NumBytesAvailable > 0 do
 | 
					    while Proc.Output.NumBytesAvailable > 0 do
 | 
				
			||||||
@ -351,7 +374,8 @@ begin
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  IDEMessagesWindow.EndBlock;
 | 
					  IDEMessagesWindow.EndBlock;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if Result = mrOK then
 | 
					  if Result = mrOK then ;
 | 
				
			||||||
 | 
					  {$ENDIF}
 | 
				
			||||||
end;
 | 
					end;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function TChmHelpViewer.GetLazBuildEXE(out ALazBuild: String): Boolean;
 | 
					function TChmHelpViewer.GetLazBuildEXE(out ALazBuild: String): Boolean;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user