Skip to content

Commit

Permalink
rename Exclude property to ExcludeByFile
Browse files Browse the repository at this point in the history
  • Loading branch information
tonerdo committed May 13, 2018
1 parent 9d09fde commit ebedd70
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 62 deletions.
116 changes: 58 additions & 58 deletions src/coverlet.msbuild.tasks/InstrumentationTask.cs
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
using System;
using Coverlet.Core;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;

namespace Coverlet.MSbuild.Tasks
{
public class InstrumentationTask : Task
{
private static Coverage _coverage;
private string _path;
private string _filter;
private string _exclude;

internal static Coverage Coverage
{
get { return _coverage; }
}

[Required]
public string Path
{
get { return _path; }
set { _path = value; }
}

public string Filter
{
get { return _filter; }
set { _filter = value; }
}

public string Exclude
{
get { return _exclude; }
set { _exclude = value; }
}

public override bool Execute()
{
try
{
var excludes = _exclude?.Split(',');
var filters = _filter?.Split(',');

_coverage = new Coverage(_path, Guid.NewGuid().ToString(), filters, excludes);
_coverage.PrepareModules();
}
catch (Exception ex)
{
Log.LogErrorFromException(ex);
return false;
}

return true;
}
}
}
using System;
using Coverlet.Core;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;

namespace Coverlet.MSbuild.Tasks
{
public class InstrumentationTask : Task
{
private static Coverage _coverage;
private string _path;
private string _filter;
private string _excludeByFile;

internal static Coverage Coverage
{
get { return _coverage; }
}

[Required]
public string Path
{
get { return _path; }
set { _path = value; }
}

public string Filter
{
get { return _filter; }
set { _filter = value; }
}

public string ExcludeByFile
{
get { return _excludeByFile; }
set { _excludeByFile = value; }
}

public override bool Execute()
{
try
{
var excludes = _excludeByFile?.Split(',');
var filters = _filter?.Split(',');

_coverage = new Coverage(_path, Guid.NewGuid().ToString(), filters, excludes);
_coverage.PrepareModules();
}
catch (Exception ex)
{
Log.LogErrorFromException(ex);
return false;
}

return true;
}
}
}
4 changes: 2 additions & 2 deletions src/coverlet.msbuild/coverlet.msbuild.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<CoverletOutputName Condition=" '$(CoverletOutputName)' == '' ">coverage</CoverletOutputName>
<CoverletOutput>$([MSBuild]::EnsureTrailingSlash('$(CoverletOutputDirectory)'))$(CoverletOutputName)</CoverletOutput>
<Filter Condition="$(Filter) == ''"></Filter>
<Exclude Condition="$(Exclude) == ''"></Exclude>
<ExcludeByFile Condition="$(ExcludeByFile) == ''"></ExcludeByFile>
<Threshold Condition="$(Threshold) == ''">0</Threshold>
<ThresholdType Condition="$(ThresholdType) == ''">line,branch,method</ThresholdType>
<CollectCoverage Condition="$(CollectCoverage) == ''">false</CollectCoverage>
</PropertyGroup>

</Project>
</Project>
4 changes: 2 additions & 2 deletions src/coverlet.msbuild/coverlet.msbuild.targets
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
<Target Name="InstrumentModulesNoBuild" BeforeTargets="VSTest">
<Coverlet.MSbuild.Tasks.InstrumentationTask
Condition="'$(VSTestNoBuild)' == 'true' and $(CollectCoverage) == 'true'"
Exclude="$(Exclude)"
ExcludeByFile="$(ExcludeByFile)"
Path="$(TargetPath)" />
</Target>

<Target Name="InstrumentModulesAfterBuild" AfterTargets="BuildProject">
<Coverlet.MSbuild.Tasks.InstrumentationTask
Condition="'$(VSTestNoBuild)' != 'true' and $(CollectCoverage) == 'true'"
Filter="$(Filter)"
Exclude="$(Exclude)"
ExcludeByFile="$(ExcludeByFile)"
Path="$(TargetPath)" />
</Target>

Expand Down

0 comments on commit ebedd70

Please sign in to comment.