diff --git a/.editorconfig b/.editorconfig index c3b84ea8d..f782af64a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -12,10 +12,10 @@ end_of_line = CRLF indent_style = tab indent_size = 4 -[*.{sln,proj,props,targets,xml,config,nuspec}] +[*.{sln,proj,csproj,vbproj,props,targets,xml,xdoc,resx,config,nuspec}] indent_style = tab -indent_size = 4 +indent_size = 2 -[*.{csproj,resx}] +[appveyor.yml] indent_style = space -indent_size = 2 \ No newline at end of file +indent_size = 2 diff --git a/.gitignore b/.gitignore index 7ea923efe..90adce612 100644 --- a/.gitignore +++ b/.gitignore @@ -1,16 +1,8 @@ -.nuget out -build bin obj -lib -packages -*.nuget.targets -*.nuget.props -*.lock.json *.suo *.user *.cache .vs .* -log.txt diff --git a/Before.Moq.sln.targets b/Before.Moq.sln.targets index 55eac5f66..ebca5240d 100644 --- a/Before.Moq.sln.targets +++ b/Before.Moq.sln.targets @@ -1,6 +1,9 @@ - - + - + + + + + \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 000000000..8e14b5034 --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,12 @@ + + + + $(MSBuildThisFileDirectory) + $(RootDirectory)build\ + $(RootDirectory)out\ + Release + + + + + diff --git a/Moq.sln b/Moq.sln index 23d4ba3ea..7872447c6 100644 --- a/Moq.sln +++ b/Moq.sln @@ -5,12 +5,10 @@ MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A5A5B8C3-D43F-43C6-AEC7-6FA7C35B8BE9}" ProjectSection(SolutionItems) = preProject appveyor.yml = appveyor.yml - build.proj = build.proj CHANGELOG.md = CHANGELOG.md GitInfo.txt = GitInfo.txt License.txt = License.txt - Moq.nuspec = Moq.nuspec - packages.config = packages.config + src\Moq\Moq.nuspec = src\Moq\Moq.nuspec README.md = README.md EndProjectSection EndProject diff --git a/NuGet.Restore.targets b/NuGet.Restore.targets deleted file mode 100644 index 7dafd997f..000000000 --- a/NuGet.Restore.targets +++ /dev/null @@ -1,91 +0,0 @@ - - - - - $(MSBuildThisFileDirectory).nuget - - - - $(NuGetPath)\NuGet.exe - $(LocalAppData)\NuGet\NuGet.exe - - - - nuget - - - - - - - - - - Restore - - - - - - - - - - - - - - $([System.IO.Path]::GetDirectoryName('$(SolutionPath)')) - - - - - <_NuGet>$(NuGet.Replace('$(RestoreDir)', '').TrimStart('/').TrimStart('\')) - - - - - - - - - - - - - - - - - <_RestoreSolution Condition=" '$(OS)' != 'Unix' ">$(_RestoreSolution.Replace('$(RestoreDir)', '').TrimStart('/').TrimStart('\')) - <_RestoreOutput Condition=" '$(OS)' != 'Unix' And '$(_RestoreOutput)' != ''">$(_RestoreOutput.Replace('$(RestoreDir)', '').TrimStart('/').TrimStart('\')) - - <_RestoreCommand Condition=" '$(_RestoreCommand)' == '' ">Restore - - - - - - - - - - %WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe - - - - - - - - - - diff --git a/README.md b/README.md index 4d1af4e42..11a6505f2 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ The most popular and friendly mocking framework for .NET [![Version](https://img.shields.io/nuget/v/Moq.svg)](https://www.nuget.org/packages/Moq) [![Downloads](https://img.shields.io/nuget/dt/Moq.svg)](https://www.nuget.org/packages/Moq) [![Join the chat at https://gitter.im/moq/moq](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/moq/moq?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![CoreBuild Standard](https://img.shields.io/badge/√_corebuild-standard-blue.svg)](http://www.corebuild.io) ```csharp diff --git a/appveyor.yml b/appveyor.yml index 0eea7af5f..59d053762 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,11 +3,13 @@ image: Visual Studio 2017 init: - git config --global core.autocrlf input +environment: + MSBUILD_LOGGER: C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll + build_script: - - cmd: >- - build.cmd /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" + - msbuild build\AppVeyor.proj /r /t:UpdateBuildVersion /logger:"%MSBUILD_LOGGER%" + - msbuild Moq.sln /r /t:Build;Test;Pack /logger:"%MSBUILD_LOGGER%" -# we run the tests ourselves in build.cmd for coverage test: off deploy: diff --git a/build.cmd b/build.cmd deleted file mode 100644 index 54764b457..000000000 --- a/build.cmd +++ /dev/null @@ -1,42 +0,0 @@ -:: Optional batch file to quickly build with some defaults. -:: Alternatively, this batch file can be invoked passing msbuild parameters, like: build.cmd /v:detailed /t:Rebuild - -@ECHO OFF -SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION -PUSHD "%~dp0" >NUL - -SET CACHED_NUGET=%LocalAppData%\NuGet\NuGet.exe - -:: Determine if MSBuild can be located. Allows for a better error message below. -where msbuild > %TEMP%\msbuild.txt -set /p msb=<%TEMP%\msbuild.txt - -IF "%msb%"=="" ( - echo Please run %~n0 from a Visual Studio Developer Command Prompt. - exit /b -1 -) - -IF EXIST %CACHED_NUGET% goto copynuget -echo Downloading latest version of NuGet.exe... -IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet -@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/latest/nuget.exe' -OutFile '%CACHED_NUGET%'" - -:copynuget -IF EXIST .nuget\nuget.exe goto restore -md .nuget -copy %CACHED_NUGET% .nuget\nuget.exe > nul -.nuget\nuget.exe update -self - -:restore -:: Build script packages have no version in the path, so we install them to .nuget\packages to avoid conflicts with -:: solution/project packages. -IF NOT EXIST packages.config goto run -.nuget\NuGet.exe install packages.config -OutputDirectory .nuget\packages -ExcludeVersion - -:run -echo Running "%msb%" build.proj /v:normal %1 %2 %3 %4 %5 %6 %7 %8 %9 -"%msb%" build.proj /v:normal %1 %2 %3 %4 %5 %6 %7 %8 %9 - -POPD >NUL -ENDLOCAL -ECHO ON diff --git a/build.proj b/build.proj deleted file mode 100644 index 4e13cc499..000000000 --- a/build.proj +++ /dev/null @@ -1,121 +0,0 @@ - - - - - Release - .nuget\ - $(IntermediateOutputPath)packages - out - WarningLevel=0;NoWarn=1591;RunCodeAnalysis=false;Configuration=$(Configuration);SourceLinkCreate=true - high - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(PackagesPath)\OpenCover\tools\OpenCover.Console.exe - $(CoverageOptions) -output:$(Out)\coverage.xml -returntargetcode -register:user -filter:"+[Moq.*]* -[xunit*]* -[*.Tests]* -[*]*ThisAssembly* -[*]*IFluentInterface*" -excludebyattribute:*ExcludeFromCodeCoverage*;*CompilerGenerated* -skipautoprops -showunvisited -mergebyhash -hideskipped:All - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(PackagesPath)\GitInfo\build\GitInfo.targets - true - - - - - - - - - - - - - - $(GitSemVerMajor).$(GitSemVerMinor).$(GitSemVerPatch)$(GitSemVerDashLabel) - - - - - - - - diff --git a/build/AppVeyor.proj b/build/AppVeyor.proj new file mode 100644 index 000000000..483303b20 --- /dev/null +++ b/build/AppVeyor.proj @@ -0,0 +1,19 @@ + + + + + + netstandard1.0 + + + + + $(GitBaseVersion) + $(BuildVersion).$(GitCommits) + $(BuildVersion)+sha.$(GitCommit) + + + + + diff --git a/build/AssemblyInfo.props b/build/AssemblyInfo.props new file mode 100644 index 000000000..157671d45 --- /dev/null +++ b/build/AssemblyInfo.props @@ -0,0 +1,11 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + True + $(MSBuildProjectName) + Moq + Clarius Consulting, Manas Technology Solutions, InSTEDD + + + diff --git a/build/GitVersion.props b/build/GitVersion.props new file mode 100644 index 000000000..f8697eea4 --- /dev/null +++ b/build/GitVersion.props @@ -0,0 +1,30 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + True + True + False + + + + + + + + + $(GitBaseVersionMajor).$(GitBaseVersionMinor).0.0 + $(GitBaseVersion).$(GitCommits) + $(GitBaseVersion)$(GitSemVerDashLabel)+sha.$(GitCommit) + $(GitBaseVersion).$(GitCommits)$(GitSemVerDashLabel)+sha.$(GitCommit) + + + + + + $(GitSemVerMajor).$(GitSemVerMinor).$(GitSemVerPatch)$(GitSemVerDashLabel) + configuration=$(Configuration);version=$(PackageVersion) + + + + diff --git a/build/SignAssembly.props b/build/SignAssembly.props new file mode 100644 index 000000000..732e172fd --- /dev/null +++ b/build/SignAssembly.props @@ -0,0 +1,11 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + True + False + False + $(RootDirectory)Moq.snk + + + diff --git a/build/SourceLink.props b/build/SourceLink.props new file mode 100644 index 000000000..fbfcf048a --- /dev/null +++ b/build/SourceLink.props @@ -0,0 +1,12 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + True + + + + + + + diff --git a/build/xUnit.props b/build/xUnit.props new file mode 100644 index 000000000..0332c791e --- /dev/null +++ b/build/xUnit.props @@ -0,0 +1,18 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + + + + + + + + + + + + diff --git a/packages.config b/packages.config deleted file mode 100644 index 21b185091..000000000 --- a/packages.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/Moq/Moq.csproj b/src/Moq/Moq.csproj index d6de425c8..851c376b8 100644 --- a/src/Moq/Moq.csproj +++ b/src/Moq/Moq.csproj @@ -1,25 +1,33 @@  + + + + + net45;netstandard1.3 Moq - ..\..\Moq.snk True full bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml - false true - true - true 0419 - true Moq - true true 4 7.3 + + + False + True + Moq.nuspec + $(MSBuildThisFileDirectory) + $(OutputDirectory) + + $(DefineConstants);DESKTOP;FEATURE_CAS;FEATURE_CODEDOM;FEATURE_COM;FEATURE_SERIALIZATION @@ -29,12 +37,9 @@ - - - @@ -145,4 +150,6 @@ + + diff --git a/Moq.nuspec b/src/Moq/Moq.nuspec similarity index 74% rename from Moq.nuspec rename to src/Moq/Moq.nuspec index bca908ce3..c553b9cda 100644 --- a/Moq.nuspec +++ b/src/Moq/Moq.nuspec @@ -2,7 +2,7 @@ Moq - 4.8 + $version$ Moq: an enjoyable mocking library Daniel Cazzulino, kzu Daniel Cazzulino, Clarius Labs, kzu @@ -30,11 +30,11 @@ - - - - - - + + + + + + diff --git a/src/Moq/Properties/AssemblyInfo.cs b/src/Moq/Properties/AssemblyInfo.cs index 5a5eca19d..fc6f125a2 100644 --- a/src/Moq/Properties/AssemblyInfo.cs +++ b/src/Moq/Properties/AssemblyInfo.cs @@ -4,36 +4,10 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -[assembly: AssemblyTitle("Moq")] -[assembly: AssemblyCompany("Clarius Consulting, Manas Technology Solutions, InSTEDD")] -[assembly: AssemblyProduct("Moq")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: AssemblyVersion(ThisAssembly.Git.SemVer.Major + "." + ThisAssembly.Git.SemVer.Minor + ".0.0")] -[assembly: AssemblyFileVersion (ThisAssembly.Git.SemVer.Major + "." + ThisAssembly.Git.SemVer.Minor + "." + ThisAssembly.Git.SemVer.Patch)] -[assembly: AssemblyInformationalVersion (ThisAssembly.Git.SemVer.Major + "." + ThisAssembly.Git.SemVer.Minor + "." + ThisAssembly.Git.SemVer.Patch + "-" + ThisAssembly.Git.Branch + "+" + ThisAssembly.Git.Commit)] - [assembly: ComVisible(false)] -#if DEBUG -[assembly: AssemblyConfiguration ("DEBUG")] -#endif -#if RELEASE -[assembly: AssemblyConfiguration ("RELEASE")] -#endif - [assembly: InternalsVisibleTo("Moq.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001009f7a95086500f8f66d892174803850fed9c22225c2ccfff21f39c8af8abfa5415b1664efd0d8e0a6f7f2513b1c11659bd84723dc7900c3d481b833a73a2bcf1ed94c16c4be64d54352c86956c89930444e9ac15124d3693e3f029818e8410f167399d6b995324b635e95353ba97bfab856abbaeb9b40c9b160070c6325e22ddc")] [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2,PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] [assembly: CLSCompliant(true)] [assembly: NeutralResourcesLanguage("en-US")] - -/// -/// -/// -/// -/// -/// -internal static partial class ThisAssembly -{ -} diff --git a/tests/Moq.Tests.VisualBasic/Moq.Tests.VisualBasic.vbproj b/tests/Moq.Tests.VisualBasic/Moq.Tests.VisualBasic.vbproj index ad409dc13..dcb7a2555 100644 --- a/tests/Moq.Tests.VisualBasic/Moq.Tests.VisualBasic.vbproj +++ b/tests/Moq.Tests.VisualBasic/Moq.Tests.VisualBasic.vbproj @@ -1,25 +1,18 @@  - - net46;netcoreapp2.0 - ..\..\Moq.snk + + + + + + net46;netcoreapp2.0 True full - - - - - - - - - - - 2.0.3 - + False + - - - + + + diff --git a/tests/Moq.Tests/Moq.Tests.csproj b/tests/Moq.Tests/Moq.Tests.csproj index 0deb2ba30..c91347879 100644 --- a/tests/Moq.Tests/Moq.Tests.csproj +++ b/tests/Moq.Tests/Moq.Tests.csproj @@ -1,33 +1,30 @@  + + + + net46;netcoreapp2.0 Moq.Tests - ..\..\Moq.snk True full true - true - true 7.2 + False $(DefineConstants);DESKTOP;FEATURE_CAS;FEATURE_CODEDOM;FEATURE_COM;FEATURE_SERIALIZATION - 2.0.3 $(DefineConstants);NETCORE - - - - diff --git a/tests/Moq.Tests/Properties/AssemblyInfo.cs b/tests/Moq.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index 3d2c550eb..000000000 --- a/tests/Moq.Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Moq.Tests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Clarius Consulting SA")] -[assembly: AssemblyProduct("Moq.Tests")] -[assembly: AssemblyCopyright("Copyright © Clarius Consulting SA 2007")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("32d141f9-9a50-4ce1-8d27-abdb7f320dea")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file