1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Reordered postbuild commands to occur after all linking

This commit is contained in:
Brian Fiete 2021-02-08 17:46:22 -08:00
parent b0f69ae37d
commit bb2fe56dc9
2 changed files with 35 additions and 20 deletions

View file

@ -29,12 +29,8 @@ namespace IDE
public int32 mUpdateCnt;
public Project mHotProject;
public Workspace.Options mWorkspaceOptions;
public Dictionary<Project, String> mImpLibMap = new .() ~
{
for (let val in _.Values)
delete val;
delete _;
};
public Dictionary<Project, String> mImpLibMap = new .() ~ DeleteDictionaryAndValues!(_);
public Dictionary<Project, String> mTargetPathMap = new .() ~ DeleteDictionaryAndValues!(_);
public ScriptManager.Context mScriptContext = new .() ~ _.ReleaseLastRef();
public ScriptManager mScriptManager ~ delete _;
@ -1218,6 +1214,8 @@ namespace IDE
}
}
mTargetPathMap[project] = new String(targetPath);
if (hotProject == null)
{
switch (QueueProjectCustomBuildCommands(project, targetPath, compileKind.WantsRunAfter ? options.mBuildOptions.mBuildCommandsOnRun : options.mBuildOptions.mBuildCommandsOnCompile, options.mBuildOptions.mPreBuildCmds))
@ -1229,21 +1227,8 @@ namespace IDE
}
}
void DoPostBuild()
{
switch (QueueProjectCustomBuildCommands(project, targetPath, compileKind.WantsRunAfter ? options.mBuildOptions.mBuildCommandsOnRun : options.mBuildOptions.mBuildCommandsOnCompile, options.mBuildOptions.mPostBuildCmds))
{
case .NoCommands:
case .HadCommands:
case .Failed:
completedCompileCmd.mFailed = true;
}
}
if (project.mGeneralOptions.mTargetType == .CustomBuild)
{
if (hotProject == null)
DoPostBuild();
return true;
}
@ -1404,7 +1389,31 @@ namespace IDE
return false;
}
DoPostBuild();
return true;
}
public bool QueueProjectPostBuild(Project project, Project hotProject, IDEApp.BuildCompletedCmd completedCompileCmd, List<String> hotFileNames, CompileKind compileKind)
{
if (hotProject != null)
return true;
Project.Options options = gApp.GetCurProjectOptions(project);
if (options == null)
return true;
String targetPath = null;
mTargetPathMap.TryGetValue(project, out targetPath);
if (targetPath == null)
return false;
switch (QueueProjectCustomBuildCommands(project, targetPath, compileKind.WantsRunAfter ? options.mBuildOptions.mBuildCommandsOnRun : options.mBuildOptions.mBuildCommandsOnCompile, options.mBuildOptions.mPostBuildCmds))
{
case .NoCommands:
case .HadCommands:
case .Failed:
completedCompileCmd.mFailed = true;
}
return true;
}
}

View file

@ -10252,6 +10252,12 @@ namespace IDE
success = false;
}
for (var project in orderedProjectList)
{
if (!mBuildContext.QueueProjectPostBuild(project, hotProject, completedCompileCmd, hotFileNames, compileKind))
success = false;
}
if (hotFileNames.Count > 0)
{
// Why were we rehupping BEFORE hotLoad?