示例#1
0
        static int Main(string[] args)
        {
#if WINDOWS
            // Set the correct directory for our dependency files.
            var is32Bit   = IntPtr.Size == 4;
            var directory = string.Format("Dependencies{0}{1}", Path.DirectorySeparatorChar, is32Bit ? "x32" : "x64");
            SetDllDirectory(directory);
#endif

            var content = new BuildContent();

            // Parse the command line.
            var parser = new CommandLineParser(content)
            {
                Title = "MonoGame Content Builder\n" +
                        "Builds optimized game content for MonoGame projects."
            };
            if (!parser.ParseCommandLine(args))
            {
                return(-1);
            }

            // Process all resoponse files.
            foreach (var r in content.ResponseFiles)
            {
                // Read in all the lines, trim whitespace, and remove empty or comment lines.
                var commands = File.ReadAllLines(r).
                               Select(x => x.Trim()).
                               Where(x => !string.IsNullOrEmpty(x) && !x.StartsWith("#")).
                               ToArray();

                // Parse the commands like they came from the command line.
                if (!parser.ParseCommandLine(commands))
                {
                    return(-1);
                }
            }

            // Do we have anything to do?
            if (!content.HasWork)
            {
                parser.ShowUsage();
                return(0);
            }

            // Print a startup message.
            var buildStarted = DateTime.Now;
            Console.WriteLine("Build started {0}\n", buildStarted);

            // Let the content build.
            int successCount, errorCount;
            content.Build(out successCount, out errorCount);

            // Print the finishing info.
            Console.WriteLine("\nBuild {0} succeeded, {1} failed.\n", successCount, errorCount);
            Console.WriteLine("Time elapsed {0:hh\\:mm\\:ss\\.ff}.", DateTime.Now - buildStarted);

            // Return the error count.
            return(errorCount);
        }
示例#2
0
        static int Main(string[] args)
        {
            // We force all stderr to redirect to stdout
            // to avoid any out of order console output.
            Console.SetError(Console.Out);

            if (!Environment.Is64BitProcess && Environment.OSVersion.Platform != PlatformID.Unix)
            {
                Console.Error.WriteLine("The MonoGame content tools only work on a 64bit OS.");
                return(-1);
            }

            var content = new BuildContent();

            // Parse the command line.
            var parser = new MGBuildParser(content)
            {
                Title = "MonoGame Content Builder\n" +
                        "Builds optimized game content for MonoGame projects."
            };

            if (!parser.Parse(args))
            {
                return(-1);
            }

            // Launch debugger if requested.
            if (content.LaunchDebugger)
            {
                try {
                    System.Diagnostics.Debugger.Launch();
                } catch (NotImplementedException) {
                    // not implemented under Mono
                    Console.Error.WriteLine("The debugger is not implemented under Mono and thus is not supported on your platform.");
                }
            }

            // Print a startup message.
            var buildStarted = DateTime.Now;

            if (!content.Quiet)
            {
                Console.WriteLine("Build started {0}\n", buildStarted);
            }

            // Let the content build.
            int successCount, errorCount;

            content.Build(out successCount, out errorCount);

            // Print the finishing info.
            if (!content.Quiet)
            {
                Console.WriteLine("\nBuild {0} succeeded, {1} failed.\n", successCount, errorCount);
                Console.WriteLine("Time elapsed {0:hh\\:mm\\:ss\\.ff}.", DateTime.Now - buildStarted);
            }

            // Return the error count.
            return(errorCount);
        }
示例#3
0
        static int Main(string[] args)
        {
            // We force all stderr to redirect to stdout
            // to avoid any out of order console output.
            Console.SetError(Console.Out);

            var content = new BuildContent();

            // Parse the command line.
            var parser = new MGBuildParser(content)
            {
                Title = "MonoGame Content Builder\n" +
                        "Builds optimized game content for MonoGame projects."
            };

            if (!parser.Parse(args))
            {
                return(-1);
            }

            // Do we have anything to do?
            if (!content.HasWork)
            {
                parser.ShowUsage();
                return(0);
            }

            // Launch debugger if requested.
            if (content.LaunchDebugger)
            {
                System.Diagnostics.Debugger.Launch();
            }

            // Print a startup message.
            var buildStarted = DateTime.Now;

            if (!content.Quiet)
            {
                Console.WriteLine("Build started {0}\n", buildStarted);
            }

            // Let the content build.
            int successCount, errorCount;

            content.Build(out successCount, out errorCount);

            // Print the finishing info.
            if (!content.Quiet)
            {
                Console.WriteLine("\nBuild {0} succeeded, {1} failed.\n", successCount, errorCount);
                Console.WriteLine("Time elapsed {0:hh\\:mm\\:ss\\.ff}.", DateTime.Now - buildStarted);
            }

            // Return the error count.
            return(errorCount);
        }
