diff --git a/BeefBuild/src/BuildApp.bf b/BeefBuild/src/BuildApp.bf index 0df817c0..d3962da7 100644 --- a/BeefBuild/src/BuildApp.bf +++ b/BeefBuild/src/BuildApp.bf @@ -14,6 +14,7 @@ namespace BeefBuild int mProgressIdx = 0; public bool mIsTest; public bool mIsFailTest; + public bool mDidRun; /*void Test() { @@ -40,13 +41,14 @@ namespace BeefBuild { //mConfigName.Clear(); //mPlatformName.Clear(); - mVerbosity = .Normal; - //Test(); } public override void Init() { + if (mVerbosity == .Default) + mVerbosity = .Normal; + if (mConfigName.IsEmpty) { mConfigName.Set(mIsTest ? "Test" : "Debug"); @@ -98,7 +100,7 @@ namespace BeefBuild { RunTests(false); } - else + else if (mVerb != .New) Compile(.Normal, null); } @@ -108,6 +110,14 @@ namespace BeefBuild { switch (key) { + case "-new": + mVerb = .New; + return true; + case "-run": + if (mVerbosity == .Default) + mVerbosity = .Minimal; + mVerb = .Run; + return true; case "-test": mIsTest = true; return true; @@ -209,7 +219,8 @@ namespace BeefBuild { base.BeefCompileDone(); WriteProgress(1.0f); - Console.WriteLine(""); + if (mVerbosity >= .Normal) + Console.WriteLine(""); } public override void LoadFailed() @@ -245,6 +256,25 @@ namespace BeefBuild if ((!IsCompiling) && (!AreTestsRunning())) { + if ((mVerb == .Run) && (!mDidRun)) + { + let curPath = scope String(); + Directory.GetCurrentDirectory(curPath); + + let workspaceOptions = gApp.GetCurWorkspaceOptions(); + let options = gApp.GetCurProjectOptions(mWorkspace.mStartupProject); + let targetPaths = scope List(); + defer ClearAndDeleteItems(targetPaths); + this.[Friend]GetTargetPaths(mWorkspace.mStartupProject, workspaceOptions, options, targetPaths); + if (targetPaths.IsEmpty) + return; + + ExecutionQueueCmd executionCmd = QueueRun(targetPaths[0], "", curPath); + executionCmd.mIsTargetRun = true; + mDidRun = true; + return; + } + Stop(); } } diff --git a/BeefBuild/src/Program.bf b/BeefBuild/src/Program.bf index 5066e673..b1b20a77 100644 --- a/BeefBuild/src/Program.bf +++ b/BeefBuild/src/Program.bf @@ -43,6 +43,8 @@ namespace BeefBuild } mApp.Shutdown(); int32 result = mApp.mFailed ? 1 : 0; + if (mApp.mTargetExitCode != null) + result = (int32)mApp.mTargetExitCode.Value; delete mApp; diff --git a/BeefLibs/corlib/src/TClass.bf b/BeefLibs/corlib/src/TClass.bf deleted file mode 100644 index b8cec58b..00000000 --- a/BeefLibs/corlib/src/TClass.bf +++ /dev/null @@ -1,43 +0,0 @@ - -namespace System -{ - class Poof - { - struct Whoop - { - - } - - public struct Inner - { - this() - { - - } - - Result Test() - { - return .Ok; - } - } - - struct Other - { - Result Pook() - { - return .Ok; - } - - } - - public static T GetDefault() - { - return default(T); - } - } -} - -static -{ - static int32 sCounterVal = 123; -} diff --git a/IDE/src/IDEApp.bf b/IDE/src/IDEApp.bf index f7a36914..3edc0f81 100644 --- a/IDE/src/IDEApp.bf +++ b/IDE/src/IDEApp.bf @@ -47,6 +47,7 @@ namespace IDE enum Verbosity { + Default, Quiet, Minimal, Normal, @@ -75,7 +76,8 @@ namespace IDE Open, New, OpenOrNew, - Test + Test, + Run } enum HotResolveState @@ -114,7 +116,7 @@ namespace IDE public static bool sExitTest; - public Verbosity mVerbosity = .Detailed; + public Verbosity mVerbosity = .Default; public BeefVerb mVerb; public bool mDbgCompileDump; public int mDbgCompileIdx = -1; @@ -122,6 +124,7 @@ namespace IDE public String mDbgVersionedCompileDir ~ delete _; public DateTime mDbgHighestTime; public bool mIsFirstRun; + public int? mTargetExitCode; public FileVersionInfo mVersionInfo ~ delete _; //public ToolboxPanel mToolboxPanel; @@ -403,7 +406,8 @@ namespace IDE public String mWorkingDir ~ delete _; public Dictionary mEnvVars ~ DeleteDictionyAndKeysAndItems!(_); public ArgsFileKind mUseArgsFile; - public int32 mParallelGroup = -1; + public int32 mParallelGroup = -1; + public bool mIsTargetRun; } public List mExecutionQueue = new List() ~ DeleteContainerAndItems!(_); @@ -426,6 +430,7 @@ namespace IDE public int? mExitCode; public bool mAutoDelete = true; public bool mCanceled; + public bool mIsTargetRun; public ~this() { @@ -2288,7 +2293,7 @@ namespace IDE Font.StrEncodePopColor(str); OutputLine(str);*/ - OutputLine("{0}Created new workspace in '{1}'{2}", Font.EncodeColor(0xfffef860), mWorkspace.mDir, Font.EncodePopColor()); + OutputWarnLine("Created new workspace in '{0}'", mWorkspace.mDir); if (wantSave) { SaveWorkspace(); @@ -2297,7 +2302,7 @@ namespace IDE else { mWorkspace.mNeedsCreate = true; - OutputLine("{0}Use 'File\\Save All' to commit to disk.{1}", Font.EncodeColor(0xfffef860), Font.EncodePopColor()); + OutputLine("Use 'File\\Save All' to commit to disk."); } } else @@ -6417,6 +6422,21 @@ namespace IDE OutputLineSmart(errStr, params args); } + public void OutputWarnLine(String format, params Object[] args) + { + var warnStr = scope String(); + warnStr.AppendF(format, params args); + +#if CLI + var outStr = warnStr; +#else + var outStr = scope String(); + outStr.AppendF("{0}{1}{2}", Font.EncodeColor(0xfffef860), warnStr, Font.EncodePopColor()); +#endif + + OutputLine(outStr); + } + public void OutputLineSmart(String format, params Object[] args) { String outStr; @@ -7154,16 +7174,23 @@ namespace IDE executionInstance.mProcess.Close(); executionInstance.mStopwatch.Stop(); - if (executionInstance.mParallelGroup == -1) - { - if (mVerbosity >= .Detailed) - OutputLine("Execution time: {0:0.00}s", executionInstance.mStopwatch.ElapsedMilliseconds / 1000.0f); + if (executionInstance.mIsTargetRun) + { + mTargetExitCode = executionInstance.mExitCode; } + else + { + if (executionInstance.mParallelGroup == -1) + { + if (mVerbosity >= .Detailed) + OutputLine("Execution time: {0:0.00}s", executionInstance.mStopwatch.ElapsedMilliseconds / 1000.0f); + } - if (executionInstance.mCanceled) - OutputLine("Execution Canceled"); - else if (failed) - OutputLine("Execution Failed"); + if (executionInstance.mCanceled) + OutputLine("Execution Canceled"); + else if (failed) + OutputLine("Execution Failed"); + } if (executionInstance.mTempFileName != null) { @@ -7342,6 +7369,7 @@ namespace IDE var executionQueueCmd = (ExecutionQueueCmd)next; var executionInstance = DoRun(executionQueueCmd.mFileName, executionQueueCmd.mArgs, executionQueueCmd.mWorkingDir, executionQueueCmd.mUseArgsFile, executionQueueCmd.mEnvVars); executionInstance.mParallelGroup = executionQueueCmd.mParallelGroup; + executionInstance.mIsTargetRun = executionQueueCmd.mIsTargetRun; } else if (next is BuildCompletedCmd) { @@ -9686,6 +9714,9 @@ namespace IDE { scope AutoBeefPerf("IDEApp.Init"); + if (mVerbosity == .Default) + mVerbosity = .Detailed; + mStartedWithTestScript = mRunningTestScript; mCommands.Init(); diff --git a/IDE/src/ui/SourceViewPanel.bf b/IDE/src/ui/SourceViewPanel.bf index 79c3c30f..6ae30237 100644 --- a/IDE/src/ui/SourceViewPanel.bf +++ b/IDE/src/ui/SourceViewPanel.bf @@ -5399,7 +5399,11 @@ namespace IDE.ui let result = mOldVerHTTPRequest.GetResult(); if (result != .NotDone) { + if (result == .Failed) + gApp.OutputErrorLine("Failed to retrieve source from {}", mOldVerLoadCmd); + RetryLoad(); + DeleteAndNullify!(mOldVerHTTPRequest); } } diff --git a/IDEHelper/DbgSymSrv.cpp b/IDEHelper/DbgSymSrv.cpp index 209d4f6b..3341f012 100644 --- a/IDEHelper/DbgSymSrv.cpp +++ b/IDEHelper/DbgSymSrv.cpp @@ -55,7 +55,7 @@ String DbgSymRequest::GetPDBStoreDir() checkPath += GetFileName(mPDBRequested); checkPath += "/"; checkPath += GetGuidString(); - checkPath += StrFormat("%X/", mWantAge); + checkPath += StrFormat("%x/", mWantAge); return checkPath; } diff --git a/IDEHelper/NetManager.cpp b/IDEHelper/NetManager.cpp index 9f893242..230d8a33 100644 --- a/IDEHelper/NetManager.cpp +++ b/IDEHelper/NetManager.cpp @@ -394,7 +394,7 @@ NetRequest::~NetRequest() mResult->mCurRequest = NULL; if (mResult->mDoneEvent != NULL) { - mResult->mDoneEvent->Set(); + mResult->mDoneEvent->Set(true); BF_ASSERT(!mResult->mRemoved); } if (mResult->mRemoved) diff --git a/IDEHelper/WinDebugger.cpp b/IDEHelper/WinDebugger.cpp index 016f3300..2fc1477b 100644 --- a/IDEHelper/WinDebugger.cpp +++ b/IDEHelper/WinDebugger.cpp @@ -1431,8 +1431,18 @@ bool WinDebugger::DoUpdate() } if (IsMiniDumpDebugger()) - { - Sleep(20); + { + // + { + AutoCrit autoCrit(mDebugManager->mCritSect); + if (mRunState == RunState_Terminating) + { + mRunState = RunState_Terminated; + return false; + } + } + + Sleep(20); return false; }