Ignore:
Timestamp:
Feb 19, 2012, 5:26:03 PM (12 years ago)
Author:
chronos
Message:
  • Added: New Java target.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Target/UTarget.pas

    r40 r41  
    7979    procedure SetSourceCode(AValue: string); virtual;
    8080    function GetTargetCode: string; virtual;
    81     procedure AddLine(Text: string);
     81    procedure AddLine(Text: string = '');
    8282    function LongFileName(FileName: string): string;
    8383    function GetExecutionPosition: Integer; virtual;
     
    8888    Optimization: TCompilerOptimization;
    8989    CompilerPath: string;
     90    ExecutorPath: string;
    9091    SourceExtension: string;
    9192    CompiledExtension: string;
     
    101102    procedure Compile; virtual;
    102103    procedure CompileToFile; virtual;
     104    procedure RunFromFile; virtual;
    103105    procedure Run; virtual;
    104106    procedure Pause; virtual;
     
    309311end;
    310312
    311 procedure TTarget.AddLine(Text: string);
     313procedure TTarget.AddLine(Text: string = '');
    312314begin
    313315  FTargetCode := FTargetCode + DupeString('  ', Indent) + Text + LineEnding;
     
    384386    Process.Free;
    385387  end else raise Exception.Create(Format(SCompilerNotFound, [CompilerPath]));
    386 
     388end;
     389
     390procedure TTarget.RunFromFile;
     391var
     392  Process: TProcess;
     393  CompiledFile: string;
     394begin
    387395  CompiledFile := ExtractFilePath(ProjectFileName) +
    388396    'compiled' + DirectorySeparator + Name + DirectorySeparator +
     
    391399  try
    392400    Process := TProcess.Create(nil);
    393     Process.CommandLine := LongFileName(CompiledFile);
     401    Process.CommandLine := LongFileName(ExecutorPath) + ' ' + LongFileName(CompiledFile);
    394402    Process.Options := [poWaitOnExit];
    395403    Process.Execute;
Note: See TracChangeset for help on using the changeset viewer.