Example #1
0
        internal void fRun(ModuleData _oModule = null, bool _bDontExecute = false, bool _bShowInfo = true, bool _bSilent = false)
        {
            bFinalised = false;
            if (!_bDontExecute)
            {
                aExeWaitingList = new List <LaunchTool>();
                fDeletOutput();


                wBuildTime = new Stopwatch();
                wBuildTime.Start();


                //     if(Data.oMainForm != null) {
                Data.oLaunchProject.fSetOutput(aLinkCmdList, sCurr_wTo);
                //    }

                if (!Data.bNowBuilding)
                {
                    return;
                }

                //TODO test if we really use libt

//			    Output.Trace("\f9B>> \f97 " + sAllArg);
            }

            int i = 0;

            foreach (CppSeq _oSeq in aCppSeq)
            {
                i++;

                if (!_bSilent)
                {
                    Output.Trace("\f1B> \f13" + _oSeq.sSeq);
                    //   Output.Trace("\f1B> \f13 " + CppCmd.fExtractVar( _oSeq.sSeq,null) ); //Todo preextract var?
                }
                sCurr_wTo = "";


                foreach (CppCmd _oCmd in _oSeq.aCppCmd)
                {
                    sCurr_wTo = "";
                    _oCmd.fExtract();
                    //	 _oCmd.fExecute();

                    if (!Data.bNowBuilding)
                    {
                        return;
                    }
                    if (CppCompiler.nError > 0)
                    {
                        break;
                    }
                }

                if (i == aCppSeq.Count)  //Only last one?
                {
                    fFinalize();
                }

                if (!_bDontExecute)
                {
                    CppCompiler.CheckAllThreadsHaveFinishedWorking(true);
                    foreach (CppCmd _oCmd in _oSeq.aCppCmd)
                    {
                        _oCmd.fExecute();

                        if (!Data.bNowBuilding)
                        {
                            fShowInfo(_oModule, !_bSilent);
                            return;
                        }
                        if (CppCompiler.nError > 0)
                        {
                            break;
                        }
                        // Thread.Sleep(1);
                    }

                    //  if(Data.oMainForm != null) { //TODO better way?
                    //			 Data.oLaunchProject.fSetOutput(aLinkCmdList,sCurr_wTo);
                    //	}

                    CppCompiler.CheckAllThreadsHaveFinishedWorking(true);
                    fWaitForWaitingList();



                    foreach (CppCmd _oCmd in _oSeq.aCppCmd)
                    {
                        _oCmd.fFinish();
                        if (!Data.bNowBuilding)
                        {
                            fShowInfo(_oModule, !_bSilent);
                            return;
                        }
                        if (CppCompiler.nError > 0)
                        {
                            break;
                        }
                    }

                    Data.oLaunchProject.fSetOutput(aLinkCmdList, sCurr_wTo);

                    if (!Data.bNowBuilding)
                    {
                        fShowInfo(_oModule, !_bSilent);
                        return;
                    }
                    if (CppCompiler.nError > 0)
                    {
                        break;
                    }
                }
            }

            if (_bDontExecute)
            {
                fShowInfo(_oModule, !_bSilent);
                return;
            }

            ///Finalize compiler commands
            ///



            fShowInfo(_oModule, _bShowInfo);
        }
Example #2
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();
        }