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(); } } }
static int Main(string[] args) { // redirect console output to parent process; // must be before any calls to Console.WriteLine() AttachConsole(ATTACH_PARENT_PROCESS); Sys.fGetParentProcess(); Console.WriteLine("Systeme mode: " + Sys.sParentName); if (Sys.sParentName == "cmd") { Data.bConsoleMode = true; } Data.fSetDefaultVar(args); Data.fCheckUpdate(); Data.fCreateConfigMng(); if (Data.bConsoleMode) { SysAPI.fStartConsole(); } if (!Data.bConsoleMode || SysAPI.bIsLoadedFromAnotherCwcInstance) { Data.bGUI = false; if (!Data.bModeIDE) { // Base.bAlive = false; //not work?? } } Data.fGetMainArg(); fCheckForRegistringFiles(); if (!Data.bConsoleMode) { GuiManager.fCreateGUI(); } if (Data.sArg == "") //No Argument { Output.Trace("\f0AVersion " + Data.sVersion + "\fs \n"); Msg.fShowIntroMessage(); SysAPI.fSetWorkingDir(PathHelper.ExeWorkDir); } else { Console.WriteLine("fBeginBuild "); Build.fBeginBuild(); } CppCompiler.CheckAllThreadsHaveFinishedWorking(true); Build.fDisableBuild(); if (Data.oGuiConsole != null) { if (!Data.oGuiConsole.fCheckForDemos()) { Program.fCheckForRegistringFiles(true); //Register if first use } } if (!Data.bConsoleMode) { if (Data.bModeIDE) { Base.bAlive = true; // PipeInput.fLaunchPipeInput(); } Build.fStartLoopTestingIdeLinkedClosing(); } Build.fMainLoop(); //if(Data.bConsoleMode) {SendKeys.SendWait("{ENTER}"); } return(0); }
public void fCompleteExtractMainArgument(ModuleData _oModule = null, bool _bShowInfo = true) { Build.fEnableBuild(); ///Check missing modules lib //if(Data.aCompilerData.Count == 0){ //} // fLibRtExist(); //fGZE_Exist(); if (Data.bModuleIsRequired || Data.bDontExecute) //Stop if we need more modules { Build.fDisableBuild(); return; } if (_bShowInfo) { if (_oModule == null) { Output.Trace("\f2A--Start Build--"); } else { // Output.Trace("\f27 - Build " + _oModule.sAutorName + " - " + _oModule.sCurrFolder + " - " ); Output.Trace("\f2B - Build " + _oModule.sAutorName + " - " + _oModule.sCurrFolder + " - "); } } ///////////////// Extract Compilers fExtractCompiler(); if (Data.bModuleIsRequired) //For compiler with "Require" Node //TODO recursive { if (!Empty.fLoadModules(false)) { Build.fDisableBuild(); return; } Data.bModuleIsRequired = false; Data.aRequiredModule.Clear(); // Empty.fLoadModules(false);//Reload after download, or look for bExtracting before fGetLastVersions fMergeCompiler(); } fExtractCompiler(); foreach (CompilerData _oLib in aLibList) //TODO separate subcompiler and extract after!? //Console.WriteLine("Extract Lib: " + _oLib.sFullName); { Debug.fTrace("Extract Lib: " + _oLib.sFullName); _oLib.fExtract(this); } ///////////////////////////// //Output.Trace("\f2A-Extracted--"); /* * foreach(CppSeq _oSeq in aCppSeq) { * sCurr_wTo = ""; * foreach(CppCmd _oCmd in _oSeq.aCppCmd) { * // _oCmd.fExtract(); * } * } */ ArgProcess.fFinishExtractArg(); }