예제 #1
0
        private async void GenerateButton_Click(object sender, EventArgs e)
        {
            //var sourceFile = Path.Combine(Core.ALProjectPath, @"Common\DataClasses\FanMissionData.cs");
            //var destFile = Path.Combine(Core.ALProjectPath, @"Ini\FMData.cs");
            //Core.GenerateFMData(sourceFile, destFile);
            //await Roslyn_Test.RunRoslynTest();

#if false
            var langFile = Path.Combine(Core.ALProjectPath, @"Languages\English.ini");
            StateVars.WriteTestLangFile = true;
            StateVars.TestFile          = @"C:\AngelLoader\Data\Languages\TestLang.ini";
            LanguageGen.Generate(langFile);
#endif

            VisLoc.Generate();
        }
예제 #2
0
        private static void ReadArgsAndDoTasks()
        {
#if DEBUG
            //return;
#endif

            // args[0] is always the application filename
            string[] args = Environment.GetCommandLineArgs();

            if (args.Length < 2)
            {
                ExitIfRelease();
            }

            for (int i = 1; i < args.Length; i++)
            {
                switch (args[i])
                {
                case "-version=beta":
                    if (!GenTasks.Contains(GenType.Version))
                    {
                        GenTasks.Add(GenType.Version);
                        string sourceFile = Path.Combine(ALProjectPath, @"Properties\AssemblyInfo.cs");
                        VersionIncrement.Generate(sourceFile, VersionType.Beta);
                    }
                    break;

                case "-version=public":
                    if (!GenTasks.Contains(GenType.Version))
                    {
                        GenTasks.Add(GenType.Version);
                        string sourceFile = Path.Combine(ALProjectPath, @"Properties\AssemblyInfo.cs");
                        VersionIncrement.Generate(sourceFile, VersionType.PublicRelease);
                    }
                    break;

                case "-fmdata":
                    // Switched this off due to the extensive manual edits for new HasResources format
                    break;
                    if (!GenTasks.Contains(GenType.FMData))
                    {
                        GenTasks.Add(GenType.FMData);
                        string sourceFile = Path.Combine(ALProjectPath, @"Common\DataClasses\FanMissionData.cs");
                        string destFile   = Path.Combine(ALProjectPath, @"Ini\FMData.cs");
                        GenerateFMData(sourceFile, destFile);
                    }
                    break;

                //case "-config": // Not implemented
                //    if (!GenTasks.Contains(GenType.Config)) GenTasks.Add(GenType.Config);
                //    break;
                case "-language":
                    if (!GenTasks.Contains(GenType.Language))
                    {
                        GenTasks.Add(GenType.Language);
                        string langFile = Path.Combine(ALProjectPath, @"Languages\English.ini");
                        LanguageGen.Generate(langFile);
                    }
                    break;

                case "-language_t":
                    if (!GenTasks.Contains(GenType.Language))
                    {
                        GenTasks.Add(GenType.Language);
                        string langFile = Path.Combine(ALProjectPath, @"Languages\English.ini");
                        StateVars.WriteTestLangFile = true;
                        StateVars.TestFile          = @"C:\AngelLoader\Data\Languages\TestLang.ini";
                        LanguageGen.Generate(langFile);
                    }
                    break;

                case "-visloc":
                    // switched off for now
                    break;
                    if (!GenTasks.Contains(GenType.VisLoc))
                    {
                        GenTasks.Add(GenType.VisLoc);
                        VisLoc.Generate();
                    }
                    break;

                default:
                    ExitIfRelease();
                    break;
                }
            }
        }