SettingsCompiler.SettingsCompiler.Run C# (CSharp) Method

Run() static private method

static private Run ( string args ) : void
args string
return void
        static void Run(string[] args)
        {
            if(args.Length < 1)
                throw new Exception("Invalid command-line parameters");

            List<Setting> settings = new List<Setting>();
            List<Type> enumTypes = new List<Type>();

            string filePath = args[0];
            string fileName = Path.GetFileNameWithoutExtension(filePath);

            Assembly compiledAssembly = CompileSettings(filePath);
            ReflectSettings(compiledAssembly, filePath, settings, enumTypes);

            string outputDir = Path.GetDirectoryName(filePath);
            string outputPath = Path.Combine(outputDir, fileName) + ".h";
            GenerateHeader(settings, fileName, outputPath, enumTypes);

            outputPath = Path.Combine(outputDir, fileName) + ".cpp";
            GenerateCPP(settings, fileName, outputPath, enumTypes);

            outputPath = Path.Combine(outputDir, fileName) + ".hlsl";
            GenerateHLSL(settings, fileName, outputPath, enumTypes);

            // Generate a dummy file that MSBuild can use to track dependencies
            outputPath = Path.Combine(outputDir, fileName) + ".deps";
            File.WriteAllText(outputPath, "This file is output to allow MSBuild to track dependencies");
        }