Exemplo n.º 1
0
        public static String BuildVcxprojString(ProjectStruct inProject)
        {
            ProjLibrary.BeginXmlEdition();
            ProjLibrary.BeginXmlCategory("Project", "DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\"");
            {
                AddConfigurations();
                SetProjectConfigs(inProject);
                ProjLibrary.AddXmlValue("Import", "", "Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\"");
                SetConfigurationParameters(inProject);
                ProjLibrary.AddXmlValue("Import", "", "Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\"");
                ImportLabels();
                SetPropertyPath(inProject);
                SetCompilationValues(inProject);
                IncludeSourceFiles(inProject);
                ProjLibrary.AddXmlValue("Import", "", "Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\"");
                ProjLibrary.AddXmlValue("ImportGroup", "", "Label=\"ExtensionTargets\"");
            }
            ProjLibrary.EndXmlCategory("Project");

            return(ProjLibrary.GetXmlString());
        }
Exemplo n.º 2
0
        public static String BuildUserFileString(ProjectStruct inProject)
        {
            SolutionStruct solutionData = SolutionAnalyzer.Get().solutionData;

            ProjLibrary.BeginXmlEdition();
            ProjLibrary.BeginXmlCategory("Project", "ToolsVersion=\"Current\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\"");
            {
                for (int i = 0; i < 4; ++i)
                {
                    String Configuration = (i > 1) ? "Debug" : "Release";
                    String Plateform     = (i % 2 == 0) ? "Win32" : "x64";

                    ProjLibrary.BeginXmlCategory("PropertyGroup", "Condition=\"'$(Configuration)|$(Platform)'=='" + Configuration + "|" + Plateform + "'\" Label=\"Configuration\"");
                    {
                        ProjLibrary.AddXmlValue("LocalDebuggerWorkingDirectory", "$(SolutionDir)" + solutionData.ExecutableOutputFolder + "\\" + Configuration + "\\" + Plateform + "\\" + inProject.ProjectName + "\\");
                        ProjLibrary.AddXmlValue("DebuggerFlavor", "WindowsLocalDebugger");
                    }
                    ProjLibrary.EndXmlCategory("PropertyGroup");
                }
            }
            ProjLibrary.EndXmlCategory("Project");
            return(ProjLibrary.GetXmlString());
        }
Exemplo n.º 3
0
        public static String BuildFilterString(ProjectStruct inProject)
        {
            List <String> Paths = new List <String>();

            ProjLibrary.BeginXmlEdition();
            ProjLibrary.BeginXmlCategory("Project", "DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\"");
            {
                ProjLibrary.BeginXmlCategory("ItemGroup");
                {
                    foreach (String file in ProjLibrary.GetFilesInDirectory(Path.GetDirectoryName(inProject.ProjectFileAbsolutePath), ".h"))
                    {
                        String relativePath = Path.GetRelativePath(Path.GetDirectoryName(inProject.ProjectFileAbsolutePath), file);
                        ProjLibrary.BeginXmlCategory("ClInclude", "Include=" + "\"" + relativePath + "\"");
                        {
                            AddUniquePath(Path.GetDirectoryName(relativePath), ref Paths);
                            ProjLibrary.AddXmlValue("Filter", Path.GetDirectoryName(relativePath));
                        }
                        ProjLibrary.EndXmlCategory("ClInclude");
                    }
                }
                ProjLibrary.EndXmlCategory("ItemGroup");
                ProjLibrary.BeginXmlCategory("ItemGroup");
                {
                    foreach (String file in ProjLibrary.GetFilesInDirectory(Path.GetDirectoryName(inProject.ProjectFileAbsolutePath), ".cpp"))
                    {
                        String relativePath = Path.GetRelativePath(Path.GetDirectoryName(inProject.ProjectFileAbsolutePath), file);
                        ProjLibrary.BeginXmlCategory("ClCompile", "Include=" + "\"" + relativePath + "\"");
                        {
                            AddUniquePath(Path.GetDirectoryName(relativePath), ref Paths);
                            ProjLibrary.AddXmlValue("Filter", Path.GetDirectoryName(relativePath));
                        }
                        ProjLibrary.EndXmlCategory("ClCompile");
                    }
                }
                ProjLibrary.EndXmlCategory("ItemGroup");
                ProjLibrary.BeginXmlCategory("ItemGroup");
                {
                    foreach (String file in ProjLibrary.GetFilesInDirectory(Path.GetDirectoryName(inProject.ProjectFileAbsolutePath), ".c"))
                    {
                        String relativePath = Path.GetRelativePath(Path.GetDirectoryName(inProject.ProjectFileAbsolutePath), file);
                        ProjLibrary.BeginXmlCategory("ClCompile", "Include=" + "\"" + relativePath + "\"");
                        {
                            AddUniquePath(Path.GetDirectoryName(relativePath), ref Paths);
                            ProjLibrary.AddXmlValue("Filter", Path.GetDirectoryName(relativePath));
                        }
                        ProjLibrary.EndXmlCategory("ClCompile");
                    }
                }
                ProjLibrary.EndXmlCategory("ItemGroup");

                foreach (String dir in ProjLibrary.GetSubfoldersInDirectory(Path.GetDirectoryName(inProject.ProjectFileAbsolutePath)))
                {
                    AddUniquePath(Path.GetDirectoryName(Path.GetRelativePath(Path.GetDirectoryName(inProject.ProjectFileAbsolutePath), dir)), ref Paths);
                }

                ProjLibrary.BeginXmlCategory("ItemGroup");
                {
                    foreach (String path in Paths)
                    {
                        ProjLibrary.BeginXmlCategory("Filter", "Include=" + "\"" + path + "\"");
                        {
                            ProjLibrary.AddXmlValue("UniqueIdentifier", "{" + path + "}");
                        }
                        ProjLibrary.EndXmlCategory("Filter");
                    }
                }
                ProjLibrary.EndXmlCategory("ItemGroup");
            }
            ProjLibrary.EndXmlCategory("Project");

            return(ProjLibrary.GetXmlString());
        }