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 int32 mUpdateCnt;
public Project mHotProject; public Project mHotProject;
public Workspace.Options mWorkspaceOptions; public Workspace.Options mWorkspaceOptions;
public Dictionary<Project, String> mImpLibMap = new .() ~ public Dictionary<Project, String> mImpLibMap = new .() ~ DeleteDictionaryAndValues!(_);
{ public Dictionary<Project, String> mTargetPathMap = new .() ~ DeleteDictionaryAndValues!(_);
for (let val in _.Values)
delete val;
delete _;
};
public ScriptManager.Context mScriptContext = new .() ~ _.ReleaseLastRef(); public ScriptManager.Context mScriptContext = new .() ~ _.ReleaseLastRef();
public ScriptManager mScriptManager ~ delete _; public ScriptManager mScriptManager ~ delete _;
@ -1218,6 +1214,8 @@ namespace IDE
} }
} }
mTargetPathMap[project] = new String(targetPath);
if (hotProject == null) if (hotProject == null)
{ {
switch (QueueProjectCustomBuildCommands(project, targetPath, compileKind.WantsRunAfter ? options.mBuildOptions.mBuildCommandsOnRun : options.mBuildOptions.mBuildCommandsOnCompile, options.mBuildOptions.mPreBuildCmds)) switch (QueueProjectCustomBuildCommands(project, targetPath, compileKind.WantsRunAfter ? options.mBuildOptions.mBuildCommandsOnRun : options.mBuildOptions.mBuildCommandsOnCompile, options.mBuildOptions.mPreBuildCmds))
@ -1228,22 +1226,9 @@ namespace IDE
completedCompileCmd.mFailed = true; completedCompileCmd.mFailed = true;
} }
} }
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 (project.mGeneralOptions.mTargetType == .CustomBuild)
{ {
if (hotProject == null)
DoPostBuild();
return true; return true;
} }
@ -1404,8 +1389,32 @@ namespace IDE
return false; return false;
} }
DoPostBuild();
return true; 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; success = false;
} }
for (var project in orderedProjectList)
{
if (!mBuildContext.QueueProjectPostBuild(project, hotProject, completedCompileCmd, hotFileNames, compileKind))
success = false;
}
if (hotFileNames.Count > 0) if (hotFileNames.Count > 0)
{ {
// Why were we rehupping BEFORE hotLoad? // Why were we rehupping BEFORE hotLoad?