Skip to content

Commit

Permalink
Merge pull request #1428 from FakeItEasy/release/4.8.1
Browse files Browse the repository at this point in the history
Release 4.8.1
  • Loading branch information
thomaslevesque committed Sep 4, 2018
2 parents 4d876c1 + 7b56464 commit 0a28896
Show file tree
Hide file tree
Showing 42 changed files with 585 additions and 474 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
.githubtoken
.nuget
.vs
[Oo]bj
[Bb]in
[Oo]bjcs
[Oo]bjvb
artifacts
packages
src/VersionInfo.cs
src/FakeItEasy.nuspec
tools/packages.config.sha1
tools/FakeItEasy.Build/ToolPaths.cs

*.*proj.user
*.lock.json
Expand Down
12 changes: 6 additions & 6 deletions FakeItEasy.sln
Original file line number Diff line number Diff line change
Expand Up @@ -115,24 +115,23 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FakeItEasy", "src\FakeItEas
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FakeItEasy.Analyzer.VisualBasic.Tests", "tests\FakeItEasy.Analyzer.VisualBasic.Tests\FakeItEasy.Analyzer.VisualBasic.Tests.csproj", "{C37E7B74-DCA9-47FF-BAA1-EBC2ECB2C72F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FakeItEasy.Analyzer.CSharp", "src\FakeItEasy.Analyzer\FakeItEasy.Analyzer.CSharp.csproj", "{EF850910-1B7F-4824-8034-0A935B8C9152}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FakeItEasy.Analyzer.CSharp", "src\FakeItEasy.Analyzer.CSharp\FakeItEasy.Analyzer.CSharp.csproj", "{EF850910-1B7F-4824-8034-0A935B8C9152}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FakeItEasy.Analyzer.VisualBasic", "src\FakeItEasy.Analyzer\FakeItEasy.Analyzer.VisualBasic.csproj", "{C0B3EF5F-222E-4FD4-9B42-161AC6C56CB5}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FakeItEasy.Analyzer.VisualBasic", "src\FakeItEasy.Analyzer.VisualBasic\FakeItEasy.Analyzer.VisualBasic.csproj", "{C0B3EF5F-222E-4FD4-9B42-161AC6C56CB5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{9D99B251-FB4F-49BF-8405-F6E0DE46EB32}"
ProjectSection(SolutionItems) = preProject
tools\build.csx = tools\build.csx
tools\deploy.ps1 = tools\deploy.ps1
tools\packages.config = tools\packages.config
tools\prepare_release.cmd = tools\prepare_release.cmd
tools\prepare_release.csx = tools\prepare_release.csx
tools\run-csx.cmd = tools\run-csx.cmd
EndProjectSection
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "FakeItEasy.Analyzer.Shared", "src\FakeItEasy.Analyzer.Shared\FakeItEasy.Analyzer.Shared.shproj", "{E3ED4908-BC8D-4D81-A31B-8CD0B67F41B4}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
tests\FakeItEasy.Analyzer.Tests.Shared\FakeItEasy.Analyzer.Tests.Shared.projitems*{38f3191b-1ce0-4ee0-930f-794a2f2f4cdb}*SharedItemsImports = 4
tests\FakeItEasy.Analyzer.Tests.Shared\FakeItEasy.Analyzer.Tests.Shared.projitems*{c37e7b74-dca9-47ff-baa1-ebc2ecb2c72f}*SharedItemsImports = 4
src\FakeItEasy.Analyzer.Shared\FakeItEasy.Analyzer.Shared.projitems*{e3ed4908-bc8d-4d81-a31b-8cd0b67f41b4}*SharedItemsImports = 13
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -209,6 +208,7 @@ Global
{C37E7B74-DCA9-47FF-BAA1-EBC2ECB2C72F} = {DC5EAE30-96E3-4D38-B3C5-33E587C9FB76}
{EF850910-1B7F-4824-8034-0A935B8C9152} = {59466C4D-C407-4DD9-B77B-D99162B9FC7C}
{C0B3EF5F-222E-4FD4-9B42-161AC6C56CB5} = {59466C4D-C407-4DD9-B77B-D99162B9FC7C}
{E3ED4908-BC8D-4D81-A31B-8CD0B67F41B4} = {59466C4D-C407-4DD9-B77B-D99162B9FC7C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E70BBF50-5920-49F2-835D-4A2DBD73F0E1}
Expand Down
4 changes: 3 additions & 1 deletion build.cmd
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
@call %~dp0\tools\run-csx.cmd %~dp0\tools\build.csx %*
@pushd %~dp0
@dotnet run --project ".\tools\FakeItEasy.Build\FakeItEasy.Build.csproj" -- %*
@popd
2 changes: 1 addition & 1 deletion how_to_build.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ After the build has completed, the build artifacts will be located in `artifacts

## Extras

`build.cmd` wraps a [simple-targets-csx](https://github.com/adamralph/simple-targets-csx) script, so you can use all the usual command line arguments that you would use with simple-targets-csx , e.g.:
`build.cmd` wraps a [Bullseye](https://github.com/adamralph/bullseye) targets project, so you can use all the usual command line arguments that you would use with Bullseye, e.g.:

* View the full list of build targets:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@

<PropertyGroup>
<TargetFramework>netstandard1.1</TargetFramework>
<AssemblyName>FakeItEasy.Analyzer.CSharp</AssemblyName>
<RootNamespace>FakeItEasy.Analyzer</RootNamespace>
<AppDesignerFolder>Properties</AppDesignerFolder>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<FileAlignment>512</FileAlignment>
<SignAssembly>true</SignAssembly>
<DefineConstants>$(DefineConstants);CSHARP</DefineConstants>
<PackageTargetFallback>portable45-net45+win8</PackageTargetFallback>
<BaseIntermediateOutputPath>objcs\</BaseIntermediateOutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>

Expand All @@ -21,25 +19,6 @@
<PackageTags>$(PackageTags);csharp;c#</PackageTags>
</PropertyGroup>

<ItemGroup>
<EmbeddedResource Remove="VisualBasic/Resources.resx" />
<Compile Remove="objvb\**" />
<EmbeddedResource Remove="objvb\**" />
<None Remove="objvb\**" />
</ItemGroup>

<ItemGroup>
<Compile Include="../*.cs" />
</ItemGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DebugType>full</DebugType>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<DebugType>pdbonly</DebugType>
</PropertyGroup>

<ItemGroup>
<PackageReference Update="NetStandard.Library" Version="$(NetStandardImplicitPackageVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="1.1.0" PrivateAssets="all" />
Expand All @@ -52,4 +31,6 @@
<None Include="$(OutputPath)$(AssemblyName).pdb" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
</ItemGroup>

<Import Project="..\FakeItEasy.Analyzer.Shared\FakeItEasy.Analyzer.Shared.projitems" Label="Shared" />

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ internal static class DiagnosticDefinitions
ResourceBaseName,
typeof(DiagnosticDefinitions).GetTypeInfo().Assembly);

#if CSHARP
private const string ResourceBaseName = "FakeItEasy.Analyzer.CSharp.Resources";
#elif VISUAL_BASIC
private const string ResourceBaseName = "FakeItEasy.Analyzer.VisualBasic.Resources";
#endif
private const string ResourceBaseName = "FakeItEasy.Analyzer.Resources";

public static DiagnosticDescriptor UnusedCallSpecification { get; } =
CreateDiagnosticDescriptor(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<HasSharedItems>true</HasSharedItems>
<SharedGUID>e3ed4908-bc8d-4d81-a31b-8cd0b67f41b4</SharedGUID>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<Import_RootNamespace>FakeItEasy.Analyzer</Import_RootNamespace>
</PropertyGroup>
<PropertyGroup>
<PackageTags>FakeItEasy;analyzer</PackageTags>
<IncludeBuildOutput>false</IncludeBuildOutput>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)FakeItEasy.Analyzer.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DebugType>full</DebugType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<DebugType>pdbonly</DebugType>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)..\*.cs" />
</ItemGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)ArgumentConstraintAnalyzerBase.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ArgumentConstraintOutsideCallSpecAnalyzer.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ArgumentConstraintTypeMismatchAnalyzer.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ArgumentConstraintTypeMismatchCodeFixProvider.cs" />
<Compile Include="$(MSBuildThisFileDirectory)DiagnosticDefinitions.cs" />
<Compile Include="$(MSBuildThisFileDirectory)NonVirtualSetupAnalyzer.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Properties\AssemblyInfo.cs" />
<Compile Include="$(MSBuildThisFileDirectory)RepeatedAssertionAnalyzer.cs" />
<Compile Include="$(MSBuildThisFileDirectory)RepeatedAssertionCodeFixProvider.cs" />
<Compile Include="$(MSBuildThisFileDirectory)SymbolExtensions.cs" />
<Compile Include="$(MSBuildThisFileDirectory)SymbolHelpers.cs" />
<Compile Include="$(MSBuildThisFileDirectory)SyntaxExtensions.cs" />
<Compile Include="$(MSBuildThisFileDirectory)SyntaxHelpers.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UnusedReturnValueAnalyzer.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="$(MSBuildThisFileDirectory)tools\install.ps1" Pack="true" PackagePath="tools/%(Filename)%(Extension)" />
<Content Include="$(MSBuildThisFileDirectory)tools\uninstall.ps1" Pack="true" PackagePath="tools/%(Filename)%(Extension)" />
</ItemGroup>
</Project>
13 changes: 13 additions & 0 deletions src/FakeItEasy.Analyzer.Shared/FakeItEasy.Analyzer.Shared.shproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>e3ed4908-bc8d-4d81-a31b-8cd0b67f41b4</ProjectGuid>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
<PropertyGroup />
<Import Project="FakeItEasy.Analyzer.Shared.projitems" Label="Shared" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
</Project>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@

<PropertyGroup>
<TargetFramework>netstandard1.1</TargetFramework>
<AssemblyName>FakeItEasy.Analyzer.VisualBasic</AssemblyName>
<RootNamespace>FakeItEasy.Analyzer</RootNamespace>
<AppDesignerFolder>Properties</AppDesignerFolder>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<FileAlignment>512</FileAlignment>
<SignAssembly>true</SignAssembly>
<DefineConstants>$(DefineConstants);VISUAL_BASIC</DefineConstants>
<PackageTargetFallback>portable45-net45+win8</PackageTargetFallback>
<BaseIntermediateOutputPath>objvb\</BaseIntermediateOutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>

Expand All @@ -21,25 +19,6 @@
<PackageTags>$(PackageTags);visualbasic;vb;vb.net</PackageTags>
</PropertyGroup>

<ItemGroup>
<EmbeddedResource Remove="CSharp/Resources.resx" />
<Compile Remove="objcs\**" />
<EmbeddedResource Remove="objcs\**" />
<None Remove="objcs\**" />
</ItemGroup>

<ItemGroup>
<Compile Include="../*.cs" />
</ItemGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DebugType>full</DebugType>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<DebugType>pdbonly</DebugType>
</PropertyGroup>

<ItemGroup>
<PackageReference Update="NetStandard.Library" Version="$(NetStandardImplicitPackageVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="1.1.0" PrivateAssets="all" />
Expand All @@ -51,5 +30,7 @@
<None Include="$(OutputPath)$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/vb" Visible="false" />
<None Include="$(OutputPath)$(AssemblyName).pdb" Pack="true" PackagePath="analyzers/dotnet/vb" Visible="false" />
</ItemGroup>

<Import Project="..\FakeItEasy.Analyzer.Shared\FakeItEasy.Analyzer.Shared.projitems" Label="Shared" />

</Project>
16 changes: 0 additions & 16 deletions src/FakeItEasy.Analyzer/Directory.Build.props

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="1.1.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="1.1.0" />
<PackageReference Include="System.Collections.Immutable" Version="1.2.0" />
<ProjectReference Include="..\..\src\FakeItEasy.Analyzer\FakeItEasy.Analyzer.CSharp.csproj" />
<ProjectReference Include="..\..\src\FakeItEasy.Analyzer.CSharp\FakeItEasy.Analyzer.CSharp.csproj" />
<ProjectReference Include="..\..\src\FakeItEasy\FakeItEasy.csproj" />
<ProjectReference Include="..\FakeItEasy.Tests\FakeItEasy.Tests.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageReference Include="Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version="1.1.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="1.1.0" />
<PackageReference Include="System.Collections.Immutable" Version="1.2.0" />
<ProjectReference Include="..\..\src\FakeItEasy.Analyzer\FakeItEasy.Analyzer.VisualBasic.csproj" />
<ProjectReference Include="..\..\src\FakeItEasy.Analyzer.VisualBasic\FakeItEasy.Analyzer.VisualBasic.csproj" />
<ProjectReference Include="..\..\src\FakeItEasy\FakeItEasy.csproj" />
<ProjectReference Include="..\FakeItEasy.Tests\FakeItEasy.Tests.csproj" />
</ItemGroup>
Expand Down
9 changes: 9 additions & 0 deletions tests/FakeItEasy.Specs/CreationSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,13 @@ public interface IInterfaceWithSimilarMethods
"And the class has a one-parameter constructor that succeeds"
.See(() => new ClassWhosePreferredConstructorsThrow(default));

// If multiple theads attempt to create the fake at the same time, the
// unsuccessful constructors may be called more than once, so serialize fake
// creation for this test.
"And nobody else is trying to fake the class right now"
.x(() => ClassWhosePreferredConstructorsThrow.FakingLock.Wait(TimeSpan.FromSeconds(30)))
.Teardown(() => ClassWhosePreferredConstructorsThrow.FakingLock.Set());

"When I create a fake of the class"
.x(() => fake1 = this.CreateFake<ClassWhosePreferredConstructorsThrow>());

Expand All @@ -183,6 +190,8 @@ public interface IInterfaceWithSimilarMethods

public class ClassWhosePreferredConstructorsThrow
{
public static ManualResetEventSlim FakingLock { get; } = new ManualResetEventSlim(true);

public static int NumberOfTimesParameterlessConstructorWasCalled => numberOfTimesParameterlessConstructorWasCalled;

public static int NumberOfTimesTwoParameterConstructorWasCalled => numberOfTimesTwoParameterConstructorWasCalled;
Expand Down
11 changes: 10 additions & 1 deletion tests/FakeItEasy.Specs/DummyCreationSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,14 @@ public abstract class DummyCreationSpecsBase
"And its longer constructor throws"
.See(() => new ClassWhoseLongerConstructorThrows(0, 0));

"And a dummy of that type is requested"
// If multiple theads attempt to create the dummy at the same time, the
// unsuccessful constructors may be called more than once, so serialize dummy
// creation for this test.
"And nobody else is trying to create a dummy of the class right now"
.x(() => ClassWhoseLongerConstructorThrows.DummyingLock.Wait(TimeSpan.FromSeconds(30)))
.Teardown(() => ClassWhoseLongerConstructorThrows.DummyingLock.Set());

"When a dummy of that type is requested"
.x(() => dummy1 = this.CreateDummy<ClassWhoseLongerConstructorThrows>());

"And another dummy of that type is requested"
Expand Down Expand Up @@ -428,6 +435,8 @@ protected override Foo Create()

public sealed class ClassWhoseLongerConstructorThrows
{
public static ManualResetEventSlim DummyingLock { get; } = new ManualResetEventSlim(true);

private static int numberOfTimesLongerConstructorWasCalled;

public string CalledConstructor { get; }
Expand Down
13 changes: 13 additions & 0 deletions tools/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project>

<Import Project="../Directory.Build.props" />

<PropertyGroup>
<NoWarn>$(NoWarn),SA0001</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Remove="Microsoft.CodeAnalysis.FxCopAnalyzers" />
</ItemGroup>

</Project>
43 changes: 43 additions & 0 deletions tools/FakeItEasy.Build/FakeItEasy.Build.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<PdbGitEnabled>false</PdbGitEnabled>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Bullseye" Version="1.2.0" />
<PackageReference Include="SimpleExec" Version="2.3.0" />
<PackageReference Include="GitVersion.CommandLine" Version="4.0.0-beta0012" ToolName="GitVersion" ToolExe="GitVersion.exe" />
<PackageReference Include="PdbGit" Version="3.0.41" ToolName="PdbGit" ToolExe="PdbGit.exe" />
<PackageReference Include="xunit.runner.console" Version="2.0.0" ToolName="XUnit" ToolExe="xunit.console.exe" />
<PackageReference Include="vswhere" Version="1.0.62" ToolName="VSWhere" ToolExe="vswhere.exe" />
<PackageReference Include="NuGet.CommandLine" Version="4.1.0" ToolName="NuGet" ToolExe="nuget.exe" />
</ItemGroup>

<Target Name="GenerateToolPaths" BeforeTargets="BeforeBuild">
<PropertyGroup>
<ClassName>ToolPaths</ClassName>
<OutputFile>$(ClassName).cs</OutputFile>
</PropertyGroup>
<ItemGroup>
<Tool Include="@(PackageReference)" Condition="'%(PackageReference.ToolName)' != ''" />
<Compile Remove="$(OutputFile)" />
<Compile Include="$(OutputFile)" />
</ItemGroup>
<PropertyGroup>
<Semicolon>%3B</Semicolon>
<Indent>%20%20%20%20%20%20%20%20</Indent>
<FileContent><![CDATA[namespace FakeItEasy.Build
{
internal static class $(ClassName)
{
@(Tool -> '$(Indent)public const string %(ToolName) = @"$(NuGetPackageRoot)%(Identity)\%(Version)\tools\%(ToolExe)"$(Semicolon)')
}
}]]></FileContent>
</PropertyGroup>
<WriteLinesToFile File="$(OutputFile)" Overwrite="true" Encoding="UTF-8" Lines="$(FileContent)" />
</Target>

</Project>
Loading

0 comments on commit 0a28896

Please sign in to comment.