Example #1
0
        public void Execute(Script script)
        {
            if (script == null)
            {
                throw new ArgumentNullException("script");
            }

            if (script.UsingAliasDirectives.Count > 0)
            {
                throw new CakeException("The Mono scripting engine do not support using alias directives.");
            }

            var code = MonoCodeGenerator.Generate(script);

            try
            {
                // Build the class we generated.
                _log.Verbose("Compiling build script...");
                _evaluator.Run(code);

                // Actually execute it.
                _evaluator.Run("new CakeBuildScriptImpl (ScriptHost).Execute ();");
            }
            catch (InternalErrorException)
            {
                // The error will be logged via the report printer.
                throw new CakeException("An error occured while executing build script.");
            }
        }
Example #2
0
        public void Execute(Script script)
        {
            var code = MonoCodeGenerator.Generate(script);

            try
            {
                // Build the class we generated.
                _log.Debug("Compiling build script...");
                _evaluator.Run(code);

                // Actually execute it.
                _evaluator.Run("new CakeBuildScriptImpl (ScriptHost).Execute ();");
            }
            catch (InternalErrorException)
            {
                // The error will be logged via the report printer.
                throw new CakeException("An error occured while executing build script.");
            }
        }