示例#4
0
        static int Main(string[] args)
        {
            // We force all stderr to redirect to stdout
            // to avoid any out of order console output.
            Console.SetError(Console.Out);

            if (!Environment.Is64BitProcess && Environment.OSVersion.Platform != PlatformID.Unix)
            {
                Console.Error.WriteLine("The MonoGame content tools only work on a 64bit OS.");
                return -1;
            }

            var content = new BuildContent();

            // Parse the command line.
            var parser = new MGBuildParser(content)
            {
                Title = "MonoGame Content Builder\n" +
                        "Builds optimized game content for MonoGame projects."
            };

            if (!parser.Parse(args))
                return -1;           
            
            // Launch debugger if requested.
            if (content.LaunchDebugger)
            {
                try {
                    System.Diagnostics.Debugger.Launch();
                } catch (NotImplementedException) {
                    // not implemented under Mono
                }
            }

            // Print a startup message.            
            var buildStarted = DateTime.Now;
            if (!content.Quiet)
                Console.WriteLine("Build started {0}\n", buildStarted);

            // Let the content build.
            int successCount, errorCount;
            content.Build(out successCount, out errorCount);

            // Print the finishing info.
            if (!content.Quiet)
            {
                Console.WriteLine("\nBuild {0} succeeded, {1} failed.\n", successCount, errorCount);
                Console.WriteLine("Time elapsed {0:hh\\:mm\\:ss\\.ff}.", DateTime.Now - buildStarted);
            }

            // Return the error count.
            return errorCount;
        }
示例#5
0
        static int Main(string[] args)
        {
            // We force all stderr to redirect to stdout
            // to avoid any out of order console output.
            Console.SetError(Console.Out);

            var content = new BuildContent();

            // Parse the command line.
            var parser = new MGBuildParser(content)
            {
                Title = "MonoGame Content Builder\n" +
                        "Builds optimized game content for MonoGame projects."
            };

            if (!parser.Parse(args))
                return -1;           
            
            // Do we have anything to do?
            if (!content.HasWork)
            {
                parser.ShowUsage();
                return 0;
            }

            // Launch debugger if requested.
            if (content.LaunchDebugger)
                System.Diagnostics.Debugger.Launch();

            // Print a startup message.            
            var buildStarted = DateTime.Now;
            if (!content.Quiet)
                Console.WriteLine("Build started {0}\n", buildStarted);

            // Let the content build.
            int successCount, errorCount;
            content.Build(out successCount, out errorCount);

            // Print the finishing info.
            if (!content.Quiet)
            {
                Console.WriteLine("\nBuild {0} succeeded, {1} failed.\n", successCount, errorCount);
                Console.WriteLine("Time elapsed {0:hh\\:mm\\:ss\\.ff}.", DateTime.Now - buildStarted);
            }

            // Return the error count.
            return errorCount;
        }
示例#6
0
        static int Main(string[] args)
        {
#if WINDOWS
            // Set the correct directory for our dependency files.
            var is32Bit = IntPtr.Size == 4;
            var directory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory,
                string.Format("Dependencies{0}{1}", Path.DirectorySeparatorChar, is32Bit ? "x32" : "x64"));
            SetDllDirectory(directory);
#endif

            var content = new BuildContent();

            // Parse the command line.
            var parser = new CommandLineParser(content)
            {
                Title = "MonoGame Content Builder\n" +
                        "Builds optimized game content for MonoGame projects."
            };
            if (!parser.ParseCommandLine(args))
                return -1;

            // Process all resoponse files.
            foreach (var r in content.ResponseFiles)
            {
                // Read in all the lines, trim whitespace, and remove empty or comment lines.
                var commands = File.ReadAllLines(r).
                                Select(x => x.Trim()).
                                Where(x => !string.IsNullOrEmpty(x) && !x.StartsWith("#")).
                                ToArray();

                // Parse the commands like they came from the command line.
                if (!parser.ParseCommandLine(commands))
                    return -1;
            }
            
            // Do we have anything to do?
            if (!content.HasWork)
            {
                parser.ShowUsage();
                return 0;
            }

            // Print a startup message.            
            var buildStarted = DateTime.Now;
            if (!content.Quiet)
                Console.WriteLine("Build started {0}\n", buildStarted);

            // Let the content build.
            int successCount, errorCount;
            content.Build(out successCount, out errorCount);

            // Print the finishing info.
            if (!content.Quiet)
            {
                Console.WriteLine("\nBuild {0} succeeded, {1} failed.\n", successCount, errorCount);
                Console.WriteLine("Time elapsed {0:hh\\:mm\\:ss\\.ff}.", DateTime.Now - buildStarted);
            }

            // Return the error count.
            return errorCount;
        }