Permalink
Browse files

Log msbuild commands to the profiler.

  • Loading branch information...
1 parent bbf0e04 commit 1c18593360480f70d1210b53f46893de45261177 @davidfowl davidfowl committed Feb 19, 2012
@@ -2,6 +2,7 @@
using System.IO;
using System.Linq;
using System.Threading.Tasks;
+using Kudu.Contracts;
using Kudu.Core.Infrastructure;
using SystemEnvironment = System.Environment;
@@ -23,12 +24,9 @@ protected string GetPropertyString()
return String.Join(";", _propertyProvider.GetProperties().Select(p => p.Key + "=" + p.Value));
}
- public string ExecuteMSBuild(ILogger logger, string arguments, params object[] args)
+ public string ExecuteMSBuild(IProfiler profiler, string arguments, params object[] args)
{
-#if DEBUG
- logger.Log(String.Format(arguments, args));
-#endif
- return _msbuildExe.Execute(arguments, args).Item1;
+ return _msbuildExe.Execute(profiler, arguments, args).Item1;
}
public abstract Task Build(DeploymentContext context);
@@ -38,7 +38,7 @@ public override Task Build(DeploymentContext context)
using (context.Profiler.Step("Running msbuild on solution"))
{
// Build the solution first
- string log = ExecuteMSBuild(innerLogger, @"""{0}"" /verbosity:m /nologo{1}", SolutionPath, propertyString);
+ string log = ExecuteMSBuild(context.Profiler, @"""{0}"" /verbosity:m /nologo{1}", SolutionPath, propertyString);
innerLogger.Log(log);
}
@@ -1,6 +1,7 @@
using System;
using System.IO;
using System.Threading.Tasks;
+using Kudu.Contracts;
namespace Kudu.Core.Deployment
{
@@ -35,7 +36,7 @@ public override Task Build(DeploymentContext context)
using (context.Profiler.Step("Running msbuild on project file"))
{
- log = BuildProject(innerLogger, buildTempPath);
+ log = BuildProject(context.Profiler, buildTempPath);
}
using (context.Profiler.Step("Copying files to output directory"))
@@ -64,20 +65,20 @@ public override Task Build(DeploymentContext context)
return tcs.Task;
}
- private string BuildProject(ILogger innerLogger, string buildTempPath)
+ private string BuildProject(IProfiler profiler, string buildTempPath)
{
string command = @"""{0}"" /nologo /verbosity:m /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir=""{1}"";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release;";
if (String.IsNullOrEmpty(_solutionPath))
{
command += "{2}";
- return ExecuteMSBuild(innerLogger, command, _projectPath, buildTempPath, GetPropertyString());
+ return ExecuteMSBuild(profiler, command, _projectPath, buildTempPath, GetPropertyString());
}
string solutionDir = Path.GetDirectoryName(_solutionPath) + @"\\";
command += @"SolutionDir=""{2}"";{3}";
// Build artifacts into a temp path
- return ExecuteMSBuild(innerLogger, command, _projectPath, buildTempPath, solutionDir, GetPropertyString());
+ return ExecuteMSBuild(profiler, command, _projectPath, buildTempPath, solutionDir, GetPropertyString());
}
}
}

0 comments on commit 1c18593

Please sign in to comment.