Skip to content
This repository has been archived by the owner on Dec 25, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/0.6.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalberger committed Mar 18, 2019
2 parents 9431976 + 3878fa3 commit 0bf84d1
Show file tree
Hide file tree
Showing 11 changed files with 127 additions and 64 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ and for general information about the Cake build automation system see the [Cake

## Build Status

| | Develop | Master |
|:--:|:--:|:--:|
|AppVeyor Windows|[![Build status](https://ci.appveyor.com/api/projects/status/7e9bedtgp9m30p4m/branch/develop?svg=true)](https://ci.appveyor.com/project/cakecontrib/cake-issues-msbuild/branch/develop)|[![Build status](https://ci.appveyor.com/api/projects/status/7e9bedtgp9m30p4m/branch/master?svg=true)](https://ci.appveyor.com/project/cakecontrib/cake-issues-msbuild/branch/master)|
|Azure DevOps Windows|[![Build Status](https://dev.azure.com/cake-contrib/Cake.Issues.MsBuild/_apis/build/status/cake-contrib.Cake.Issues.MsBuild?branchName=develop&jobName=Windows)](https://dev.azure.com/cake-contrib/Cake.Issues.MsBuild/_build/latest?definitionId=6?branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.Issues.MsBuild/_apis/build/status/cake-contrib.Cake.Issues.MsBuild?branchName=master&jobName=Windows)](https://dev.azure.com/cake-contrib/Cake.Issues.MsBuild/_build/latest?definitionId=6?branchName=master)|


|Develop|Master|
|:--:|:--:|
|[![Build status](https://ci.appveyor.com/api/projects/status/7e9bedtgp9m30p4m/branch/develop?svg=true)](https://ci.appveyor.com/project/cakecontrib/cake-issues-msbuild/branch/develop)|[![Build status](https://ci.appveyor.com/api/projects/status/7e9bedtgp9m30p4m/branch/develop?svg=true)](https://ci.appveyor.com/project/cakecontrib/cake-issues-msbuild/branch/master)|
Expand Down
16 changes: 16 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
trigger:
- develop
- master
- release/*
- hotfix/*

pr:
- develop

jobs:
- job: Windows
pool:
vmImage: 'vs2017-win2016'
steps:
- powershell: ./build.ps1
displayName: 'Cake Build'
2 changes: 1 addition & 1 deletion nuspec/nuget/Cake.Issues.MsBuild.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ See the Project Site for an overview of the whole ecosystem of addins for workin
<repository type="git" url="https://github.com/cake-contrib/Cake.Issues.MsBuild"/>
<copyright>Copyright © BBT Software AG and contributors</copyright>
<tags>Cake Script Cake-Issues Cake-IssueProvider CodeAnalysis Linting MsBuild</tags>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues.MsBuild/releases/tag/0.6.2</releaseNotes>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues.MsBuild/releases/tag/0.6.3</releaseNotes>
</metadata>
<files>
<file src="netstandard2.0\Cake.Issues.MsBuild.dll" target="lib\netstandard2.0" />
Expand Down
19 changes: 9 additions & 10 deletions src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<None Remove="Testfiles\IssueWithOnlyFileName.xml" />
<None Remove="Testfiles\IssueWithoutCode.xml" />
<None Remove="Testfiles\IssueWithoutFile.xml" />
<None Remove="Testfiles\XmlFileLoggerLogFileFormat\IssueWithAbsoluteFileNameAndWithoutTask.xml" />
<None Remove="Testfiles\XmlFileLoggerLogFileFormat\IssueWithoutMessage.xml" />
<None Remove="Testfiles\XmlFileLoggerLogFileFormat\LogWithControlChars.xml" />
</ItemGroup>
Expand All @@ -39,25 +40,23 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
<PackageReference Include="Cake.Core" Version="0.28.0" />
<PackageReference Include="Cake.Testing" Version="0.28.0" />
<PackageReference Include="Cake.Issues" Version="0.6.0" />
<PackageReference Include="Cake.Issues.Testing" Version="0.6.0" />
<PackageReference Include="Shouldly" Version="3.0.0" />
<PackageReference Include="Shouldly" Version="3.0.2" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.0-beta009" />
<PackageReference Include="xunit" Version="2.4.0" />
<PackageReference Include="xunit.abstractions" Version="2.0.2" />
<PackageReference Include="xunit.analyzers" Version="0.10.0" />
<PackageReference Include="xunit.assert" Version="2.4.0" />
<PackageReference Include="xunit.core" Version="2.4.0" />
<PackageReference Include="xunit.extensibility.core" Version="2.4.0" />
<PackageReference Include="xunit.extensibility.execution" Version="2.4.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Cake.Issues.MsBuild\Cake.Issues.MsBuild.csproj" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Testfiles\XmlFileLoggerLogFileFormat\IssueWithAbsoluteFileNameAndWithoutTask.xml" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void Should_Read_Full_Log_Correct()
{
// Given
var fixture = new MsBuildIssuesProviderFixture<BinaryLogFileFormat>("FullLog.binlog");
fixture.RepositorySettings = new RepositorySettings(@"c:\Git\Test\Cake.Prca\");
fixture.RepositorySettings = new RepositorySettings(@"C:\projects\cake-issues-demo\");

// When
var issues = fixture.ReadIssues().ToList();
Expand Down Expand Up @@ -66,130 +66,130 @@ public void Should_Read_Full_Log_Correct()
"ClassLibrary1",
@"src\ClassLibrary1\Class1.cs",
1,
"SA1200",
"SA1633",
300,
"Warning",
@"Using directive must appear within a namespace declaration");
@"The file header is missing or not located at the top of the file.");
CheckIssue(
issues[3],
@"src\ClassLibrary1\ClassLibrary1.csproj",
"ClassLibrary1",
@"src\ClassLibrary1\Class1.cs",
2,
"SA1200",
@"src\ClassLibrary1\Properties\AssemblyInfo.cs",
1,
"SA1652",
300,
"Warning",
@"Using directive must appear within a namespace declaration");
@"Enable XML documentation output");
CheckIssue(
issues[4],
@"src\ClassLibrary1\ClassLibrary1.csproj",
"ClassLibrary1",
@"src\ClassLibrary1\Class1.cs",
3,
"SA1200",
@"src\ClassLibrary1\Properties\AssemblyInfo.cs",
1,
"SA1633",
300,
"Warning",
@"Using directive must appear within a namespace declaration");
@"The file header is missing or not located at the top of the file.");
CheckIssue(
issues[5],
@"src\ClassLibrary1\ClassLibrary1.csproj",
"ClassLibrary1",
@"src\ClassLibrary1\Class1.cs",
4,
"SA1200",
@"src\ClassLibrary1\Properties\AssemblyInfo.cs",
5,
"SA1028",
300,
"Warning",
@"Using directive must appear within a namespace declaration");
@"Code must not contain trailing whitespace");
CheckIssue(
issues[6],
@"src\ClassLibrary1\ClassLibrary1.csproj",
"ClassLibrary1",
@"src\ClassLibrary1\Class1.cs",
5,
"SA1200",
@"src\ClassLibrary1\Properties\AssemblyInfo.cs",
17,
"SA1028",
300,
"Warning",
@"Using directive must appear within a namespace declaration");
@"Code must not contain trailing whitespace");
CheckIssue(
issues[7],
@"src\ClassLibrary1\ClassLibrary1.csproj",
"ClassLibrary1",
@"src\ClassLibrary1\Class1.cs",
1,
"SA1633",
@"src\ClassLibrary1\Properties\AssemblyInfo.cs",
18,
"SA1028",
300,
"Warning",
@"The file header is missing or not located at the top of the file.");
@"Code must not contain trailing whitespace");
CheckIssue(
issues[8],
@"src\ClassLibrary1\ClassLibrary1.csproj",
"ClassLibrary1",
@"src\ClassLibrary1\Properties\AssemblyInfo.cs",
1,
"SA1652",
28,
"SA1028",
300,
"Warning",
@"Enable XML documentation output");
@"Code must not contain trailing whitespace");
CheckIssue(
issues[9],
@"src\ClassLibrary1\ClassLibrary1.csproj",
"ClassLibrary1",
@"src\ClassLibrary1\Properties\AssemblyInfo.cs",
1,
"SA1633",
32,
"SA1028",
300,
"Warning",
@"The file header is missing or not located at the top of the file.");
@"Code must not contain trailing whitespace");
CheckIssue(
issues[10],
@"src\ClassLibrary1\ClassLibrary1.csproj",
"ClassLibrary1",
@"src\ClassLibrary1\Properties\AssemblyInfo.cs",
5,
"SA1028",
@"src\ClassLibrary1\Class1.cs",
1,
"SA1200",
300,
"Warning",
@"Code must not contain trailing whitespace");
@"Using directive must appear within a namespace declaration");
CheckIssue(
issues[11],
@"src\ClassLibrary1\ClassLibrary1.csproj",
"ClassLibrary1",
@"src\ClassLibrary1\Properties\AssemblyInfo.cs",
17,
"SA1028",
@"src\ClassLibrary1\Class1.cs",
2,
"SA1200",
300,
"Warning",
@"Code must not contain trailing whitespace");
@"Using directive must appear within a namespace declaration");
CheckIssue(
issues[12],
@"src\ClassLibrary1\ClassLibrary1.csproj",
"ClassLibrary1",
@"src\ClassLibrary1\Properties\AssemblyInfo.cs",
18,
"SA1028",
@"src\ClassLibrary1\Class1.cs",
3,
"SA1200",
300,
"Warning",
@"Code must not contain trailing whitespace");
@"Using directive must appear within a namespace declaration");
CheckIssue(
issues[13],
@"src\ClassLibrary1\ClassLibrary1.csproj",
"ClassLibrary1",
@"src\ClassLibrary1\Properties\AssemblyInfo.cs",
28,
"SA1028",
@"src\ClassLibrary1\Class1.cs",
4,
"SA1200",
300,
"Warning",
@"Code must not contain trailing whitespace");
@"Using directive must appear within a namespace declaration");
CheckIssue(
issues[14],
@"src\ClassLibrary1\ClassLibrary1.csproj",
"ClassLibrary1",
@"src\ClassLibrary1\Properties\AssemblyInfo.cs",
32,
"SA1028",
@"src\ClassLibrary1\Class1.cs",
5,
"SA1200",
300,
"Warning",
@"Code must not contain trailing whitespace");
@"Using directive must appear within a namespace declaration");
CheckIssue(
issues[15],
@"src\ClassLibrary1\ClassLibrary1.csproj",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace Cake.Issues.MsBuild.Tests.LogFileFormat
{
using System.IO;
using System.Linq;
using Cake.Core.Diagnostics;
using Cake.Core.IO;
Expand Down Expand Up @@ -364,7 +365,6 @@ public void Should_Ignore_Issue_Without_Message()
issues.Count.ShouldBe(0);
}


[Fact]
public void Should_Filter_Control_Chars_From_Log_Content()
{
Expand All @@ -378,6 +378,40 @@ public void Should_Filter_Control_Chars_From_Log_Content()
issues.Count.ShouldBe(0);
}

[Fact]
public void Should_Read_Issue_With_Absolute_FileName_And_Without_Task()
{
var fixture = new MsBuildIssuesProviderFixture<XmlFileLoggerLogFileFormat>("IssueWithAbsoluteFileNameAndWithoutTask.xml");

var repoRootCreated = !Directory.Exists(fixture.RepositorySettings.RepositoryRoot.FullPath);
Directory.CreateDirectory(fixture.RepositorySettings.RepositoryRoot.FullPath);
try
{
var oldWorkingDirectory = Directory.GetCurrentDirectory();
try
{
Directory.SetCurrentDirectory(fixture.RepositorySettings.RepositoryRoot.FullPath);

// When
var issues = fixture.ReadIssues().ToList();

// Then
issues.Count.ShouldBe(1);
}
finally
{
Directory.SetCurrentDirectory(oldWorkingDirectory);
}
}
finally
{
if (repoRootCreated)
{
Directory.Delete(fixture.RepositorySettings.RepositoryRoot.FullPath);
}
}
}

private static void CheckIssue(
IIssue issue,
string projectFileRelativePath,
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<build started="3/11/2019 22:29:45">
<warning code="SA1633" file="File.cs" line="1" column="1" started="3/11/2019 22:29:59"><![CDATA[The file header is missing or not located at the top of the file.]]></warning>
</build>
4 changes: 2 additions & 2 deletions src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
<ItemGroup>
<PackageReference Include="Cake.Core" Version="0.28.0" />
<PackageReference Include="Cake.Issues" Version="0.6.0" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.6.1" />
<PackageReference Include="MSBuild.StructuredLogger" Version="2.0.4" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.6.3" />
<PackageReference Include="MSBuild.StructuredLogger" Version="2.0.68" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.0-beta009" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,10 @@ private static bool TryGetRule(XElement warning, out string rule)
var compileTaskDirectory = System.IO.Path.GetDirectoryName(parentFileAttr.Value);
fileName = System.IO.Path.Combine(compileTaskDirectory, fileName);
}
else
{
fileName = System.IO.Path.Combine(repositorySettings.RepositoryRoot.FullPath, fileName);
}
}

// Validate file path and make relative to repository root.
Expand Down
2 changes: 1 addition & 1 deletion tools/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Cake" version="0.30.0" />
<package id="Cake" version="0.32.0" />
</packages>

0 comments on commit 0bf84d1

Please sign in to comment.