mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 13:39:25 +02:00
IDE: setting up codetools before adding units to a new project
git-svn-id: trunk@19840 -
This commit is contained in:
parent
9544e1cffa
commit
a1ddc5a97b
22
ide/main.pp
22
ide/main.pp
@ -8416,21 +8416,29 @@ begin
|
||||
// add and load default required packages
|
||||
PkgBoss.AddDefaultDependencies(Project1);
|
||||
|
||||
if ProjectDesc.CreateStartFiles(Project1)<>mrOk then begin
|
||||
debugln('TMainIDE.DoNewProject ProjectDesc.CreateStartFiles failed');
|
||||
end;
|
||||
|
||||
// rebuild codetools defines
|
||||
MainBuildBoss.RescanCompilerDefines(true,true);
|
||||
|
||||
if not Project1.Resources.Regenerate(Project1.MainFilename, True, False) then
|
||||
DebugLn('TMainIDE.DoNewProject Project1.Resources.Regenerate failed');
|
||||
|
||||
// (i.e. remove old project specific things and create new)
|
||||
IncreaseCompilerParseStamp;
|
||||
Project1.DefineTemplates.AllChanged;
|
||||
Project1.DefineTemplates.Active:=true;
|
||||
DebugBoss.Reset;
|
||||
|
||||
finally
|
||||
Project1.EndUpdate;
|
||||
end;
|
||||
|
||||
Project1.BeginUpdate(true);
|
||||
try
|
||||
// create files
|
||||
if ProjectDesc.CreateStartFiles(Project1)<>mrOk then begin
|
||||
debugln('TMainIDE.DoNewProject ProjectDesc.CreateStartFiles failed');
|
||||
end;
|
||||
|
||||
// init resource files
|
||||
if not Project1.Resources.Regenerate(Project1.MainFilename, True, False) then
|
||||
DebugLn('TMainIDE.DoNewProject Project1.Resources.Regenerate failed');
|
||||
finally
|
||||
Project1.EndUpdate;
|
||||
end;
|
||||
|
@ -2597,7 +2597,7 @@ begin
|
||||
ShortUnitName:=AnUnit.UnitName;
|
||||
if (ShortUnitName<>'') and (not UnitIsUsed(ShortUnitName)) then begin
|
||||
CodeToolBoss.AddUnitToMainUsesSection(MainUnitInfo.Source,
|
||||
ShortUnitName,'');
|
||||
ShortUnitName,'',true);
|
||||
end;
|
||||
end;
|
||||
EndUpdate;
|
||||
|
Loading…
Reference in New Issue
Block a user