void GenerateTasksMinGW(ref VCTasks vcLaunch, string name, string configure, string platform) { VCTasks.Task task = new VCTasks.Task(); task.command = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, AppDomain.CurrentDomain.FriendlyName).Replace('\\', '/'); task.args.Add(name); task.args.Add(configure); task.args.Add(platform); task.label = "build " + configure + "_" + platform; vcLaunch.tasks.Add(task); }
public void Write() { if (Config.Global.IsWindows) { List <string> GlobalDefines = new List <string>(); GlobalDefines.AddRange(new string[] { "WINDOWS", "LIB", "_LIB" }); if (Config.Global.UNICODE) { GlobalDefines.Add("_UNICODE;"); GlobalDefines.Add("UNICODE"); } VCCppProperties vcCppProperties = new VCCppProperties(); string[][] PlatfromsDefines = { new string[] { "WIN64", "X64" } }; string[][] ConfigurationsDefines = { new string[] { "DEBUG", "_DEBUG", "GCC" }, new string[] { "MIXED", "DEBUG", "GCC" }, new string[] { "NDEBUG", "GCC" } }; { for (int i = 0; i < Platfroms.Length; i++) { for (int a = 0; a < Configurations.Length; a++) { List <string> LocalDefines = new List <string>(); LocalDefines.AddRange(GlobalDefines); LocalDefines.AddRange(PlatfromsDefines[i]); LocalDefines.AddRange(ConfigurationsDefines[a]); GenerateCPPConfigureMinGW(ref vcCppProperties, Platfroms[i], i, a, Name, LocalDefines.ToArray()); } } File.WriteAllText(Path.Combine(VCDirectory, "c_cpp_properties.json"), JsonConvert.SerializeObject(vcCppProperties, Formatting.Indented)); } if (General) { { VCTasks vcTasks = new VCTasks(); for (int i = 0; i < Platfroms.Length; i++) { for (int a = 0; a < Configurations.Length; a++) { GenerateTasksMinGW(ref vcTasks, Name, Configurations[a], Platfroms[i]); } } File.WriteAllText(Path.Combine(VCDirectory, "tasks.json"), JsonConvert.SerializeObject(vcTasks, Formatting.Indented)); } { VCLaunch vcLaunch = new VCLaunch(); GenerateLaunchMinGW(ref vcLaunch, "Debug", "debug"); GenerateLaunchMinGW(ref vcLaunch, "Mixed", "mixed"); GenerateLaunchMinGW(ref vcLaunch, "Release", ""); File.WriteAllText(Path.Combine(VCDirectory, "launch.json"), JsonConvert.SerializeObject(vcLaunch, Formatting.Indented)); } } } else { { } } }