<commit_before>﻿using System;
using System.IO;
using System.Threading.Tasks;
using Kudu.Core.Infrastructure;
using SystemEnvironment = System.Environment;

namespace Kudu.Core.Deployment {
    public class WapBuilder : ISiteBuilder {
        private readonly string _solutionPath;
        private readonly string _projectPath;
        private readonly Executable _msbuildExe;

        public WapBuilder(string sourcePath, string solutionPath, string projectPath) {
            _solutionPath = solutionPath;
            _projectPath = projectPath;
            _msbuildExe = new Executable(ResolveMSBuildPath(), sourcePath);
        }

        public Task Build(string outputPath, ILogger logger) {
            var tcs = new TaskCompletionSource<object>();

            // Locate the solution directory
            string solutionDir = Path.GetDirectoryName(_solutionPath) + "\\";

            try {
                logger.Log("Builing solution {0}.", Path.GetFileName(_solutionPath));

                // Build the solution first
                string log = _msbuildExe.Execute(@"""{0}""", _solutionPath);

                logger.Log(log);
            }
            catch (Exception e) {
                logger.Log("Building solution failed.");
                logger.Log(e);
                tcs.TrySetException(e);
                return tcs.Task;
            }

            try {
                logger.Log("Building web project {0}.", Path.GetFileName(_projectPath));

                // REVIEW: Should we use the msbuild API?
                string log = _msbuildExe.Execute(@"""{0}"" /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir={1};AutoParameterizationWebConfigConnectionStrings=false;SolutionDir={2}", _projectPath, outputPath, solutionDir);

                logger.Log(log);
            }
            catch (Exception e) {
                logger.Log("Building web project failed.");
                logger.Log(e);
                tcs.TrySetException(e);
                return tcs.Task;
            }

            tcs.SetResult(null);

            return tcs.Task;<commit_msg>Use minimal verbosity when building using msbuild<commit_after>﻿using System;
using System.IO;
using System.Threading.Tasks;
using Kudu.Core.Infrastructure;
using SystemEnvironment = System.Environment;

namespace Kudu.Core.Deployment {
    public class WapBuilder : ISiteBuilder {
        private readonly string _solutionPath;
        private readonly string _projectPath;
        private readonly Executable _msbuildExe;

        public WapBuilder(string sourcePath, string solutionPath, string projectPath) {
            _solutionPath = solutionPath;
            _projectPath = projectPath;
            _msbuildExe = new Executable(ResolveMSBuildPath(), sourcePath);
        }

        public Task Build(string outputPath, ILogger logger) {
            var tcs = new TaskCompletionSource<object>();

            // Locate the solution directory
            string solutionDir = Path.GetDirectoryName(_solutionPath) + "\\";

            try {
                logger.Log("Builing solution {0}.", Path.GetFileName(_solutionPath));

                // Build the solution first
                string log = _msbuildExe.Execute(@"""{0}"" /verbosity:m /nologo", _solutionPath);

                logger.Log(log);
            }
            catch (Exception e) {
                logger.Log("Building solution failed.");
                logger.Log(e);
                tcs.TrySetException(e);
                return tcs.Task;
            }

            try {
                logger.Log("Building web project {0}.", Path.GetFileName(_projectPath));

                // REVIEW: Should we use the msbuild API?
                string log = _msbuildExe.Execute(@"""{0}"" /nologo /verbosity:m /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir={1};AutoParameterizationWebConfigConnectionStrings=false;SolutionDir={2}", _projectPath, outputPath, solutionDir);

                logger.Log(log);
            }
            catch (Exception e) {
                logger.Log("Building web project failed.");
                logger.Log(e);
                tcs.TrySetException(e);
                return tcs.Task;
            }

            tcs.SetResult(null);

            return tcs.Task;
{'fraction_non_alphanumeric': 0.0948155067725362, 'fraction_numerical': 0.0028024287716020553, 'mean_word_length': 2.0268551236749115, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3810885', 'n_tokens_mistral': 1126, 'n_tokens_neox': 1055, 'n_words': 251}