Example #1
0
        private static void SetConfigurationParameters(ProjectStruct inProject)
        {
            SolutionStruct solutionData = SolutionAnalyzer.Get().solutionData;

            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\"");
                {
                    if (inProject.ProjectType == "StaticLibrary")
                    {
                        ProjLibrary.AddXmlValue("ConfigurationType", "StaticLibrary");
                    }
                    if (Configuration == "Debug")
                    {
                        ProjLibrary.AddXmlValue("UseDebugLibraries", "true");
                    }
                    if (Configuration != "Debug")
                    {
                        ProjLibrary.AddXmlValue("UseDebugLibraries", "false");
                    }
                    ProjLibrary.AddXmlValue("PlatformToolset", solutionData.PlatformToolset);
                    ProjLibrary.AddXmlValue("WholeProgramOptimization", "false");
                    ProjLibrary.AddXmlValue("CharacterSet", "MultiByte");
                    ProjLibrary.AddXmlValue("CharacterSet", "MultiByte");
                }
                ProjLibrary.EndXmlCategory("PropertyGroup");
            }
        }
Example #2
0
 public static SolutionAnalyzer Get()
 {
     if (analyzerInstance == null)
     {
         analyzerInstance = new SolutionAnalyzer();
     }
     return(analyzerInstance);
 }
Example #3
0
 public static ProjectStruct GetProject(String inProjectName)
 {
     foreach (ProjectStruct project in SolutionAnalyzer.Get().Projects)
     {
         if (project.ProjectName == inProjectName)
         {
             return(project);
         }
     }
     throw new FieldAccessException("Project " + inProjectName + " doesn't exist");
 }
Example #4
0
        private static void SetProjectConfigs(ProjectStruct inProject)
        {
            SolutionStruct solutionData = SolutionAnalyzer.Get().solutionData;

            ProjLibrary.BeginXmlCategory("PropertyGroup", "Label =\"Globals\"");
            {
                ProjLibrary.AddXmlValue("VCProjectVersion", solutionData.ToolVersion);
                ProjLibrary.AddXmlValue("ProjectGuid", inProject.ProjectName);
                ProjLibrary.AddXmlValue("RootNamespace", inProject.ProjectName);
                ProjLibrary.AddXmlValue("WindowsTargetPlatformVersion", solutionData.WindowTargetPlateformVersion);
            }
            ProjLibrary.EndXmlCategory("PropertyGroup");
        }
Example #5
0
        private static void SetPropertyPath(ProjectStruct inProject)
        {
            SolutionStruct solutionData = SolutionAnalyzer.Get().solutionData;

            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 + "'\"");
                {
                    ProjLibrary.AddXmlValue("IncludePath", SolutionAnalyzer.StackStringList(SolutionAnalyzer.Get().GetIncludes(inProject.ProjectName)) + "$(IncludePath)");
                    ProjLibrary.AddXmlValue("LibraryPath", "$(SolutionDir)" + solutionData.LibraryOutputFolder + "\\" + Configuration + "\\" + Plateform + "\\" + inProject.ProjectName + ";$(LibraryPath)");
                    ProjLibrary.AddXmlValue("OutDir", "$(SolutionDir)" + (inProject.ProjectType == "StaticLibrary" ? solutionData.LibraryOutputFolder : solutionData.ExecutableOutputFolder) + "\\" + Configuration + "\\" + Plateform + "\\" + inProject.ProjectName + "\\");
                    ProjLibrary.AddXmlValue("IntDir", "$(SolutionDir)" + solutionData.BinariesFolder + "\\" + Configuration + "\\" + Plateform + "\\" + inProject.ProjectName + "\\");
                }
                ProjLibrary.EndXmlCategory("PropertyGroup");
            }
        }
Example #6
0
 static void Main(string[] args)
 {
     SolutionAnalyzer.SetSolutionAbsolutePath(args[0]);// "C:\\Users\\Pierre\\Documents\\GLEngine");
     foreach (ProjectStruct proj in SolutionAnalyzer.Get().Projects)
     {
         try
         {
             ProjectBuilder.WriteProjectFile(vcxprojFileStringGenerator.BuildVcxprojString(proj), Path.GetDirectoryName(proj.ProjectFileAbsolutePath) + "\\" + proj.ProjectName + ".vcxproj");
             ProjectBuilder.WriteProjectFile(userFileStringGenerator.BuildUserFileString(proj), Path.GetDirectoryName(proj.ProjectFileAbsolutePath) + "\\" + proj.ProjectName + ".vcxproj.user");
             ProjectBuilder.WriteProjectFile(filtersFileGenerator.BuildFilterString(proj), Path.GetDirectoryName(proj.ProjectFileAbsolutePath) + "\\" + proj.ProjectName + ".vcxproj.filters");
             Console.WriteLine("=> Successfully created " + proj.ProjectName + " file");
         }
         catch (Exception e)
         {
             Console.WriteLine("Failed to build proj " + proj.ProjectName + " :\n" + e.Message);
         }
     }
     Console.WriteLine("Job finnished");
     Console.WriteLine("Press any key to continue...");
     Console.ReadKey();
 }
Example #7
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());
        }
Example #8
0
        private static void SetCompilationValues(ProjectStruct inProject)
        {
            SolutionStruct solutionData = SolutionAnalyzer.Get().solutionData;

            for (int i = 0; i < 4; ++i)
            {
                String Configuration = (i > 1) ? "Debug" : "Release";
                String Plateform     = (i % 2 == 0) ? "Win32" : "x64";
                ProjLibrary.BeginXmlCategory("ItemDefinitionGroup", "Condition=\"'$(Configuration)|$(Platform)' == '" + Configuration + "|" + Plateform + "'\"");
                {
                    ProjLibrary.BeginXmlCategory("ClCompile");
                    {
                        ProjLibrary.AddXmlValue("WarningLevel", "Level3");
                        ProjLibrary.AddXmlValue("Optimization", "Disabled");
                        ProjLibrary.AddXmlValue("SDLCheck", "true");
                        ProjLibrary.AddXmlValue("ConformanceMode", "true");
                        ProjLibrary.AddXmlValue("RuntimeLibrary", "MultiThreadedDebugDLL");
                        ProjLibrary.AddXmlValue("MultiProcessorCompilation", "true");
                        ProjLibrary.AddXmlValue("FavorSizeOrSpeed", "Speed");
                    }
                    ProjLibrary.EndXmlCategory("ClCompile");
                    ProjLibrary.BeginXmlCategory("Link");
                    {
                        try
                        {
                            ProjLibrary.AddXmlValue("AdditionalDependencies", SolutionAnalyzer.StackStringList(SolutionAnalyzer.Get().GetLibraries(inProject.ProjectName, Configuration, Plateform)) + "%(AdditionalDependencies)");
                        }
                        catch (Exception e)
                        {
                            Console.WriteLine(e.Message + "\nBuild libraries then rebuild solution files before compiling executables");
                        }
                    }
                    ProjLibrary.EndXmlCategory("Link");
                }
                ProjLibrary.EndXmlCategory("ItemDefinitionGroup");
            }
        }