Sonar - Output Log Issue


If you do not have a build drop location set for your build definition, the log does not get written correctly - and in fact it causes the activity to fail.

This section of code is wrong:
            // log the full output of sonar to the build logs folder
            IBuildDetail build = this.ActivityContext.GetExtension<IBuildDetail>();
            string logFolder = Path.GetDirectoryName(build.LogLocation);
            string sonarLogFile = Path.Combine(logFolder, "Sonar.log");
            File.WriteAllText(sonarLogFile, outputStream);
            File.AppendAllText(sonarLogFile, "\n");
            File.AppendAllText(sonarLogFile, errorStream);

Essentially the log location attempts to write to c:\windows\system32 in this case which is not valid. If the drop location is not set, the log should not be written.
Closed Feb 9, 2014 at 5:57 PM by mikeFourie


mikeFourie wrote Feb 9, 2014 at 5:57 PM

Resolved with changeset 87265: Sonar.cs: only log output if drop true.

vapsor wrote Mar 16, 2015 at 3:37 PM

When will this changeset be merged to the legacy code (vs2010) ?