static void Main(string[] args) { // If true, outputs C++/CLI wrapper, // if false, outputs C wrapper with C# code. bool cppCliMode = false; var project = WrapperProject.FromFile("bullet3.xml"); if (!project.VerifyFiles()) { Console.ReadKey(); return; } project.ReadCpp(); var parser = new BulletParser(project); parser.Parse(); Console.WriteLine("Parsing complete"); CWriter cWriter = new CWriter(parser); //project.CProjectPath = "c_temp"; cWriter.Output(); DotNetWriter dotNetWriter; if (cppCliMode) { dotNetWriter = new CppCliWriter(parser); } else { dotNetWriter = new PInvokeWriter(parser); var extensionsWriter = new ExtensionsWriter(parser); extensionsWriter.Output(); } dotNetWriter.Output(); OutputSolution(TargetVS.VS2008, parser); OutputSolution(TargetVS.VS2010, parser); OutputSolution(TargetVS.VS2012, parser); OutputSolution(TargetVS.VS2013, parser); OutputSolution(TargetVS.VS2015, parser); //project.Save(); CMakeWriter cmake = new CMakeWriter(parser); cmake.Output(); Console.Write("Press any key to continue..."); Console.ReadKey(); }
static void Main(string[] args) { // If true, outputs C++/CLI wrapper, // if false, outputs C wrapper with C# code. bool cppCliMode = false; //var subset = new AssemblySubset(); //subset.LoadAssembly("..\\..\\..\\bulletsharp\\demos\\Generic\\bin\\Release\\BasicDemo.exe", "BulletSharp"); //subset.LoadAssembly("..\\..\\..\\bulletsharp\\demos\\Generic\\bin\\Release\\DemoFramework.dll", "BulletSharp"); string sourceFolder = "D:\\src\\bullet3\\src\\"; //sourceFolder = "..\\..\\..\\bullet\\src\\"; if (!Directory.Exists(sourceFolder)) { Console.WriteLine("Source folder \"" + sourceFolder + "\" not found"); Console.Write("Press any key to continue..."); Console.ReadKey(); return; } var reader = new CppReader(sourceFolder); var parser = new BulletParser(reader.ClassDefinitions, reader.HeaderDefinitions); var externalHeaders = parser.ExternalHeaders.Values; if (cppCliMode) { var writer = new CppCliWriter(externalHeaders, NamespaceName); writer.Output(); } else { var writer = new PInvokeWriter(externalHeaders, NamespaceName); writer.Output(); var extensionWriter = new ExtensionsWriter(externalHeaders, NamespaceName); extensionWriter.Output(); } OutputSolution(TargetVS.VS2008, externalHeaders); OutputSolution(TargetVS.VS2010, externalHeaders); OutputSolution(TargetVS.VS2012, externalHeaders); OutputSolution(TargetVS.VS2013, externalHeaders); CMakeWriter cmake = new CMakeWriter(parser.ExternalHeaders, NamespaceName); cmake.Output(); Console.Write("Press any key to continue..."); Console.ReadKey(); }
static void Main(string[] args) { // If true, outputs C++/CLI wrapper, // if false, outputs C wrapper with C# code. bool cppCliMode = false; var project = WrapperProject.FromFile("bullet3.xml"); if (!project.VerifyFiles()) { Console.ReadKey(); return; } var reader = new CppReader(project); var parser = new BulletParser(project); parser.Parse(); Console.WriteLine("Parsing complete"); WrapperWriter writer; if (cppCliMode) { writer = new CppCliWriter(project.HeaderDefinitions.Values, project.NamespaceName); } else { writer = new PInvokeWriter(project); var extensionWriter = new ExtensionsWriter(project.HeaderDefinitions.Values, project.NamespaceName); extensionWriter.Output(); } writer.Output(); OutputSolution(TargetVS.VS2008, project); OutputSolution(TargetVS.VS2010, project); OutputSolution(TargetVS.VS2012, project); OutputSolution(TargetVS.VS2013, project); OutputSolution(TargetVS.VS2015, project); //project.Save(); CMakeWriter cmake = new CMakeWriter(project.HeaderDefinitions, project.NamespaceName); cmake.Output(); Console.Write("Press any key to continue..."); Console.ReadKey(); }
static void Main(string[] args) { // If true, outputs C++/CLI wrapper, // if false, outputs C wrapper with C# code. bool cppCliMode = false; var project = WrapperProject.FromFile("bullet3.xml"); if (!project.VerifyFiles()) { Console.ReadKey(); return; } var reader = new CppReader(project); var parser = new BulletParser(project); parser.Parse(); Console.WriteLine("Parsing complete"); WrapperWriter writer; if (cppCliMode) { writer = new CppCliWriter(project); } else { writer = new PInvokeWriter(project); var extensionWriter = new ExtensionsWriter(project.HeaderDefinitions.Values, project.NamespaceName); extensionWriter.Output(); } writer.Output(); OutputSolution(TargetVS.VS2008, project); OutputSolution(TargetVS.VS2010, project); OutputSolution(TargetVS.VS2012, project); OutputSolution(TargetVS.VS2013, project); OutputSolution(TargetVS.VS2015, project); //project.Save(); CMakeWriter cmake = new CMakeWriter(project); cmake.Output(); Console.Write("Press any key to continue..."); Console.ReadKey(); }