Example #1
0
        public void fCancel()
        {
            if (oCurLaunch != null)
            {
                oCurLaunch.fEnd();
                //   Build.fDisableBuild();
                //   oCurLaunch = null;
                //   Data.EndExecution();
            }
            else if (Data.bNowBuilding)
            {
                Build.StopBuild();
            }
            else
            {
                //    fResetList();
                //  Data.StartBuild();
                //  Data.sCmd = "StartBuild";

                //Start Last Launch
                Delocalise.fDelocaliseInMainThread(Config.sLastRecentPath);
            }
        }
Example #2
0
        public static void StartBuild(bool _bShowInfo = true)
        {
            Data.bIWantGoToEnd = true;
            // fDebug("-------------StartBUILDDDD");
            Data.fClearData();

//bNothingToBuild = true;//asss
            //fSetWorkingDir();
            if (!Data.bNowBuilding)
            {
                Interlocked.Exchange(ref CppCompiler.safeInstanceCount, 0); //Can be negative value, TODO try to kill thread controlling safe instance?

                Data.aAllInclude.Clear();
                Data.aAll_ArgumentManager.Clear();
                Data.aAll_ArgumentManager.Add(Data.oCompilerArg);

                Data.bToolchainDefined = false;
                Data.bModuleIsRequired = false;
                Data.bNonBuildCommand  = false;
                Data.aRequiredModule.Clear();
                Data.aBrowser.Clear();

                CppCompiler.nError = 0;
                Data.oArg          = new ArgumentManager();
                Data.oArg.ExtractMainArgument(Data.sArgExpand, true);

                if (Data.bUpdateMode)
                {
                    UpdateCwc.fUpdateFiles(Data.sUpdateModeSrc);
                    return;
                }


                //  bNothingToBuild = true;//aasss



                if (Data.bNothingToBuild || Data.bNonBuildCommand)
                {
                    //if(bNothingToBuild) {
                    Data.bNothingToBuild = false;



                    /*
                     * if(!Data.bConsoleMode){
                     *  GuiManager.fCreateGUI();
                     * }*/

                    if (Data.sToLaunch != "")
                    {
                        Delocalise.fDelocaliseInMainThread(Data.sToLaunch);
                    }
                    else
                    {
                        Msg.fShowIntroMessage();
                    }
                    return;
                }


                /*
                 *              //  if(bInConsole && oMainForm == null && bGUI) {
                 *                 if( Data.oMainForm == null && Data.bGUI && !Data.bUpdateMode) {
                 *                              if(Data.sArgExpand.IndexOf('|') != -1 || Data.sArgExpand.IndexOf('>') != -1) { //Auto GUI mode
                 *                                       GuiManager.fCreateGUI();
                 *                              }
                 *                      }*/



                Data.oArg.fCompleteExtractMainArgument();



                if (Data.bModeIDE)
                {
                    Data.bDontExecute = true;                             //TODO only one
                }

                // Debug.fTrace("-------------BegfLoadModules " );
                if (!Data.bModuleIsRequired)
                {
                    //  fDebug("------RUNN ");
                    Data.oArg.fExtract();

                    Data.oArg.fRun(null, Data.bDontExecute);
                }
                else
                {
                    //fDebug("--fLoadModules ");
                    //     Empty.fLoadModules();
                }


                if (Data.oGuiConsole != null)
                {
                    Data.oGuiConsole.fAddAllUsedDir();
                }
                //  fDebug("-------------AftfLoadModules");

                /*
                 *                  if(!bDontExecute ) {
                 *                           oArg.fRun();
                 *                  }*/



                if (Data.bModeIDE)
                {
                    Data.oModeIDE.fFinishExtractArg();
                }



                if (Data.bNowBuilding && !Data.bDontExecute)
                {
                    // CppCompiler.CheckAllThreadsHaveFinishedWorking(true);

                    Build.fDisableBuild();
                    if (CppCompiler.nError == 0)
                    {
                        Data.oLaunchProject.fBuildFinish();
                    }
                }
                else
                {
                    Build.fDisableBuild();
                }
                Data.bDontExecute = false;


                if (Data.bModuleIsRequired)
                {
                    Empty.fLoadModules();
                }
            }
        }