Exemple #1
0
        private bool RecursiveDependencyEval(JobManager jobManager, BuildFile bFile, string targetName)
        {
            var targetInst = bFile.Projects.Find(x => x.Name.Equals(targetName));

            if (targetInst == null)
            {
                DisplayUsage("Target [{0}] does not exist", targetName);
                return(false);
            }

            // check if we have already added an instance of the project to the worker list
            if (jobManager.ContainsWorkerData(targetInst))
            {
                return(true);
            }

            Log.InfoFormat("Adding {0} to worker list", targetInst.Name);
            jobManager.AddWorker(targetInst.Name, targetInst);

            if (_argParser.IsSwitchSet("nodeps"))
            {
                return(true);
            }

            foreach (var depName in targetInst.Dependencies)
            {
                var b = RecursiveDependencyEval(jobManager, bFile, depName);
                if (!b)
                {
                    return(false);
                }
            }

            return(true);
        }
Exemple #2
0
        private bool AllTargetsMode(string filename)
        {
            var pFile = BuildFileHandler.Load(filename);
            var m     = new JobManager();

            foreach (var p in pFile.Projects)
            {
                m.AddWorker(p.Name, p);
            }

            try
            {
                m.Execute();

                return(true);
            }
            catch (Exception e)
            {
                Log.Error("Building failed", e);

                return(false);
            }
        }