Exemplo n.º 1
0
        private void GetProjects(string name, ref Dictionary <string, bool> projects, Config.Platform platform, Config.Configure configure, bool begin = true)
        {
            if (begin)
            {
                MapProjectsForList = new Dictionary <string, bool>();
            }

            if (!MapProjectsForList.ContainsKey(name))
            {
                if (!projects.ContainsKey(name))
                {
                    projects.Add(name, true);
                }
                MapProjectsForList.Add(name, true);

                var project = Config.Global.ProjectsMap[platform][configure][Config.Global.DevVersion][name];

                foreach (string i in project.Projects.Public)
                {
                    GetProjects(i, ref projects, platform, configure, false);
                }
                ;
                foreach (string i in project.Projects.Private)
                {
                    GetProjects(i, ref projects, platform, configure, false);
                }
                ;
                foreach (string i in project.IncludeAutonomousProjects)
                {
                    GetProjects(i, ref projects, platform, configure, false);
                }
            }
        }
Exemplo n.º 2
0
        private void RegisterProject(string name, Config.Platform platform, Config.Configure configure, bool source_code = true)
        {
            if (!MapProjects.ContainsKey(platform))
            {
                MapProjects[platform] = new Dictionary <Config.Configure, Dictionary <string, ProjectFileInfo> >();
            }

            if (!MapProjects[platform].ContainsKey(configure))
            {
                MapProjects[platform][configure] = new Dictionary <string, ProjectFileInfo>();
            }
            if (!MapProjects[platform][configure].ContainsKey(name))
            {
                ProjectFileInfo info = new ProjectFileInfo();
                PathFileInfo[name] = Config.Global.ProjectsCSFile[name];
                List <string> LIncludeFile = new List <string>();
                var           project      = Config.Global.ProjectsMap[platform][configure][Config.Global.DevVersion][name];
                project.StartBuild();
                info.ResourceFile = project.ResourceFile;
                foreach (string i in project.Include.Private)
                {
                    if (source_code)
                    {
                        string[] files = Directory.GetFiles(i, "*.h", SearchOption.AllDirectories);
                        foreach (string f in files)
                        {
                            if (!info.IncludeFile.ContainsKey(f))
                            {
                                info.IncludeFile.Add(f, true);
                            }
                        }
                        files = Directory.GetFiles(i, "*.hpp", SearchOption.AllDirectories);
                        foreach (string f in files)
                        {
                            if (!info.IncludeFile.ContainsKey(f))
                            {
                                info.IncludeFile.Add(f, true);
                            }
                        }
                    }
                }
                info.Include.Private.AddRange(project.Include.Private);
                info.Defines.Private.AddRange(project.Defines.Private);
                foreach (string i in project.Include.Public)
                {
                    if (source_code)
                    {
                        string[] files = Directory.GetFiles(i, "*.h", SearchOption.AllDirectories);
                        foreach (string f in files)
                        {
                            if (!info.IncludeFile.ContainsKey(f))
                            {
                                info.IncludeFile.Add(f, true);
                            }
                        }
                        files = Directory.GetFiles(i, "*.hpp", SearchOption.AllDirectories);
                        foreach (string f in files)
                        {
                            if (!info.IncludeFile.ContainsKey(f))
                            {
                                info.IncludeFile.Add(f, true);
                            }
                        }
                    }
                }
                info.Include.Public.AddRange(project.Include.Public);
                info.Defines.Public.AddRange(project.Defines.Public);
                foreach (string i in project.Projects.Public)
                {
                    RegisterProject(i, platform, configure, false);
                    info.Include.Append(MapProjects[platform][configure][i].Include);
                    info.Defines.Append(MapProjects[platform][configure][i].Defines);
                }
                ;
                foreach (string i in project.Projects.Private)
                {
                    RegisterProject(i, platform, configure, false);
                    info.Include.AppendInPrivate(MapProjects[platform][configure][i].Include);
                    info.Defines.AppendInPrivate(MapProjects[platform][configure][i].Defines);
                }
                ;


                foreach (string i in project.IncludeInProject.Public)
                {
                    info.Include.Append(Config.Global.ProjectsMap[platform][configure][Config.Global.DevVersion][i].Include);
                }
                ;
                foreach (string i in project.IncludeInProject.Private)
                {
                    info.Include.AppendInPrivate(Config.Global.ProjectsMap[platform][configure][Config.Global.DevVersion][i].Include);
                }
                ;

                Tools.BuildTools.SetGlobalDefines(info.Defines.Private, name.ToUpper(), PathFileInfo[name].IndexOf(".project.cs") != -1 ? BuildType.StaticLibrary : BuildType.Executable);
                if (source_code)
                {
                    info.SourceFile.AddRange(project.Sources);
                }
                if (!ProjectPath.ContainsKey(name))
                {
                    ProjectPath[name] = project.ProjectPath;
                }
                MapProjects[platform][configure].Add(name, info);
            }
        }