Beispiel #1
0
        private void Fix(BuildData buildInfo, List <Module> modules, HashSet <string> processedFiles)
        {
            if (buildInfo.Target.IsFakeTarget())
            {
                throw new TargetNotFoundException(rootModuleName);
            }

            var vsParser = new VisualStudioProjectParser(buildInfo.Target, modules);

            foreach (var file in vsParser.GetCsprojList(buildInfo))
            {
                if (processedFiles.Contains(file))
                {
                    continue;
                }
                processedFiles.Add(file);
                fixReferenceResult.NotFound[file] = new List <string>();
                fixReferenceResult.Replaced[file] = new List <string>();
                var refs = vsParser.GetReferencesFromCsproj(file, buildInfo.Configuration, fixExternal);
                foreach (var r in refs)
                {
                    Fix(file, r);
                }
            }
        }
Beispiel #2
0
        private void Fix(BuildData buildInfo, List <Module> modules, HashSet <string> processedFiles)
        {
            if (buildInfo.Target == "None")
            {
                throw new CementException("Build target is not specified in module.yaml");
            }

            var vsParser = new VisualStudioProjectParser(buildInfo.Target, modules);

            foreach (var file in vsParser.GetCsprojList(buildInfo.Configuration))
            {
                if (processedFiles.Contains(file))
                {
                    continue;
                }
                processedFiles.Add(file);
                fixReferenceResult.NotFound[file] = new List <string>();
                fixReferenceResult.Replaced[file] = new List <string>();
                var refs = vsParser.GetReferencesFromCsproj(file, fixExternal);
                foreach (var r in refs)
                {
                    Fix(file, r);
                }
            }
        }
Beispiel #3
0
        private List <ProjectFile> GetCsprojFiles(string solutionPath)
        {
            var parser      = new VisualStudioProjectParser(solutionPath, Helper.GetModules());
            var csprojFiles = parser
                              .GetCsprojList()
                              .Select(csprojPath => new ProjectFile(csprojPath))
                              .ToList();

            return(csprojFiles);
        }
Beispiel #4
0
        public static List <string> GetCsprojsList(string moduleName)
        {
            if (!Exists(moduleName))
            {
                return(new List <string>());
            }

            var configs         = ConfigurationParser(moduleName).GetConfigurations();
            var buildsInfo      = configs.SelectMany(config => BuildParser(moduleName).Get(config));
            var files           = new List <string>();
            var moduleDirectory = Path.Combine(Helper.CurrentWorkspace, moduleName);

            var projects = buildsInfo.Select(info => info.Target)
                           .Where(t => t != "None").Distinct();

            foreach (var project in projects)
            {
                var vsParser = new VisualStudioProjectParser(
                    Path.Combine(moduleDirectory, project), Helper.GetModules());
                files.AddRange(vsParser.GetCsprojList());
            }

            return(files.Distinct().ToList());
        }