Changeset 51 for trunk/IDE


Ignore:
Timestamp:
Apr 6, 2012, 9:43:56 AM (13 years ago)
Author:
chronos
Message:
  • Added: Project determines which source file is main program source.
Location:
trunk/IDE
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/IDE/Forms/UFormMain.pas

    r50 r51  
    250250      Compiler.SourceFiles.Clear;
    251251      Project.Files.DumpFileList(Compiler.SourceFiles);
     252      Compiler.MainSource := Project.MainSource.AbsoluteFileName;
    252253      TargetProject.FileName := ExtractFileDir(Project.FileName) + DirectorySeparator +
    253254        Compiler.CompiledFolder + DirectorySeparator + Compiler.Target.Name +
  • trunk/IDE/UProject.pas

    r50 r51  
    357357    NewNode := Doc.DocumentElement.FindNode('MainSource');
    358358    if Assigned(NewNode) then begin
    359       MainSourceName := UTF8Encode(NewNode.TextSource);
    360 
     359      MainSourceName := UTF8Encode(NewNode.TextContent);
     360      MainSource := Files.SearchFile(MainSourceName);
    361361    end;
    362362
     
    385385    with RootNode do begin
    386386      NewNode := CreateElement('MainSource');
    387       NewNode.TextContent := UTF8Decode(MainSource.FileName);
     387      if Assigned(MainSource) then
     388        NewNode.TextContent := UTF8Decode(MainSource.FileName);
    388389      AppendChild(NewNode);
    389390
     
    419420  Files.Clear;
    420421  Packages.Clear;
     422  MainSource := nil;
    421423end;
    422424
  • trunk/IDE/UProjectTemplates.pas

    r48 r51  
    6464    Add('end.');
    6565  end;
     66  Project.MainSource := NewFile;
    6667end;
    6768
     
    8889    Add('end.');
    8990  end;
     91  Project.MainSource := NewFile;
    9092end;
    9193
     
    118120    Add('end.');
    119121  end;
     122  Project.MainSource := NewFile;
    120123end;
    121124
     
    140143    Add('end.');
    141144  end;
     145  Project.MainSource := NewFile;
    142146end;
    143147
Note: See TracChangeset for help on using the changeset viewer.