예제 #1
0
        public bool Execute()
        {
            _options.References = _references;
            _options.Sources = _sources.Cast<IStreamSource>().ToList();
            _options.ScriptFile = _output;

            ScriptCompiler compiler = new ScriptCompiler(this);
            return compiler.Compile(_options);
        }
예제 #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);

            #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
        }