Example #1
0
        public static bool Execute(string[] args)
        {
            CommandLine commandLine = new CommandLine(args);

            if (commandLine.Options.Contains("attach"))
            {
                Debug.Fail("Attach");
            }

            if (commandLine.ShowHelp)
            {
                ShowUsage(/* message */ String.Empty);
                return(true);
            }

            CompilerOptions compilerOptions = CreateCompilerOptions(commandLine);

#if DEBUG
            if (compilerOptions.InternalTestMode)
            {
                // HACK: Our tests are currently in the Tests subnamespace, which is now
                //       used as a pattern for writing unit tests. This hack allows postponing
                //       modifying all tests and baselines.
                compilerOptions.TestsSubnamespace = ".UnitTests";
            }
#endif // DEBUG

            string errorMessage;
            if (compilerOptions.Validate(out errorMessage) == false)
            {
                ShowUsage(errorMessage);
                return(false);
            }

            if (commandLine.HideAbout == false)
            {
                ShowAbout();
            }

            ScriptCompiler compiler = new ScriptCompiler();
            bool           success  = compiler.Compile(compilerOptions);
#if DEBUG
            return(true);
#else
            return(success);
#endif // DEBUG
        }
Example #2
0
        public static bool Execute(string[] args)
        {
            CommandLine commandLine = new CommandLine(args);

            if (commandLine.Options.Contains("attach"))
            {
                Debug.Fail("Attach");
            }

            if (commandLine.ShowHelp)
            {
                ShowUsage(/* message */ String.Empty);
                return(true);
            }

            CompilerOptions compilerOptions = CreateCompilerOptions(commandLine);

            string errorMessage;

            if (compilerOptions.Validate(out errorMessage) == false)
            {
                ShowUsage(errorMessage);
                return(false);
            }

            if (commandLine.HideAbout == false)
            {
                ShowAbout();
            }

            ScriptCompiler compiler = new ScriptCompiler();
            bool           success  = compiler.Compile(compilerOptions);

#if DEBUG
            return(true);
#else
            return(success);
#endif // DEBUG
        }