示例#1
0
        public void Run(BuildEnvironment environment, Node task, IProjectDependencyGraph graph, ILogger logger)
        {
            var copy = (Copy)task;

            ProjectItem[] sourceFiles      = _expressionEngine.EvaluateItemList(copy.SourceFiles, environment);
            ProjectItem[] destinationFiles = _expressionEngine.EvaluateItemList(copy.DestinationFiles, environment);

            if (sourceFiles.Length != destinationFiles.Length)
            {
                throw new BuildException(
                          string.Format("SourceFiles and DestinationFiles must be of the same length, but \"{0}\" and \"{1}\" are not",
                                        sourceFiles.Length,
                                        destinationFiles.Length));
            }

            string directory = environment.Properties[Properties.MSBuildProjectDirectory];
            var    copied    = new ProjectItem[sourceFiles.Length];

            for (int i = 0; i < sourceFiles.Length; ++i)
            {
                ProjectItem source      = sourceFiles[i];
                ProjectItem destination = destinationFiles[i];

                if (Copy(directory, source, destination, logger))
                {
                    copied[i] = destination;
                }
            }
        }
示例#2
0
        public void Run(BuildEnvironment environment, Node task, IProjectDependencyGraph graph, ILogger logger)
        {
            var    error = (Error)task;
            string text  = _expressionEngine.EvaluateExpression(error.Text, environment);

            logger.WriteError("  {0}", text);
        }
示例#3
0
        public void Run(BuildEnvironment environment, Node task, IProjectDependencyGraph graph, ILogger logger)
        {
            if (environment == null)
            {
                throw new ArgumentNullException("environment");
            }
            var warning = (Warning)task;
            var text    = _expressionEngine.EvaluateExpression(warning.Text, environment);

            logger.WriteWarning("  {0}", text);
        }
示例#4
0
        public void Run(BuildEnvironment environment, Node task, IProjectDependencyGraph graph, ILogger logger)
        {
            var delete = (Delete)task;

            ProjectItem[] files = _expressionEngine.EvaluateItemList(delete.Files, environment);

            string directory = environment.Properties[Properties.MSBuildProjectDirectory];
            var    deleted   = new ProjectItem[files.Length];

            for (int i = 0; i < files.Length; ++i)
            {
                ProjectItem file = files[i];

                if (Delete(directory, file, logger))
                {
                    deleted[i] = file;
                }
            }
        }
示例#5
0
        public void Run(BuildEnvironment environment, Node task, IProjectDependencyGraph graph, ILogger logger)
        {
            var csc       = (Csc)task;
            var arguments = new ArgumentBuilder();

            BuildCommandLineArguments(environment, csc, arguments);

            logger.WriteLine(Verbosity.Normal, "  {0} {1}", CompilerPath, arguments);

            CreateDirectories(environment, csc);

            var    rootPath = environment.Properties[Properties.MSBuildProjectDirectory];
            string output;
            var    exitCode = ProcessEx.Run(CompilerPath, rootPath, arguments, out output);

            logger.WriteMultiLine(Verbosity.Minimal, output, interpretLines: true);

            if (exitCode != 0)
            {
                throw new BuildException(string.Format("csc returned {0}", exitCode));
            }
        }
示例#6
0
 public void Run(BuildEnvironment environment, Node task, IProjectDependencyGraph graph, ILogger logger)
 {
     var exec = (Exec)task;
 }