static void Main(string [] args) { if (!File.Exists ("genproj.cs") || !File.Exists ("monowrap.cs")){ Console.WriteLine ("This command should be ran from mono/msvc/scripts"); Environment.Exit (1); } var sln_gen = new SlnGenerator (); XDocument doc = XDocument.Load ("order.xml"); foreach (XElement project in doc.Root.Elements ()){ string dir = project.Attribute ("dir").Value; string library = project.Attribute ("library").Value; // // Do only class libraries for now // if (!(dir.StartsWith ("class") || dir.StartsWith ("mcs"))) continue; // // Do not do 2.1, it is not working yet // Do not do basic, as there is no point (requires a system mcs to be installed). // if (library.Contains ("moonlight") || library.Contains ("-basic")) continue; var gen = new MsbuildGenerator (dir); try { sln_gen.Add (gen.Generate (project)); } catch (Exception e) { Console.WriteLine ("Error in {0}\n{1}", dir, e); } } sln_gen.Write ("mcs_full.sln"); }
static void Main(string [] args) { if (!File.Exists("genproj.cs")) { Console.WriteLine("This command should be ran from mono/msvc/scripts"); Environment.Exit(1); } var sln_gen = new SlnGenerator(); XDocument doc = XDocument.Load("order.xml"); foreach (XElement project in doc.Root.Elements()) { string dir = project.Attribute("dir").Value; string library = project.Attribute("library").Value; // // Do only class libraries for now // if (!(dir.StartsWith("class") || dir.StartsWith("mcs"))) { continue; } // // Do not do 2.1, it is not working yet // Do not do basic, as there is no point (requires a system mcs to be installed). // if (library.Contains("moonlight") || library.Contains("-basic") || library.EndsWith("bootstrap")) { continue; } var gen = new MsbuildGenerator(dir); try { //sln_gen.Add (gen.Generate (project)); gen.Generate(project); } catch (Exception e) { Console.WriteLine("Error in {0}\n{1}", dir, e); } } sln_gen.Write("mcs_full.sln"); }
static void Main(string [] args) { if (!File.Exists("genproj.cs")) { Console.WriteLine("This command must be executed from mono/msvc/scripts"); Environment.Exit(1); } if (args.Length == 1 && args [0].ToLower().Contains("-h")) { Console.WriteLine("Usage:"); Console.WriteLine("genproj.exe [visual_studio_release] [output_full_solutions]"); Console.WriteLine("If output_full_solutions is false, only the main System*.dll"); Console.WriteLine(" assemblies (and dependencies) is included in the solution."); Console.WriteLine("Example:"); Console.WriteLine("genproj.exe 2012 false"); Console.WriteLine("genproj.exe with no arguments is equivalent to 'genproj.exe 2012 true'"); Environment.Exit(0); } var slnVersion = (args.Length > 0) ? args [0] : "2012"; bool fullSolutions = (args.Length > 1) ? bool.Parse(args [1]) : true; var sln_gen = new SlnGenerator(slnVersion); var two_sln_gen = new SlnGenerator(slnVersion); var four_sln_gen = new SlnGenerator(slnVersion); var three_five_sln_gen = new SlnGenerator(slnVersion); var four_five_sln_gen = new SlnGenerator(slnVersion); var projects = new List <MsbuildGenerator.VsCsproj> (); XDocument doc = XDocument.Load("order.xml"); var duplicates = new List <string> (); foreach (XElement project in doc.Root.Elements()) { string dir = project.Attribute("dir").Value; string library = project.Attribute("library").Value; // // Do only class libraries for now // if (!(dir.StartsWith("class") || dir.StartsWith("mcs") || dir.StartsWith("basic"))) { continue; } // // Do not do 2.1, it is not working yet // Do not do basic, as there is no point (requires a system mcs to be installed). // //if (library.Contains ("moonlight") || library.Contains ("-basic") || library.EndsWith ("bootstrap")) if (library.Contains("moonlight") || library.EndsWith("bootstrap")) { continue; } var gen = new MsbuildGenerator(dir); try { var csproj = gen.Generate(project, projects); var csprojFilename = csproj.csprojFileName; if (!sln_gen.ContainsProjectIdentifier(csproj.library)) { projects.Add(csproj); sln_gen.Add(csproj); } else { duplicates.Add(csprojFilename); } } catch (Exception e) { Console.WriteLine("Error in {0}\n{1}", dir, e); } } Func <MsbuildGenerator.VsCsproj, bool> additionalFilter; additionalFilter = fullSolutions ? (Func <MsbuildGenerator.VsCsproj, bool>)null : IsCommonLibrary; FillSolution(two_sln_gen, MsbuildGenerator.profile_2_0, projects, additionalFilter); FillSolution(four_five_sln_gen, MsbuildGenerator.profile_4_5, projects, additionalFilter); FillSolution(four_sln_gen, MsbuildGenerator.profile_4_0, projects, additionalFilter); FillSolution(three_five_sln_gen, MsbuildGenerator.profile_3_5, projects, additionalFilter); var sb = new StringBuilder(); sb.AppendLine("WARNING: Skipped some project references, apparent duplicates in order.xml:"); foreach (var item in duplicates) { sb.AppendLine(item); } Console.WriteLine(sb.ToString()); WriteSolution(two_sln_gen, MakeSolutionName(MsbuildGenerator.profile_2_0)); WriteSolution(three_five_sln_gen, MakeSolutionName(MsbuildGenerator.profile_3_5)); WriteSolution(four_sln_gen, MakeSolutionName(MsbuildGenerator.profile_4_0)); WriteSolution(four_five_sln_gen, MakeSolutionName(MsbuildGenerator.profile_4_5)); // A few other optional solutions // Solutions with 'everything' and the most common libraries used in development may be of interest //WriteSolution (sln_gen, "mcs_full.sln"); //WriteSolution (small_full_sln_gen, "small_full.sln"); // The following may be useful if lacking visual studio or MonoDevelop, to bootstrap mono compiler self-hosting //WriteSolution (basic_sln_gen, "mcs_basic.sln"); //WriteSolution (build_sln_gen, "mcs_build.sln"); }
static void Main (string [] args) { if (!File.Exists ("genproj.cs")) { Console.WriteLine ("This command must be executed from mono/msvc/scripts"); Environment.Exit (1); } if (args.Length == 1 && args [0].ToLower ().Contains ("-h")) { Console.WriteLine ("Usage:"); Console.WriteLine ("genproj.exe [visual_studio_release] [output_full_solutions]"); Console.WriteLine ("If output_full_solutions is false, only the main System*.dll"); Console.WriteLine (" assemblies (and dependencies) is included in the solution."); Console.WriteLine ("Example:"); Console.WriteLine ("genproj.exe 2012 false"); Console.WriteLine ("genproj.exe with no arguments is equivalent to 'genproj.exe 2012 true'"); Environment.Exit (0); } var slnVersion = (args.Length > 0) ? args [0] : "2012"; bool fullSolutions = (args.Length > 1) ? bool.Parse (args [1]) : true; var sln_gen = new SlnGenerator (slnVersion); var two_sln_gen = new SlnGenerator (slnVersion); var four_sln_gen = new SlnGenerator (slnVersion); var three_five_sln_gen = new SlnGenerator (slnVersion); var four_five_sln_gen = new SlnGenerator (slnVersion); var projects = new List<MsbuildGenerator.VsCsproj> (); XDocument doc = XDocument.Load ("order.xml"); var duplicates = new List<string> (); foreach (XElement project in doc.Root.Elements ()) { string dir = project.Attribute ("dir").Value; string library = project.Attribute ("library").Value; // // Do only class libraries for now // if (!(dir.StartsWith ("class") || dir.StartsWith ("mcs") || dir.StartsWith ("basic"))) continue; // // Do not do 2.1, it is not working yet // Do not do basic, as there is no point (requires a system mcs to be installed). // //if (library.Contains ("moonlight") || library.Contains ("-basic") || library.EndsWith ("bootstrap")) if (library.Contains ("moonlight") || library.EndsWith ("bootstrap")) continue; var gen = new MsbuildGenerator (dir); try { var csproj = gen.Generate (project, projects); var csprojFilename = csproj.csprojFileName; if (!sln_gen.ContainsProjectIdentifier (csproj.library)) { projects.Add (csproj); sln_gen.Add (csproj); } else { duplicates.Add (csprojFilename); } } catch (Exception e) { Console.WriteLine ("Error in {0}\n{1}", dir, e); } } Func<MsbuildGenerator.VsCsproj, bool> additionalFilter; additionalFilter = fullSolutions ? (Func<MsbuildGenerator.VsCsproj, bool>)null : IsCommonLibrary; FillSolution (two_sln_gen, MsbuildGenerator.profile_2_0, projects, additionalFilter); FillSolution (four_five_sln_gen, MsbuildGenerator.profile_4_5, projects, additionalFilter); FillSolution (four_sln_gen, MsbuildGenerator.profile_4_0, projects, additionalFilter); FillSolution (three_five_sln_gen, MsbuildGenerator.profile_3_5, projects, additionalFilter); var sb = new StringBuilder (); sb.AppendLine ("WARNING: Skipped some project references, apparent duplicates in order.xml:"); foreach (var item in duplicates) { sb.AppendLine (item); } Console.WriteLine (sb.ToString ()); WriteSolution (two_sln_gen, MakeSolutionName (MsbuildGenerator.profile_2_0)); WriteSolution (three_five_sln_gen, MakeSolutionName (MsbuildGenerator.profile_3_5)); WriteSolution (four_sln_gen, MakeSolutionName (MsbuildGenerator.profile_4_0)); WriteSolution (four_five_sln_gen, MakeSolutionName (MsbuildGenerator.profile_4_5)); // A few other optional solutions // Solutions with 'everything' and the most common libraries used in development may be of interest //WriteSolution (sln_gen, "mcs_full.sln"); //WriteSolution (small_full_sln_gen, "small_full.sln"); // The following may be useful if lacking visual studio or MonoDevelop, to bootstrap mono compiler self-hosting //WriteSolution (basic_sln_gen, "mcs_basic.sln"); //WriteSolution (build_sln_gen, "mcs_build.sln"); }