diff --git a/IDE/src/BuildContext.bf b/IDE/src/BuildContext.bf index 15c4fe20..211d5f3e 100644 --- a/IDE/src/BuildContext.bf +++ b/IDE/src/BuildContext.bf @@ -118,7 +118,7 @@ namespace IDE bool didCommands = false; - let targetName = scope String("Project ", project.mProjectName); + //let targetName = scope String("Project ", project.mProjectName); //Console.WriteLine("Executing custom command {0} {1} {2}", highestDateTime, targetDateTime, forceRebuild); for (let origCustomCmd in cmdList) @@ -159,19 +159,13 @@ namespace IDE didCommands = true; } - mScriptManager.QueueCommands(customCmd, scope String()..AppendF("project {}", project.mProjectName), .NoLines); + let scriptCmd = new IDEApp.ScriptCmd(); + scriptCmd.mCmd = new String(customCmd); + scriptCmd.mPath = new $"project {project.mProjectName}"; + gApp.mExecutionQueue.Add(scriptCmd); continue; } - let targetCompleteCmd = new IDEApp.TargetCompletedCmd(project); - if (didCommands) - { - mScriptManager.QueueCommands(scope String()..AppendF("%targetComplete {}", project.mProjectName), targetName, .NoLines); - targetCompleteCmd.mIsReady = false; - project.mNeedsTargetRebuild = true; - } - gApp.mExecutionQueue.Add(targetCompleteCmd); - return didCommands ? .HadCommands : .NoCommands; } diff --git a/IDE/src/IDEApp.bf b/IDE/src/IDEApp.bf index 6fa3a871..3ea4ef87 100644 --- a/IDE/src/IDEApp.bf +++ b/IDE/src/IDEApp.bf @@ -435,6 +435,12 @@ namespace IDE } } + public class ScriptCmd : ExecutionCmd + { + public String mCmd ~ delete _; + public String mPath ~ delete _; + } + public enum ArgsFileKind { None, @@ -8257,6 +8263,21 @@ namespace IDE } } + if (let scriptCmd = next as ScriptCmd) + { + if (mBuildContext?.mScriptManager != null) + { + if (scriptCmd.mCmd != null) + { + mBuildContext.mScriptManager.QueueCommands(scriptCmd.mCmd, scriptCmd.mPath, .NoLines); + DeleteAndNullify!(scriptCmd.mCmd); + } + + if (mBuildContext.mScriptManager.HasQueuedCommands) + return; + } + } + defer delete next; mExecutionQueue.RemoveAt(0); @@ -8412,6 +8433,11 @@ namespace IDE if (gApp.mDebugger.mIsRunning) mProfilePanel.StartProfiling(profileCmd.mThreadId, profileCmd.mDesc, profileCmd.mSampleRate); } + else if (var scriptCmd = next as ScriptCmd) + { + // Already handled + (void)scriptCmd; + } else { Runtime.FatalError("Unknown command"); diff --git a/IDE/src/ScriptManager.bf b/IDE/src/ScriptManager.bf index 0e1973f8..4c0bafe9 100644 --- a/IDE/src/ScriptManager.bf +++ b/IDE/src/ScriptManager.bf @@ -1007,7 +1007,7 @@ namespace IDE if (!gApp.[Friend]mExecutionQueue.IsEmpty) { var nextCmd = gApp.mExecutionQueue[0]; - if (!(nextCmd is IDEApp.TargetCompletedCmd)) + if (!(nextCmd is IDEApp.ScriptCmd)) return false; }