Changeset 60 for trunk/Target
- Timestamp:
- Dec 3, 2014, 10:45:24 PM (10 years ago)
- Location:
- trunk/Target
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Target/UTarget.pas
r58 r60 69 69 cmOutput, cmInput, cmLoopStart, cmLoopEnd, cmDebug); 70 70 71 TLogEvent = procedure (Lines: TStrings) of object; 72 71 73 { TTarget } 72 74 73 75 TTarget = class 76 private 77 FOnLog: TLogEvent; 74 78 protected 75 79 FCompiled: Boolean; … … 101 105 ExecutorPath: string; 102 106 SourceExtension: string; 107 RunExtension: string; 103 108 CompiledExtension: string; 104 109 ProjectFileName: string; … … 124 129 procedure SaveToRegistry(Root: HKEY; Key: string); virtual; 125 130 property State: TRunState read FState write SetState; 126 property OnChangeState: TNotifyEvent read FOnChangeState write FOnChangeState;127 131 property SourceCode: string write SetSourceCode; 128 132 property TargetCode: string read GetTargetCode; … … 130 134 property ExecutionPosition: Integer read GetExecutionPosition; 131 135 property ProgramIndex: Integer read FProgramIndex; 136 property OnChangeState: TNotifyEvent read FOnChangeState write FOnChangeState; 137 property OnLog: TLogEvent read FOnLog write FOnLog; 132 138 end; 133 139 … … 396 402 Process: TProcess; 397 403 CompiledFile: string; 404 Lines: TStringList; 405 I: Integer; 398 406 begin 399 407 CompiledFile := ExtractFilePath(ProjectFileName) + … … 412 420 try 413 421 Process := TProcess.Create(nil); 414 Process.CurrentDirectory := ExtractFilePath(CompilerPath); 415 Process.CommandLine := LongFileName(CompilerPath) + ' ' + LongFileName(CompiledFile); 416 Process.Options := [poWaitOnExit]; 422 Process.CurrentDirectory := ExtractFilePath(CompiledFile); 423 Process.Executable := LongFileName(CompilerPath); 424 Process.Parameters.Add(LongFileName(CompiledFile)); 425 for I := 0 to GetEnvironmentVariableCount - 1 do 426 Process.Environment.Add(GetEnvironmentString(I)); 427 Process.Options := [poWaitOnExit, poUsePipes]; 417 428 Process.Execute; 429 if Assigned(FOnLog) then begin 430 Lines := TStringList.Create; 431 Lines.LoadFromStream(Process.Output); 432 Lines.Insert(0, Process.Executable + ' ' + Process.Parameters.Text); 433 FOnLog(Lines); 434 Lines.Free; 435 end; 418 436 finally 419 437 Process.Free; … … 426 444 Process: TProcess; 427 445 CompiledFile: string; 446 RunFile: string; 428 447 begin 429 448 CompiledFile := ExtractFilePath(ProjectFileName) + 430 449 'compiled' + DirectorySeparator + Name + DirectorySeparator + 431 450 ExtractFileNameOnly(ProjectFileName) + CompiledExtension; 451 RunFile := ExtractFilePath(ProjectFileName) + 452 'compiled' + DirectorySeparator + Name + DirectorySeparator + 453 ExtractFileNameOnly(ProjectFileName) + RunExtension; 432 454 if FileExistsUTF8(CompiledFile) then 433 455 try 434 456 Process := TProcess.Create(nil); 435 if ExecutorPath <> '' then Process.CommandLine := LongFileName(ExecutorPath) + ' '; 436 Process.CommandLine := Process.CommandLine + LongFileName(CompiledFile); 437 Process.Options := [poWaitOnExit]; 457 if ExecutorPath <> '' then begin 458 Process.Executable := LongFileName(ExecutorPath); 459 Process.Parameters.Add(LongFileName(RunFile)); 460 end else Process.Executable := LongFileName(RunFile); 461 Process.ShowWindow := swoShow; 462 Process.Options := [poWaitOnExit, poNewConsole]; 438 463 Process.Execute; 439 464 finally -
trunk/Target/UTargetC.pas
r52 r60 31 31 Name := 'C'; 32 32 SourceExtension := '.c'; 33 CompiledExtension := '.exe';34 33 ImageIndex := 23; 35 34 Capabilities := [tcCompile, tcRun]; 36 35 {$IFDEF Windows} 37 36 CompilerPath := 'c:\Program Files\MinGW\bin\gcc.exe'; 37 CompiledExtension := '.exe'; 38 RunExtension := ''; 38 39 {$ENDIF} 39 40 {$IFDEF Linux} 40 41 CompilerPath := '/usr/bin/gcc'; 42 CompiledExtension := ''; 43 RunExtension := ''; 41 44 {$ENDIF} 42 45 end; -
trunk/Target/UTargetDelphi.pas
r52 r60 30 30 SourceExtension := '.pas'; 31 31 ImageIndex := 22; 32 CompiledExtension := '.exe';33 32 Capabilities := [tcCompile, tcRun]; 34 33 {$IFDEF Windows} 35 34 CompilerPath := 'c:\Program Files\Embarcadero\RAD Studio\9.0\bin\DCC32.EXE'; 35 CompiledExtension := '.exe'; 36 RunExtension := ''; 36 37 {$ENDIF} 37 38 end; -
trunk/Target/UTargetJava.pas
r52 r60 31 31 SourceExtension := '.java'; 32 32 CompiledExtension := '.class'; 33 RunExtension := ''; 33 34 ImageIndex := 24; 34 35 Capabilities := [tcCompile, tcRun]; -
trunk/Target/UTargetPHP.pas
r59 r60 30 30 Name := 'PHP'; 31 31 SourceExtension := '.php'; 32 RunExtension := '.php'; 33 CompiledExtension := '.php'; 32 34 ImageIndex := 21; 33 35 Capabilities := [tcCompile, tcRun];
Note:
See TracChangeset
for help on using the changeset viewer.