diff --git a/.editorconfig b/.editorconfig index c8b5de9a..b0608684 100644 --- a/.editorconfig +++ b/.editorconfig @@ -168,13 +168,14 @@ dotnet_diagnostic.SA1130.severity = silent dotnet_diagnostic.IDE1006.severity = none dotnet_diagnostic.DOC100.severity = silent -dotnet_diagnostic.DOC104.severity = warning +dotnet_diagnostic.DOC104.severity = silent # TODO: promote to warning dotnet_diagnostic.DOC105.severity = warning dotnet_diagnostic.DOC106.severity = warning dotnet_diagnostic.DOC107.severity = warning dotnet_diagnostic.DOC108.severity = warning dotnet_diagnostic.DOC200.severity = warning dotnet_diagnostic.DOC202.severity = warning +dotnet_diagnostic.DOC207.severity = silent # TODO: promote to warning [*.sln] indent_style = tab diff --git a/src/.vsconfig b/.vsconfig similarity index 100% rename from src/.vsconfig rename to .vsconfig diff --git a/Directory.Build.props b/Directory.Build.props index 15d9dfd0..15c57974 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -3,26 +3,21 @@ Debug $(MSBuildThisFileDirectory) $(RepoRootPath)obj\$([MSBuild]::MakeRelative($(RepoRootPath), $(MSBuildProjectDirectory)))\ - $(RepoRootPath)bin\$(MSBuildProjectName)\ - $(RepoRootPath)bin\Packages\$(Configuration)\ + $(RepoRootPath)bin\ + $(RepoRootPath)bin\$(Configuration)\Packages\ 10.0 - enable - enable + disable + disable latest true true - true - - $(MSBuildProjectName.Contains('Test')) - true - true - false + true - true + false - true + false $(MSBuildThisFileDirectory) @@ -59,18 +54,17 @@ - - + false Analyzer - + false Analyzer true @@ -78,13 +72,6 @@ false - - - - - - - @@ -95,21 +82,6 @@ PInvoke.$(MSBuildProjectName) - - $(RepoRootPath)bin\$(Configuration)\tests\$(MSBuildProjectName)\ - - $(MSBuildThisFileDirectory)PInvoke.Tests.ruleset - - - - - - - - - - diff --git a/Directory.Build.targets b/Directory.Build.targets index 15d8e193..7fdaabae 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -5,7 +5,6 @@ - true $(DefineConstants);IncludeStoreBannedAPIs $(DefineConstants);Serialization @@ -18,8 +17,6 @@ - - @@ -28,8 +25,6 @@ - - diff --git a/src/PInvoke.sln b/PInvoke.sln similarity index 79% rename from src/PInvoke.sln rename to PInvoke.sln index 3eb1ede7..535a51f2 100644 --- a/src/PInvoke.sln +++ b/PInvoke.sln @@ -4,164 +4,162 @@ VisualStudioVersion = 17.1.32119.435 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{CD09C869-A027-4F21-B78F-22CF072B9C7F}" ProjectSection(SolutionItems) = preProject - ..\.editorconfig = ..\.editorconfig - ..\.gitignore = ..\.gitignore - ..\templates\AddNewCoreLibrary.ps1 = ..\templates\AddNewCoreLibrary.ps1 - ..\templates\AddNewLibrary.ps1 = ..\templates\AddNewLibrary.ps1 - ..\build.ps1 = ..\build.ps1 - ..\CONTRIBUTING.md = ..\CONTRIBUTING.md - ..\CONTRIBUTORS.md = ..\CONTRIBUTORS.md - ..\templates\CreateExportsTxtFile.ps1 = ..\templates\CreateExportsTxtFile.ps1 - ..\global.json = ..\global.json - ..\LICENSE = ..\LICENSE - ..\nuget.config = ..\nuget.config - PInvoke.ruleset = PInvoke.ruleset - PInvoke.Tests.ruleset = PInvoke.Tests.ruleset - ..\README.md = ..\README.md - ..\stylecop.json = ..\stylecop.json - ..\tools\Update-CoverageReport.ps1 = ..\tools\Update-CoverageReport.ps1 - ..\version.json = ..\version.json + .editorconfig = .editorconfig + .gitignore = .gitignore + templates\AddNewCoreLibrary.ps1 = templates\AddNewCoreLibrary.ps1 + templates\AddNewLibrary.ps1 = templates\AddNewLibrary.ps1 + build.ps1 = build.ps1 + CONTRIBUTING.md = CONTRIBUTING.md + CONTRIBUTORS.md = CONTRIBUTORS.md + templates\CreateExportsTxtFile.ps1 = templates\CreateExportsTxtFile.ps1 + global.json = global.json + LICENSE = LICENSE + nuget.config = nuget.config + README.md = README.md + stylecop.json = stylecop.json + tools\Update-CoverageReport.ps1 = tools\Update-CoverageReport.ps1 + version.json = version.json EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BCrypt", "BCrypt\BCrypt.csproj", "{9CE056E3-5D53-4092-97CC-78826A4D1C14}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BCrypt", "src\BCrypt\BCrypt.csproj", "{9CE056E3-5D53-4092-97CC-78826A4D1C14}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{F00A1FA3-A9AF-450E-A45C-AC59E108F45A}" ProjectSection(SolutionItems) = preProject - ..\tools\Create-PInvokeTxtFile.ps1 = ..\tools\Create-PInvokeTxtFile.ps1 + tools\Create-PInvokeTxtFile.ps1 = tools\Create-PInvokeTxtFile.ps1 Directory.Build.props = Directory.Build.props Directory.Build.targets = Directory.Build.targets PInvoke.Extra.targets = PInvoke.Extra.targets EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Windows.Core", "Windows.Core\Windows.Core.csproj", "{B08C3C79-4CDD-4D37-933C-07D3452FD5F1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Windows.Core", "src\Windows.Core\Windows.Core.csproj", "{B08C3C79-4CDD-4D37-933C-07D3452FD5F1}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "User32", "User32\User32.csproj", "{774A91D6-10C2-459C-A482-50D655BB4680}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "User32", "src\User32\User32.csproj", "{774A91D6-10C2-459C-A482-50D655BB4680}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Gdi32", "Gdi32\Gdi32.csproj", "{BA62C4BC-1FB8-40E0-AC77-84663C4ED11A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Gdi32", "src\Gdi32\Gdi32.csproj", "{BA62C4BC-1FB8-40E0-AC77-84663C4ED11A}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Kernel32", "Kernel32\Kernel32.csproj", "{1FDC092A-D3E8-4CC4-B896-17E0A213F723}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Kernel32", "src\Kernel32\Kernel32.csproj", "{1FDC092A-D3E8-4CC4-B896-17E0A213F723}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Kernel32.Tests", "Kernel32.Tests\Kernel32.Tests.csproj", "{D7224F5B-1AEE-4624-A71F-F0BB10C63555}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Kernel32.Tests", "test\Kernel32.Tests\Kernel32.Tests.csproj", "{D7224F5B-1AEE-4624-A71F-F0BB10C63555}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Hid", "Hid\Hid.csproj", "{26ABA748-B311-4094-9231-7490894E1157}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Hid", "src\Hid\Hid.csproj", "{26ABA748-B311-4094-9231-7490894E1157}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Hid.Tests", "Hid.Tests\Hid.Tests.csproj", "{6C21E31E-6E71-4CB8-8495-CC841B19947F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Hid.Tests", "test\Hid.Tests\Hid.Tests.csproj", "{6C21E31E-6E71-4CB8-8495-CC841B19947F}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SetupApi", "SetupApi\SetupApi.csproj", "{A530587B-C0CD-408C-9FE1-AA3D36B760A0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SetupApi", "src\SetupApi\SetupApi.csproj", "{A530587B-C0CD-408C-9FE1-AA3D36B760A0}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SetupApi.Tests", "SetupApi.Tests\SetupApi.Tests.csproj", "{05468C6E-B6EB-45E9-9F3D-66207D9EFD41}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SetupApi.Tests", "test\SetupApi.Tests\SetupApi.Tests.csproj", "{05468C6E-B6EB-45E9-9F3D-66207D9EFD41}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Windows.Core.Tests", "Windows.Core.Tests\Windows.Core.Tests.csproj", "{A44BC3C8-52A5-4372-8365-0C22FCB9E568}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Windows.Core.Tests", "test\Windows.Core.Tests\Windows.Core.Tests.csproj", "{A44BC3C8-52A5-4372-8365-0C22FCB9E568}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BCrypt.Tests", "BCrypt.Tests\BCrypt.Tests.csproj", "{5CDEA9DD-5A77-4B64-8F55-DC12EEFB3D3B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BCrypt.Tests", "test\BCrypt.Tests\BCrypt.Tests.csproj", "{5CDEA9DD-5A77-4B64-8F55-DC12EEFB3D3B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AdvApi32", "AdvApi32\AdvApi32.csproj", "{3FCBF2E0-1330-454C-8A17-AF14EBA6B244}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AdvApi32", "src\AdvApi32\AdvApi32.csproj", "{3FCBF2E0-1330-454C-8A17-AF14EBA6B244}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AdvApi32.Tests", "AdvApi32.Tests\AdvApi32.Tests.csproj", "{C7809FEC-FF01-4602-9CDD-E78832E35D67}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AdvApi32.Tests", "test\AdvApi32.Tests\AdvApi32.Tests.csproj", "{C7809FEC-FF01-4602-9CDD-E78832E35D67}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NCrypt", "NCrypt\NCrypt.csproj", "{6AAA088F-2ADC-4FFD-8D11-D8B67D5EC88C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NCrypt", "src\NCrypt\NCrypt.csproj", "{6AAA088F-2ADC-4FFD-8D11-D8B67D5EC88C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NCrypt.Tests", "NCrypt.Tests\NCrypt.Tests.csproj", "{97F31BF5-B848-482C-B9B0-3717EF3029EA}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NCrypt.Tests", "test\NCrypt.Tests\NCrypt.Tests.csproj", "{97F31BF5-B848-482C-B9B0-3717EF3029EA}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImageHlp", "ImageHlp\ImageHlp.csproj", "{784B754D-20F0-464B-AEDC-DD7A3108FE25}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImageHlp", "src\ImageHlp\ImageHlp.csproj", "{784B754D-20F0-464B-AEDC-DD7A3108FE25}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImageHlp.Tests", "ImageHlp.Tests\ImageHlp.Tests.csproj", "{7A21FBC0-DFAC-4308-82AD-2F526DBFF636}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImageHlp.Tests", "test\ImageHlp.Tests\ImageHlp.Tests.csproj", "{7A21FBC0-DFAC-4308-82AD-2F526DBFF636}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DbgHelp", "DbgHelp\DbgHelp.csproj", "{26A6F480-5ED3-48B8-9BBA-243115672098}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DbgHelp", "src\DbgHelp\DbgHelp.csproj", "{26A6F480-5ED3-48B8-9BBA-243115672098}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DbgHelp.Tests", "DbgHelp.Tests\DbgHelp.Tests.csproj", "{9EC79974-4353-411E-A04F-598474D9CE58}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DbgHelp.Tests", "test\DbgHelp.Tests\DbgHelp.Tests.csproj", "{9EC79974-4353-411E-A04F-598474D9CE58}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Psapi.Tests", "Psapi.Tests\Psapi.Tests.csproj", "{2C8088B3-82BD-4784-B917-435838A2B1D5}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Psapi.Tests", "test\Psapi.Tests\Psapi.Tests.csproj", "{2C8088B3-82BD-4784-B917-435838A2B1D5}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Psapi", "Psapi\Psapi.csproj", "{6AB26806-6A22-456D-AD87-CD8B3FAFA216}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Psapi", "src\Psapi\Psapi.csproj", "{6AB26806-6A22-456D-AD87-CD8B3FAFA216}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CodeGeneration", "CodeGeneration\CodeGeneration.csproj", "{C1815471-02AF-4BB9-8D83-652ADBAFF5B6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CodeGeneration", "src\CodeGeneration\CodeGeneration.csproj", "{C1815471-02AF-4BB9-8D83-652ADBAFF5B6}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CodeGenerationAttributes", "CodeGenerationAttributes\CodeGenerationAttributes.csproj", "{1387E009-7086-4572-AC8D-CE4242ADEC77}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CodeGenerationAttributes", "src\CodeGenerationAttributes\CodeGenerationAttributes.csproj", "{1387E009-7086-4572-AC8D-CE4242ADEC77}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CodeGen", "CodeGen", "{BC58E358-D202-41B7-BDC3-38E084F36F0B}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CodeGen", "src\CodeGen", "{BC58E358-D202-41B7-BDC3-38E084F36F0B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MSCorEE", "MSCorEE\MSCorEE.csproj", "{862717F8-F2DF-4DE8-9F03-5A98941B2747}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MSCorEE", "src\MSCorEE\MSCorEE.csproj", "{862717F8-F2DF-4DE8-9F03-5A98941B2747}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MSCorEE.Tests", "MSCorEE.Tests\MSCorEE.Tests.csproj", "{A0070AA5-6122-4D81-8A21-EAE6069D2871}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MSCorEE.Tests", "test\MSCorEE.Tests\MSCorEE.Tests.csproj", "{A0070AA5-6122-4D81-8A21-EAE6069D2871}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Crypt32", "Crypt32\Crypt32.csproj", "{2355A580-2257-4A41-B7EC-F987993CE0C9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Crypt32", "src\Crypt32\Crypt32.csproj", "{2355A580-2257-4A41-B7EC-F987993CE0C9}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Crypt32.Tests", "Crypt32.Tests\Crypt32.Tests.csproj", "{BA90133E-FE3B-4FA0-84A1-79D5F90D1BEA}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Crypt32.Tests", "test\Crypt32.Tests\Crypt32.Tests.csproj", "{BA90133E-FE3B-4FA0-84A1-79D5F90D1BEA}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NTDll", "NTDll\NTDll.csproj", "{F64C8B26-5E30-4A7A-8643-F58E4602C64A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NTDll", "src\NTDll\NTDll.csproj", "{F64C8B26-5E30-4A7A-8643-F58E4602C64A}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NTDll.Tests", "NTDll.Tests\NTDll.Tests.csproj", "{F580109D-3C86-4CE4-B686-53F2A3CB1314}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NTDll.Tests", "test\NTDll.Tests\NTDll.Tests.csproj", "{F580109D-3C86-4CE4-B686-53F2A3CB1314}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UxTheme", "UxTheme\UxTheme.csproj", "{3D1C8CE4-27F5-42BB-A7BD-CD5DEAB58EF3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UxTheme", "src\UxTheme\UxTheme.csproj", "{3D1C8CE4-27F5-42BB-A7BD-CD5DEAB58EF3}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UxTheme.Tests", "UxTheme.Tests\UxTheme.Tests.csproj", "{79E61C04-D712-47ED-B070-A56E5CD7A258}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UxTheme.Tests", "test\UxTheme.Tests\UxTheme.Tests.csproj", "{79E61C04-D712-47ED-B070-A56E5CD7A258}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Userenv", "Userenv\Userenv.csproj", "{FDA184C9-C55D-4615-BCF5-ADBF59F25102}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Userenv", "src\Userenv\Userenv.csproj", "{FDA184C9-C55D-4615-BCF5-ADBF59F25102}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Userenv.Tests", "Userenv.Tests\Userenv.Tests.csproj", "{7757DDC1-E0DF-43B6-AD91-40C1F324521E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Userenv.Tests", "test\Userenv.Tests\Userenv.Tests.csproj", "{7757DDC1-E0DF-43B6-AD91-40C1F324521E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "User32.Tests", "User32.Tests\User32.Tests.csproj", "{F7D62BDA-629B-41A7-8233-4AB95B2AD7BA}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "User32.Tests", "test\User32.Tests\User32.Tests.csproj", "{F7D62BDA-629B-41A7-8233-4AB95B2AD7BA}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DwmApi", "DwmApi\DwmApi.csproj", "{AA9EADF7-B399-4DC3-B616-5E0B8A796DFE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DwmApi", "src\DwmApi\DwmApi.csproj", "{AA9EADF7-B399-4DC3-B616-5E0B8A796DFE}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DwmApi.Tests", "DwmApi.Tests\DwmApi.Tests.csproj", "{4B835D69-B10B-4F53-80DE-AC392CEFB896}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DwmApi.Tests", "test\DwmApi.Tests\DwmApi.Tests.csproj", "{4B835D69-B10B-4F53-80DE-AC392CEFB896}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Fusion", "Fusion\Fusion.csproj", "{A41C96AD-3E4A-4744-AA3D-00FFE07954AD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Fusion", "src\Fusion\Fusion.csproj", "{A41C96AD-3E4A-4744-AA3D-00FFE07954AD}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Fusion.Tests", "Fusion.Tests\Fusion.Tests.csproj", "{E2D45BD5-5657-48F6-AAD7-3694B46BED08}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Fusion.Tests", "test\Fusion.Tests\Fusion.Tests.csproj", "{E2D45BD5-5657-48F6-AAD7-3694B46BED08}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Msi", "Msi\Msi.csproj", "{01174E89-DE65-47DC-BF53-4E2CF34AD843}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Msi", "src\Msi\Msi.csproj", "{01174E89-DE65-47DC-BF53-4E2CF34AD843}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Msi.Tests", "Msi.Tests\Msi.Tests.csproj", "{046AD8A6-AAFC-4089-B536-C16256BB9CF6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Msi.Tests", "test\Msi.Tests\Msi.Tests.csproj", "{046AD8A6-AAFC-4089-B536-C16256BB9CF6}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetApi32", "NetApi32\NetApi32.csproj", "{9C5AE8E9-330A-47D9-84D8-9883880EBE9E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetApi32", "src\NetApi32\NetApi32.csproj", "{9C5AE8E9-330A-47D9-84D8-9883880EBE9E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetApi32.Tests", "NetApi32.Tests\NetApi32.Tests.csproj", "{DF7FD89E-5352-4674-8FC3-5BA3605E9154}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetApi32.Tests", "test\NetApi32.Tests\NetApi32.Tests.csproj", "{DF7FD89E-5352-4674-8FC3-5BA3605E9154}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Shell32", "Shell32\Shell32.csproj", "{F187990F-4B3F-4F08-8179-A39A8708D2B5}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Shell32", "src\Shell32\Shell32.csproj", "{F187990F-4B3F-4F08-8179-A39A8708D2B5}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Shell32.Tests", "Shell32.Tests\Shell32.Tests.csproj", "{FDEFD0A0-2E13-4CB7-92F1-74DD216785E5}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Shell32.Tests", "test\Shell32.Tests\Shell32.Tests.csproj", "{FDEFD0A0-2E13-4CB7-92F1-74DD216785E5}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SHCore", "SHCore\SHCore.csproj", "{4D9D4B01-3D46-4BC6-B93F-A799B8C21ABF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SHCore", "src\SHCore\SHCore.csproj", "{4D9D4B01-3D46-4BC6-B93F-A799B8C21ABF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SHCore.Tests", "SHCore.Tests\SHCore.Tests.csproj", "{49094447-F41D-4026-92E3-124532958876}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SHCore.Tests", "test\SHCore.Tests\SHCore.Tests.csproj", "{49094447-F41D-4026-92E3-124532958876}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Windows.ShellScalingApi", "Windows.ShellScalingApi\Windows.ShellScalingApi.csproj", "{0500E681-818F-4366-B2A5-0BB73D7864C6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Windows.ShellScalingApi", "src\Windows.ShellScalingApi\Windows.ShellScalingApi.csproj", "{0500E681-818F-4366-B2A5-0BB73D7864C6}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WtsApi32", "WtsApi32\WtsApi32.csproj", "{BF4E3E19-7145-4D41-8906-084216599537}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WtsApi32", "src\WtsApi32\WtsApi32.csproj", "{BF4E3E19-7145-4D41-8906-084216599537}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WtsApi32.Tests", "WtsApi32.Tests\WtsApi32.Tests.csproj", "{851B8946-8DE1-41F5-A857-BA9428B494DC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WtsApi32.Tests", "test\WtsApi32.Tests\WtsApi32.Tests.csproj", "{851B8946-8DE1-41F5-A857-BA9428B494DC}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win32", "Win32\Win32.csproj", "{34C97C6A-0323-44C6-B8E6-ED748CA287D5}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win32", "src\Win32\Win32.csproj", "{34C97C6A-0323-44C6-B8E6-ED748CA287D5}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Magnification", "Magnification\Magnification.csproj", "{B9778D6F-25D9-4B3B-B752-A326F2801EC2}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Magnification", "src\Magnification\Magnification.csproj", "{B9778D6F-25D9-4B3B-B752-A326F2801EC2}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Magnification.Tests", "Magnification.Tests\Magnification.Tests.csproj", "{9E6F16CF-7C21-4C6C-AC06-8933A02F99A6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Magnification.Tests", "test\Magnification.Tests\Magnification.Tests.csproj", "{9E6F16CF-7C21-4C6C-AC06-8933A02F99A6}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ole32", "Ole32\Ole32.csproj", "{25A2D0B9-5110-4C58-A872-33E7FD9827F0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ole32", "src\Ole32\Ole32.csproj", "{25A2D0B9-5110-4C58-A872-33E7FD9827F0}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ole32.Tests", "Ole32.Tests\Ole32.Tests.csproj", "{8B01C254-2EF7-4724-AFD7-FAD39BE69618}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ole32.Tests", "test\Ole32.Tests\Ole32.Tests.csproj", "{8B01C254-2EF7-4724-AFD7-FAD39BE69618}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cabinet", "Cabinet\Cabinet.csproj", "{966BE4C3-657F-4D2C-8717-C04804064186}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cabinet", "src\Cabinet\Cabinet.csproj", "{966BE4C3-657F-4D2C-8717-C04804064186}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cabinet.Tests", "Cabinet.Tests\Cabinet.Tests.csproj", "{12C7FC54-61AA-413E-A53F-B7AD5D738C70}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cabinet.Tests", "test\Cabinet.Tests\Cabinet.Tests.csproj", "{12C7FC54-61AA-413E-A53F-B7AD5D738C70}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IPHlpApi", "IPHlpApi\IPHlpApi.csproj", "{F00E1C9E-300A-4D42-9128-DDF6307AF0B1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IPHlpApi", "src\IPHlpApi\IPHlpApi.csproj", "{F00E1C9E-300A-4D42-9128-DDF6307AF0B1}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IPHlpApi.Tests", "IPHlpApi.Tests\IPHlpApi.Tests.csproj", "{4E6F62D4-F647-4DB5-B68F-32D74B1DA3AE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IPHlpApi.Tests", "test\IPHlpApi.Tests\IPHlpApi.Tests.csproj", "{4E6F62D4-F647-4DB5-B68F-32D74B1DA3AE}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NewDev", "NewDev\NewDev.csproj", "{31CBB60E-1C8C-442A-8EF4-CD03405F23E1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NewDev", "src\NewDev\NewDev.csproj", "{31CBB60E-1C8C-442A-8EF4-CD03405F23E1}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NewDev.Tests", "NewDev.Tests\NewDev.Tests.csproj", "{AC073C9F-A06E-49F5-A7E8-D0BECF0AD30D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NewDev.Tests", "test\NewDev.Tests\NewDev.Tests.csproj", "{AC073C9F-A06E-49F5-A7E8-D0BECF0AD30D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinUsb", "WinUsb\WinUsb.csproj", "{7E3C9790-DF5F-4B77-B8D0-1389612FB6A1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinUsb", "src\WinUsb\WinUsb.csproj", "{7E3C9790-DF5F-4B77-B8D0-1389612FB6A1}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinUsb.Tests", "WinUsb.Tests\WinUsb.Tests.csproj", "{1F5458CE-CD32-41FA-B946-A3D9983C57E5}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinUsb.Tests", "test\WinUsb.Tests\WinUsb.Tests.csproj", "{1F5458CE-CD32-41FA-B946-A3D9983C57E5}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CfgMgr32", "CfgMgr32\CfgMgr32.csproj", "{970EAFB3-FA7E-415C-8012-7A0005D75AF9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CfgMgr32", "src\CfgMgr32\CfgMgr32.csproj", "{970EAFB3-FA7E-415C-8012-7A0005D75AF9}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CfgMgr32.Tests", "CfgMgr32.Tests\CfgMgr32.Tests.csproj", "{A79234FB-C783-4003-AD26-C4FB388D9310}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CfgMgr32.Tests", "test\CfgMgr32.Tests\CfgMgr32.Tests.csproj", "{A79234FB-C783-4003-AD26-C4FB388D9310}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/src/PInvoke.sln.DotSettings b/PInvoke.sln.DotSettings similarity index 100% rename from src/PInvoke.sln.DotSettings rename to PInvoke.sln.DotSettings diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5648bda8..4cdad990 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -25,6 +25,7 @@ variables: codecov_token: 4dc9e7e2-6b01-4932-a180-847b52b43d35 # Get a new one from https://codecov.io/ ci_feed: https://pkgs.dev.azure.com/andrewarnott/OSS/_packaging/PublicCI/nuget/v3/index.json NUGET_PACKAGES: $(Agent.TempDirectory)/.nuget/packages/ + GeneratePInvokesTxt: true jobs: - template: azure-pipelines/build.yml diff --git a/azure-pipelines/artifacts/_all.ps1 b/azure-pipelines/artifacts/_all.ps1 index 033cc87c..9a22a1d0 100644 --- a/azure-pipelines/artifacts/_all.ps1 +++ b/azure-pipelines/artifacts/_all.ps1 @@ -38,6 +38,7 @@ Get-ChildItem "$PSScriptRoot\*.ps1" -Exclude "_*" -Recurse | % { $ArtifactName = $_.BaseName if ($Force -or !(Test-ArtifactStaged($ArtifactName + $ArtifactNameSuffix))) { $totalFileCount = 0 + Write-Verbose "Collecting file list for artifact $($_.BaseName)" $fileGroups = & $_ if ($fileGroups) { $fileGroups.GetEnumerator() | % { diff --git a/azure-pipelines/artifacts/deployables.ps1 b/azure-pipelines/artifacts/deployables.ps1 index 94c48cdd..250e4c84 100644 --- a/azure-pipelines/artifacts/deployables.ps1 +++ b/azure-pipelines/artifacts/deployables.ps1 @@ -4,7 +4,7 @@ if (!$BuildConfiguration) { $BuildConfiguration = 'Debug' } -$PackagesRoot = "$RepoRoot/bin/Packages/$BuildConfiguration" +$PackagesRoot = "$RepoRoot/bin/$BuildConfiguration/Packages" if (!(Test-Path $PackagesRoot)) { return } diff --git a/azure-pipelines/artifacts/pinvoke_coverage_report.ps1 b/azure-pipelines/artifacts/pinvoke_coverage_report.ps1 index b55deb0e..d5cb23eb 100644 --- a/azure-pipelines/artifacts/pinvoke_coverage_report.ps1 +++ b/azure-pipelines/artifacts/pinvoke_coverage_report.ps1 @@ -6,7 +6,7 @@ if (!$BuildConfiguration) { $binRoot = "$RepoRoot\bin\$BuildConfiguration" -tools\Get-CoverageReport.ps1 -NoBuild -Configuration $env:configuration -OutFile "$binRoot\coverage.md" +& "$PSScriptRoot\..\..\tools\Get-CoverageReport.ps1" -NoBuild -Configuration $env:configuration -OutFile "$binRoot\coverage.md" & (& "$PSScriptRoot\..\Get-pandoc.ps1") -f markdown -t html "$binRoot\coverage.md" -o "$binRoot\coverage.html" diff --git a/azure-pipelines/build.yml b/azure-pipelines/build.yml index eeda29eb..aa091acf 100644 --- a/azure-pipelines/build.yml +++ b/azure-pipelines/build.yml @@ -24,21 +24,6 @@ jobs: - template: dotnet.yml parameters: RunTests: ${{ parameters.RunTests }} - - template: expand-template.yml -- job: WrapUp - dependsOn: - - Windows - pool: ${{ parameters.windowsPool }} # Use Windows agent because PublishSymbols task requires it (https://github.com/microsoft/azure-pipelines-tasks/issues/13821). - condition: succeededOrFailed() - steps: - - checkout: self - fetchDepth: 0 # avoid shallow clone so nbgv can do its work. - clean: true - - template: install-dependencies.yml - parameters: - initArgs: -NoRestore - template: publish-symbols.yml - - ${{ if parameters.RunTests }}: - - template: publish-codecoverage.yml - template: publish-deployables.yml diff --git a/azure-pipelines/dotnet-test-cloud.ps1 b/azure-pipelines/dotnet-test-cloud.ps1 deleted file mode 100644 index 24bf812a..00000000 --- a/azure-pipelines/dotnet-test-cloud.ps1 +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/env pwsh - -<# -.SYNOPSIS - Runs tests as they are run in cloud test runs. -.PARAMETER Configuration - The configuration within which to run tests -.PARAMETER Agent - The name of the agent. This is used in preparing test run titles. -.PARAMETER PublishResults - A switch to publish results to Azure Pipelines. -.PARAMETER x86 - A switch to run the tests in an x86 process. -.PARAMETER dotnet32 - The path to a 32-bit dotnet executable to use. -#> -[CmdletBinding()] -Param( - [string]$Configuration='Debug', - [string]$Agent='Local', - [switch]$PublishResults, - [switch]$x86, - [string]$dotnet32 -) - -$RepoRoot = (Resolve-Path "$PSScriptRoot/..").Path -$ArtifactStagingFolder = & "$PSScriptRoot/Get-ArtifactsStagingDirectory.ps1" - -$dotnet = 'dotnet' -if ($x86) { - $x86RunTitleSuffix = ", x86" - if ($dotnet32) { - $dotnet = $dotnet32 - } else { - $dotnet32Possibilities = "$PSScriptRoot\../obj/tools/x86/.dotnet/dotnet.exe", "$env:AGENT_TOOLSDIRECTORY/x86/dotnet/dotnet.exe", "${env:ProgramFiles(x86)}\dotnet\dotnet.exe" - $dotnet32Matches = $dotnet32Possibilities |? { Test-Path $_ } - if ($dotnet32Matches) { - $dotnet = Resolve-Path @($dotnet32Matches)[0] - Write-Host "Running tests using `"$dotnet`"" -ForegroundColor DarkGray - } else { - Write-Error "Unable to find 32-bit dotnet.exe" - return 1 - } - } -} - -& $dotnet test $RepoRoot ` - --no-build ` - -c $Configuration ` - --filter "TestCategory!=FailsInCloudTest" ` - --collect "Code Coverage;Format=cobertura" ` - --settings "$PSScriptRoot/test.runsettings" ` - --blame-hang-timeout 60s ` - --blame-crash ` - -bl:"$ArtifactStagingFolder/build_logs/test.binlog" ` - --diag "$ArtifactStagingFolder/test_logs/diag.log;TraceLevel=info" ` - --logger trx ` - -$unknownCounter = 0 -Get-ChildItem -Recurse -Path $RepoRoot\test\*.trx |% { - Copy-Item $_ -Destination $ArtifactStagingFolder/test_logs/ - - if ($PublishResults) { - $x = [xml](Get-Content -Path $_) - $runTitle = $null - if ($x.TestRun.TestDefinitions -and $x.TestRun.TestDefinitions.GetElementsByTagName('UnitTest')) { - $storage = $x.TestRun.TestDefinitions.GetElementsByTagName('UnitTest')[0].storage -replace '\\','/' - if ($storage -match '/(?net[^/]+)/(?:(?[^/]+)/)?(?[^/]+)\.dll$') { - if ($matches.rid) { - $runTitle = "$($matches.lib) ($($matches.tfm), $($matches.rid), $Agent)" - } else { - $runTitle = "$($matches.lib) ($($matches.tfm)$x86RunTitleSuffix, $Agent)" - } - } - } - if (!$runTitle) { - $unknownCounter += 1; - $runTitle = "unknown$unknownCounter ($Agent$x86RunTitleSuffix)"; - } - - Write-Host "##vso[results.publish type=VSTest;runTitle=$runTitle;publishRunAttachments=true;resultFiles=$_;failTaskOnFailedTests=true;testRunSystem=VSTS - PTR;]" - } -} diff --git a/azure-pipelines/dotnet.yml b/azure-pipelines/dotnet.yml index b5884244..4a6e0a22 100644 --- a/azure-pipelines/dotnet.yml +++ b/azure-pipelines/dotnet.yml @@ -4,17 +4,32 @@ parameters: steps: - task: VSBuild@1 - displayName: 🛠 msbuild + displayName: 🛠 Build inputs: msbuildArgs: /t:build,pack /m /v:m /bl:"$(Build.ArtifactStagingDirectory)/build_logs/msbuild.binlog" platform: Any CPU configuration: $(BuildConfiguration) - powershell: .\build.ps1 -Test - displayName: 🧪 test + displayName: 🧪 Test failOnStderr: true condition: and(succeeded(), ${{ parameters.RunTests }}) +- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: + - pwsh: > + dotnet tool install --tool-path obj SignClient + + obj/SignClient sign + --baseDirectory '$(System.DefaultWorkingDirectory)/bin/$(BuildConfiguration)/Packages' + --input '**/*' + --config '$(System.DefaultWorkingDirectory)/azure-pipelines/SignClient.json' + --filelist '$(System.DefaultWorkingDirectory)/azure-pipelines/signfiles.txt' + --user '$(codesign_username)' + --secret '$(codesign_secret)' + --name 'PInvoke' + --descriptionUrl 'https://github.com/dotnet/pinvoke' + displayName: 🖊️ Code sign + - powershell: azure-pipelines/variables/_pipelines.ps1 failOnStderr: true displayName: ⚙ Update pipeline variables based on build outputs diff --git a/azure-pipelines/publish-deployables.yml b/azure-pipelines/publish-deployables.yml index 31e80a43..70423202 100644 --- a/azure-pipelines/publish-deployables.yml +++ b/azure-pipelines/publish-deployables.yml @@ -1,8 +1,5 @@ steps: -- download: current - displayName: 🔻 Download deployables - artifact: deployables-Windows - -- powershell: dotnet nuget push "$(Resolve-Path '$(Pipeline.Workspace)\deployables-Windows\')*.nupkg" -s $(ci_feed) -k azdo --skip-duplicate - displayName: 📦 Push packages to CI feed - condition: and(succeeded(), ne(variables['ci_feed'], ''), ne(variables['Build.Reason'], 'PullRequest')) +- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: + - powershell: dotnet nuget push "$(Resolve-Path '$(Build.ArtifactStagingDirectory)\deployables-Windows\')*.nupkg" -s $(ci_feed) -k azdo --skip-duplicate + displayName: 📦 Push packages to CI feed + condition: and(succeeded(), ne(variables['ci_feed'], '')) diff --git a/azure-pipelines/publish-symbols.yml b/azure-pipelines/publish-symbols.yml index 35bee630..0201707d 100644 --- a/azure-pipelines/publish-symbols.yml +++ b/azure-pipelines/publish-symbols.yml @@ -1,21 +1,7 @@ steps: -- task: DownloadPipelineArtifact@2 - inputs: - artifact: symbols-Windows - path: $(Pipeline.Workspace)/symbols/Windows - displayName: 🔻 Download Windows symbols - continueOnError: true - -- task: DownloadPipelineArtifact@2 - inputs: - artifact: test_symbols-Windows - path: $(Pipeline.Workspace)/test_symbols/Windows - displayName: 🔻 Download Windows test symbols - continueOnError: true - - task: PublishSymbols@2 inputs: - SymbolsFolder: $(Pipeline.Workspace)/symbols + SymbolsFolder: $(Build.ArtifactStagingDirectory)/symbols-$(Agent.JobName) SearchPattern: '**/*.pdb' IndexSources: false SymbolServerType: TeamServices @@ -23,7 +9,7 @@ steps: - task: PublishSymbols@2 inputs: - SymbolsFolder: $(Pipeline.Workspace)/test_symbols + SymbolsFolder: $(Build.ArtifactStagingDirectory)/test_symbols-$(Agent.JobName) SearchPattern: '**/*.pdb' IndexSources: false SymbolServerType: TeamServices diff --git a/build.ps1 b/build.ps1 index 319e8a55..042eef55 100644 --- a/build.ps1 +++ b/build.ps1 @@ -45,7 +45,7 @@ if ($NothingToDo) { # Path variables $ProjectRoot = Split-Path -parent $PSCommandPath -$SolutionFolder = Join-Path $ProjectRoot src +$SolutionFolder = $ProjectRoot $SolutionFile = Join-Path $SolutionFolder "PInvoke.sln" $BinFolder = Join-Path $ProjectRoot "bin" $BinConfigFolder = Join-Path $BinFolder $Configuration @@ -111,7 +111,7 @@ if (($Build -or $Rebuild) -and $PSCmdlet.ShouldProcess($SolutionFile, "Build")) } if ($Test -and $PSCmdlet.ShouldProcess('Test assemblies')) { - $TestAssemblies = Get-ChildItem -Recurse "$BinTestsFolder\*.Tests.dll" |? { $_.Directory -notlike '*netcoreapp*' } + $TestAssemblies = Get-ChildItem -Recurse "$BinTestsFolder\*.Tests.dll" |? { ($_.Directory -notlike '*netcoreapp*') -and ($_.Directory -like "*$Configuration*") } $xunitArgs = @() $xunitArgs += $TestAssemblies $xunitArgs += "-html","$BinTestsFolder\testresults.html","-xml","$BinTestsFolder\testresults.xml" diff --git a/src/.editorconfig b/src/.editorconfig index e69de29b..69a669c8 100644 --- a/src/.editorconfig +++ b/src/.editorconfig @@ -0,0 +1,8 @@ +[*.cs] +dotnet_diagnostic.SA1307.severity = none +dotnet_diagnostic.SA1310.severity = none +dotnet_diagnostic.SA1313.severity = none +dotnet_diagnostic.SA1600.severity = silent +dotnet_diagnostic.SA1602.severity = silent +dotnet_diagnostic.SA1629.severity = silent # info +dotnet_diagnostic.SA1649.severity = silent # info diff --git a/src/AdvApi32.Tests/AdvApi32.Tests.csproj b/src/AdvApi32.Tests/AdvApi32.Tests.csproj deleted file mode 100644 index 170d3d31..00000000 --- a/src/AdvApi32.Tests/AdvApi32.Tests.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - net472 - - - - - - - - - - diff --git a/src/AssemblyAttributes.cs b/src/AssemblyAttributes.cs deleted file mode 100644 index 622085e6..00000000 --- a/src/AssemblyAttributes.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright © .NET Foundation and Contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -#if NETFRAMEWORK || NETSTANDARD - -using System.Runtime.InteropServices; - -[module: DefaultCharSet(CharSet.Unicode)] - -#if NET45_ORLATER || NETSTANDARD - -[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.System32)] - -#endif - -#endif diff --git a/src/AssemblyInfo.cs b/src/AssemblyInfo.cs index 81feda27..d0c88891 100644 --- a/src/AssemblyInfo.cs +++ b/src/AssemblyInfo.cs @@ -1,6 +1,16 @@ -// Copyright (c) COMPANY-PLACEHOLDER. All rights reserved. +// Copyright © .NET Foundation and Contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +#if NETFRAMEWORK || NETSTANDARD + using System.Runtime.InteropServices; +[module: DefaultCharSet(CharSet.Unicode)] + +#if NET45_ORLATER || NETSTANDARD + [assembly: DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)] + +#endif + +#endif diff --git a/src/BCrypt.Tests/BCrypt.Tests.csproj b/src/BCrypt.Tests/BCrypt.Tests.csproj deleted file mode 100644 index 2b0b780a..00000000 --- a/src/BCrypt.Tests/BCrypt.Tests.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - net472 - - - - - - - - - - diff --git a/src/BCrypt/BCrypt.csproj b/src/BCrypt/BCrypt.csproj index f8e7f019..2d90d199 100644 --- a/src/BCrypt/BCrypt.csproj +++ b/src/BCrypt/BCrypt.csproj @@ -1,7 +1,7 @@  $(PlatformAndPortableFrameworks) - BCrypt.ruleset + $(NoWarn);RS0026;RS0027 diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 77d94765..f9179bc1 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,3 +1,18 @@ + + true + true + false + + + + + + + + + + diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets index 566ab4fc..95d37219 100644 --- a/src/Directory.Build.targets +++ b/src/Directory.Build.targets @@ -3,5 +3,7 @@ + + diff --git a/src/DwmApi.Tests/DwmApi.Tests.csproj b/src/DwmApi.Tests/DwmApi.Tests.csproj deleted file mode 100644 index e09778fd..00000000 --- a/src/DwmApi.Tests/DwmApi.Tests.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - net472 - - - - - - - - - diff --git a/src/Fusion.Tests/Fusion.Tests.csproj b/src/Fusion.Tests/Fusion.Tests.csproj deleted file mode 100644 index e45fa775..00000000 --- a/src/Fusion.Tests/Fusion.Tests.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - net472 - - - - - - - - - diff --git a/src/Hid.Tests/Hid.Tests.csproj b/src/Hid.Tests/Hid.Tests.csproj deleted file mode 100644 index 4c272d2e..00000000 --- a/src/Hid.Tests/Hid.Tests.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - net472 - - - - - - - - - diff --git a/src/ImageHlp.Tests/ImageHlp.Tests.csproj b/src/ImageHlp.Tests/ImageHlp.Tests.csproj deleted file mode 100644 index 50e8da8a..00000000 --- a/src/ImageHlp.Tests/ImageHlp.Tests.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - net472 - - - - - - - - - diff --git a/src/Kernel32.Tests/Kernel32.Tests.csproj b/src/Kernel32.Tests/Kernel32.Tests.csproj deleted file mode 100644 index 1b5d0375..00000000 --- a/src/Kernel32.Tests/Kernel32.Tests.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - net472;netcoreapp3.1 - - - - - - - - - diff --git a/src/Magnification.Tests/Magnification.Tests.csproj b/src/Magnification.Tests/Magnification.Tests.csproj deleted file mode 100644 index dddbb4fe..00000000 --- a/src/Magnification.Tests/Magnification.Tests.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - net472 - - - - - - - - - diff --git a/src/Msi.Tests/Msi.Tests.csproj b/src/Msi.Tests/Msi.Tests.csproj deleted file mode 100644 index b81b2e34..00000000 --- a/src/Msi.Tests/Msi.Tests.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - net472 - - - - - - - - diff --git a/src/NTDll.Tests/NTDll.Tests.csproj b/src/NTDll.Tests/NTDll.Tests.csproj deleted file mode 100644 index a9e56c82..00000000 --- a/src/NTDll.Tests/NTDll.Tests.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - net472 - - - - - - - - - diff --git a/src/NetApi32.Tests/NetApi32.Tests.csproj b/src/NetApi32.Tests/NetApi32.Tests.csproj deleted file mode 100644 index 5fdb6ae2..00000000 --- a/src/NetApi32.Tests/NetApi32.Tests.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - net472 - - - - - - - - diff --git a/src/Ole32.Tests/Ole32.Tests.csproj b/src/Ole32.Tests/Ole32.Tests.csproj deleted file mode 100644 index 7eed0328..00000000 --- a/src/Ole32.Tests/Ole32.Tests.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - net472 - - - - - - - - - diff --git a/src/Psapi.Tests/Psapi.Tests.csproj b/src/Psapi.Tests/Psapi.Tests.csproj deleted file mode 100644 index f3536bdf..00000000 --- a/src/Psapi.Tests/Psapi.Tests.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - net472 - - - - - - - - diff --git a/src/SHCore.Tests/SHCore.Tests.csproj b/src/SHCore.Tests/SHCore.Tests.csproj deleted file mode 100644 index fabf2e8f..00000000 --- a/src/SHCore.Tests/SHCore.Tests.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - net472 - - - - - - - - diff --git a/src/SetupApi.Tests/SetupApi.Tests.csproj b/src/SetupApi.Tests/SetupApi.Tests.csproj deleted file mode 100644 index a41f16cb..00000000 --- a/src/SetupApi.Tests/SetupApi.Tests.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - net472 - - - - - - - - diff --git a/src/Shell32.Tests/Shell32.Tests.csproj b/src/Shell32.Tests/Shell32.Tests.csproj deleted file mode 100644 index fc1f722c..00000000 --- a/src/Shell32.Tests/Shell32.Tests.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - net472 - - - - - - - - diff --git a/src/User32.Tests/User32.Tests.csproj b/src/User32.Tests/User32.Tests.csproj deleted file mode 100644 index e50c09bf..00000000 --- a/src/User32.Tests/User32.Tests.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - net472 - - - - - - - - diff --git a/src/Userenv.Tests/Userenv.Tests.csproj b/src/Userenv.Tests/Userenv.Tests.csproj deleted file mode 100644 index 1b21ac0e..00000000 --- a/src/Userenv.Tests/Userenv.Tests.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - net472 - - - - - - - - diff --git a/src/UxTheme.Tests/UxTheme.Tests.csproj b/src/UxTheme.Tests/UxTheme.Tests.csproj deleted file mode 100644 index dd426103..00000000 --- a/src/UxTheme.Tests/UxTheme.Tests.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - net472 - - - - - - - - diff --git a/src/Windows.Core.Tests/Windows.Core.Tests.csproj b/src/Windows.Core.Tests/Windows.Core.Tests.csproj deleted file mode 100644 index 33b39fbc..00000000 --- a/src/Windows.Core.Tests/Windows.Core.Tests.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - net472 - - - - - - - - diff --git a/src/WtsApi32.Tests/WtsApi32.Tests.csproj b/src/WtsApi32.Tests/WtsApi32.Tests.csproj deleted file mode 100644 index 21c94d2d..00000000 --- a/src/WtsApi32.Tests/WtsApi32.Tests.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - net472 - - - - - - - - diff --git a/src/opensource.snk b/strongname.snk similarity index 100% rename from src/opensource.snk rename to strongname.snk diff --git a/templates/AddNewCoreLibrary.ps1 b/templates/AddNewCoreLibrary.ps1 index 8e33817a..50d86da6 100644 --- a/templates/AddNewCoreLibrary.ps1 +++ b/templates/AddNewCoreLibrary.ps1 @@ -3,11 +3,11 @@ Adds the class library and NuGet projects necessary to support a new core library to the solution. - A Core Library on PInvoke project wording is a library that only contains types and structures, - no functions, classes or methods. These kind of projects are meant to be used when types and - structures must be shared among other high level projects, like SHCore and User32 share Windows.ShellScalingApi. + A Core Library on PInvoke project wording is a library that only contains types and structures, + no functions, classes or methods. These kind of projects are meant to be used when types and + structures must be shared among other high level projects, like SHCore and User32 share Windows.ShellScalingApi. - Core Libraries should be named after their C/C++ header file names like ShellScalingApi.h + Core Libraries should be named after their C/C++ header file names like ShellScalingApi.h .PARAMETER CoreLibraryName The name of the core library you are introducing support for, without the .dll extension. @@ -45,9 +45,8 @@ $Replacements = @{ Copy-Item -Recurse -Path $TemplateDirectories -Destination $Src $SrcDirectories |% { Replace-Placeholders -LibraryName $CoreLibraryName -Replacements $Replacements -Path $_ } +dotnet sln $PSScriptRoot\.. add $Src\$CoreLibraryName --in-root +dotnet add $Src\win32 reference $Src\$CoreLibraryName + Write-Output "Great. Your new projects have been created. Please also perform a few more manual steps:" -Write-Output "1. Add this new project to your solution file:" -Write-Output " $Src\$CoreLibraryName\$CoreLibraryName.csproj" -Write-Output "2. Add your library to the README.md file." -Write-Output "3. Add a project reference to $Src\$CoreLibraryName\$CoreLibraryName.csproj" -Write-Output " into the Win32 project, if it's part of the Win32 API." +Write-Output "1. Add your library to the README.md file." diff --git a/templates/AddNewLibrary.ps1 b/templates/AddNewLibrary.ps1 index 5f827242..6a4b048d 100644 --- a/templates/AddNewLibrary.ps1 +++ b/templates/AddNewLibrary.ps1 @@ -23,33 +23,36 @@ if (!(Get-Command dumpbin)) { . $PSScriptRoot\Replace-Placeholders.ps1 $Src = Resolve-Path "$PSScriptRoot\..\src" +$Test = Resolve-Path "$PSScriptRoot\..\test" $Directories = 'LIBNAME','LIBNAME.Tests' -$TemplateDirectories = @() $SrcDirectories = @() foreach($dir in $Directories) { - $SrcDirectory = "$Src\$dir" + $IsTest = $dir -Like '*test*' + if ($IsTest) { + $SrcDirectory = "$Test\$dir" + } else { + $SrcDirectory = "$Src\$dir" + } $TemplateDirectory = "$PSScriptRoot\$dir" $SrcDirectory_Substituted = $SrcDirectory.Replace('LIBNAME', $LibraryName) If (-not (Test-Path $SrcDirectory_Substituted)) { - $TemplateDirectories += $TemplateDirectory $SrcDirectories += $SrcDirectory } + Copy-Item -Recurse -Path $TemplateDirectory -Destination $SrcDirectory } $Replacements = @{ 'LIBNAME' = $LibraryName; } -Copy-Item -Recurse -Path $TemplateDirectories -Destination $Src $SrcDirectories |% { Replace-Placeholders -LibraryName $LibraryName -Replacements $Replacements -Path $_ } & "$PSScriptRoot\CreateExportsTxtFile.ps1" -AssemblyPath "$env:windir\System32\$LibraryName.dll" -OutputDir "$Src\$LibraryName\" +dotnet sln $PSScriptRoot\.. add $Src\$LibraryName --in-root +dotnet sln $PSScriptRoot\.. add $Test\$LibraryName.Tests --in-root +dotnet add $Src\win32 reference $Src\$LibraryName + Write-Output "Great. Your new projects have been created. Please also perform a few more manual steps:" -Write-Output "1. Add these new projects to your solution file:" -Write-Output " $Src\$LibraryName\$LibraryName.csproj" -Write-Output " $Src\$LibraryName.Tests\$LibraryName.Tests.csproj" -Write-Output "2. Add your library to the README.md file." -Write-Output "3. Add a project reference to $Src\$CoreLibraryName\$CoreLibraryName.csproj" -Write-Output " into the Win32 project, if it's part of the Win32 API." +Write-Output "1. Add your library to the README.md file." diff --git a/templates/LIBNAME.Tests/LIBNAME.Tests.csproj b/templates/LIBNAME.Tests/LIBNAME.Tests.csproj index 81d96535..007fede4 100644 --- a/templates/LIBNAME.Tests/LIBNAME.Tests.csproj +++ b/templates/LIBNAME.Tests/LIBNAME.Tests.csproj @@ -3,10 +3,7 @@ net472 - - - - - + + diff --git a/test/AdvApi32.Tests/AdvApi32.Tests.csproj b/test/AdvApi32.Tests/AdvApi32.Tests.csproj new file mode 100644 index 00000000..d07266ec --- /dev/null +++ b/test/AdvApi32.Tests/AdvApi32.Tests.csproj @@ -0,0 +1,10 @@ + + + net472 + + + + + + + diff --git a/src/AdvApi32.Tests/AdvApi32Facts.cs b/test/AdvApi32.Tests/AdvApi32Facts.cs similarity index 100% rename from src/AdvApi32.Tests/AdvApi32Facts.cs rename to test/AdvApi32.Tests/AdvApi32Facts.cs diff --git a/test/BCrypt.Tests/BCrypt.Tests.csproj b/test/BCrypt.Tests/BCrypt.Tests.csproj new file mode 100644 index 00000000..e00b957b --- /dev/null +++ b/test/BCrypt.Tests/BCrypt.Tests.csproj @@ -0,0 +1,10 @@ + + + net472 + + + + + + + diff --git a/src/BCrypt.Tests/BCryptFacts.cs b/test/BCrypt.Tests/BCryptFacts.cs similarity index 100% rename from src/BCrypt.Tests/BCryptFacts.cs rename to test/BCrypt.Tests/BCryptFacts.cs diff --git a/src/Cabinet.Tests/Cabinet.Tests.csproj b/test/Cabinet.Tests/Cabinet.Tests.csproj similarity index 59% rename from src/Cabinet.Tests/Cabinet.Tests.csproj rename to test/Cabinet.Tests/Cabinet.Tests.csproj index 2794a69f..41cbfccb 100644 --- a/src/Cabinet.Tests/Cabinet.Tests.csproj +++ b/test/Cabinet.Tests/Cabinet.Tests.csproj @@ -3,9 +3,9 @@ net472;netcoreapp3.1 - - - + + + diff --git a/src/Cabinet.Tests/CabinetFacts.cs b/test/Cabinet.Tests/CabinetFacts.cs similarity index 100% rename from src/Cabinet.Tests/CabinetFacts.cs rename to test/Cabinet.Tests/CabinetFacts.cs diff --git a/src/Cabinet.Tests/app.config b/test/Cabinet.Tests/app.config similarity index 100% rename from src/Cabinet.Tests/app.config rename to test/Cabinet.Tests/app.config diff --git a/src/Cabinet.Tests/demo.CAB b/test/Cabinet.Tests/demo.CAB similarity index 100% rename from src/Cabinet.Tests/demo.CAB rename to test/Cabinet.Tests/demo.CAB diff --git a/test/CfgMgr32.Tests/CfgMgr32.Tests.csproj b/test/CfgMgr32.Tests/CfgMgr32.Tests.csproj new file mode 100644 index 00000000..3db32262 --- /dev/null +++ b/test/CfgMgr32.Tests/CfgMgr32.Tests.csproj @@ -0,0 +1,8 @@ + + + net472 + + + + + diff --git a/src/CfgMgr32.Tests/CfgMgr32Facts.cs b/test/CfgMgr32.Tests/CfgMgr32Facts.cs similarity index 100% rename from src/CfgMgr32.Tests/CfgMgr32Facts.cs rename to test/CfgMgr32.Tests/CfgMgr32Facts.cs diff --git a/src/Crypt32.Tests/Crypt32.Tests.csproj b/test/Crypt32.Tests/Crypt32.Tests.csproj similarity index 50% rename from src/Crypt32.Tests/Crypt32.Tests.csproj rename to test/Crypt32.Tests/Crypt32.Tests.csproj index 0100d218..1c7ca764 100644 --- a/src/Crypt32.Tests/Crypt32.Tests.csproj +++ b/test/Crypt32.Tests/Crypt32.Tests.csproj @@ -3,13 +3,10 @@ net472 - - + + - - - diff --git a/src/Crypt32.Tests/Crypt32Facts.cs b/test/Crypt32.Tests/Crypt32Facts.cs similarity index 100% rename from src/Crypt32.Tests/Crypt32Facts.cs rename to test/Crypt32.Tests/Crypt32Facts.cs diff --git a/src/Crypt32.Tests/protectedPair.pfx b/test/Crypt32.Tests/protectedPair.pfx similarity index 100% rename from src/Crypt32.Tests/protectedPair.pfx rename to test/Crypt32.Tests/protectedPair.pfx diff --git a/test/DbgHelp.Tests/DbgHelp.Tests.csproj b/test/DbgHelp.Tests/DbgHelp.Tests.csproj new file mode 100644 index 00000000..a355ebf6 --- /dev/null +++ b/test/DbgHelp.Tests/DbgHelp.Tests.csproj @@ -0,0 +1,8 @@ + + + net472 + + + + + diff --git a/src/DbgHelp.Tests/DbgHelpFacts.cs b/test/DbgHelp.Tests/DbgHelpFacts.cs similarity index 100% rename from src/DbgHelp.Tests/DbgHelpFacts.cs rename to test/DbgHelp.Tests/DbgHelpFacts.cs diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 449a06e4..63650171 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -1,9 +1,21 @@ + + true + + + $(RepoRootPath)bin\$(Configuration)\tests\$(MSBuildProjectName)\ false true + false + + + + + + diff --git a/test/Directory.Build.targets b/test/Directory.Build.targets index e7edee55..107ad605 100644 --- a/test/Directory.Build.targets +++ b/test/Directory.Build.targets @@ -1,3 +1,7 @@ + + + + diff --git a/test/DwmApi.Tests/DwmApi.Tests.csproj b/test/DwmApi.Tests/DwmApi.Tests.csproj new file mode 100644 index 00000000..021ef951 --- /dev/null +++ b/test/DwmApi.Tests/DwmApi.Tests.csproj @@ -0,0 +1,9 @@ + + + net472 + + + + + + diff --git a/src/DwmApi.Tests/DwmApiFacts.cs b/test/DwmApi.Tests/DwmApiFacts.cs similarity index 100% rename from src/DwmApi.Tests/DwmApiFacts.cs rename to test/DwmApi.Tests/DwmApiFacts.cs diff --git a/test/Fusion.Tests/Fusion.Tests.csproj b/test/Fusion.Tests/Fusion.Tests.csproj new file mode 100644 index 00000000..6065b371 --- /dev/null +++ b/test/Fusion.Tests/Fusion.Tests.csproj @@ -0,0 +1,9 @@ + + + net472 + + + + + + diff --git a/src/Fusion.Tests/FusionFacts.cs b/test/Fusion.Tests/FusionFacts.cs similarity index 100% rename from src/Fusion.Tests/FusionFacts.cs rename to test/Fusion.Tests/FusionFacts.cs diff --git a/test/Hid.Tests/Hid.Tests.csproj b/test/Hid.Tests/Hid.Tests.csproj new file mode 100644 index 00000000..461d74bf --- /dev/null +++ b/test/Hid.Tests/Hid.Tests.csproj @@ -0,0 +1,9 @@ + + + net472 + + + + + + diff --git a/src/Hid.Tests/HidFacts.cs b/test/Hid.Tests/HidFacts.cs similarity index 100% rename from src/Hid.Tests/HidFacts.cs rename to test/Hid.Tests/HidFacts.cs diff --git a/test/IPHlpApi.Tests/IPHlpApi.Tests.csproj b/test/IPHlpApi.Tests/IPHlpApi.Tests.csproj new file mode 100644 index 00000000..276536f9 --- /dev/null +++ b/test/IPHlpApi.Tests/IPHlpApi.Tests.csproj @@ -0,0 +1,8 @@ + + + net472 + + + + + diff --git a/src/IPHlpApi.Tests/IPHlpApiFacts.cs b/test/IPHlpApi.Tests/IPHlpApiFacts.cs similarity index 100% rename from src/IPHlpApi.Tests/IPHlpApiFacts.cs rename to test/IPHlpApi.Tests/IPHlpApiFacts.cs diff --git a/test/ImageHlp.Tests/ImageHlp.Tests.csproj b/test/ImageHlp.Tests/ImageHlp.Tests.csproj new file mode 100644 index 00000000..84798ef1 --- /dev/null +++ b/test/ImageHlp.Tests/ImageHlp.Tests.csproj @@ -0,0 +1,9 @@ + + + net472 + + + + + + diff --git a/src/ImageHlp.Tests/ImageHlpFacts.cs b/test/ImageHlp.Tests/ImageHlpFacts.cs similarity index 100% rename from src/ImageHlp.Tests/ImageHlpFacts.cs rename to test/ImageHlp.Tests/ImageHlpFacts.cs diff --git a/test/Kernel32.Tests/Kernel32.Tests.csproj b/test/Kernel32.Tests/Kernel32.Tests.csproj new file mode 100644 index 00000000..40f92a6d --- /dev/null +++ b/test/Kernel32.Tests/Kernel32.Tests.csproj @@ -0,0 +1,9 @@ + + + net472;netcoreapp3.1 + + + + + + diff --git a/src/Kernel32.Tests/Kernel32ExtensionsFacts.cs b/test/Kernel32.Tests/Kernel32ExtensionsFacts.cs similarity index 100% rename from src/Kernel32.Tests/Kernel32ExtensionsFacts.cs rename to test/Kernel32.Tests/Kernel32ExtensionsFacts.cs diff --git a/src/Kernel32.Tests/Kernel32Facts.cs b/test/Kernel32.Tests/Kernel32Facts.cs similarity index 100% rename from src/Kernel32.Tests/Kernel32Facts.cs rename to test/Kernel32.Tests/Kernel32Facts.cs diff --git a/src/Kernel32.Tests/NTStatusExceptionFacts.cs b/test/Kernel32.Tests/NTStatusExceptionFacts.cs similarity index 100% rename from src/Kernel32.Tests/NTStatusExceptionFacts.cs rename to test/Kernel32.Tests/NTStatusExceptionFacts.cs diff --git a/src/Kernel32.Tests/UseCultureAttribute.cs b/test/Kernel32.Tests/UseCultureAttribute.cs similarity index 100% rename from src/Kernel32.Tests/UseCultureAttribute.cs rename to test/Kernel32.Tests/UseCultureAttribute.cs diff --git a/src/Kernel32.Tests/Win32ExceptionFacts.cs b/test/Kernel32.Tests/Win32ExceptionFacts.cs similarity index 100% rename from src/Kernel32.Tests/Win32ExceptionFacts.cs rename to test/Kernel32.Tests/Win32ExceptionFacts.cs diff --git a/src/Kernel32.Tests/storebanned/IgnoreOnOsVersionUnderFactAttribute.cs b/test/Kernel32.Tests/storebanned/IgnoreOnOsVersionUnderFactAttribute.cs similarity index 100% rename from src/Kernel32.Tests/storebanned/IgnoreOnOsVersionUnderFactAttribute.cs rename to test/Kernel32.Tests/storebanned/IgnoreOnOsVersionUnderFactAttribute.cs diff --git a/src/Kernel32.Tests/storebanned/Kernel32ExtensionsFacts.cs b/test/Kernel32.Tests/storebanned/Kernel32ExtensionsFacts.cs similarity index 100% rename from src/Kernel32.Tests/storebanned/Kernel32ExtensionsFacts.cs rename to test/Kernel32.Tests/storebanned/Kernel32ExtensionsFacts.cs diff --git a/src/Kernel32.Tests/storebanned/Kernel32Facts.cs b/test/Kernel32.Tests/storebanned/Kernel32Facts.cs similarity index 100% rename from src/Kernel32.Tests/storebanned/Kernel32Facts.cs rename to test/Kernel32.Tests/storebanned/Kernel32Facts.cs diff --git a/src/MSCorEE.Tests/Keys/keypair.snk b/test/MSCorEE.Tests/Keys/keypair.snk similarity index 100% rename from src/MSCorEE.Tests/Keys/keypair.snk rename to test/MSCorEE.Tests/Keys/keypair.snk diff --git a/src/MSCorEE.Tests/Keys/public.snk b/test/MSCorEE.Tests/Keys/public.snk similarity index 100% rename from src/MSCorEE.Tests/Keys/public.snk rename to test/MSCorEE.Tests/Keys/public.snk diff --git a/src/MSCorEE.Tests/MSCorEE.Tests.csproj b/test/MSCorEE.Tests/MSCorEE.Tests.csproj similarity index 63% rename from src/MSCorEE.Tests/MSCorEE.Tests.csproj rename to test/MSCorEE.Tests/MSCorEE.Tests.csproj index aff38b6a..3c124f1d 100644 --- a/src/MSCorEE.Tests/MSCorEE.Tests.csproj +++ b/test/MSCorEE.Tests/MSCorEE.Tests.csproj @@ -4,9 +4,9 @@ true - - - + + + @@ -17,7 +17,4 @@ - - - diff --git a/src/MSCorEE.Tests/MSCorEEFacts.cs b/test/MSCorEE.Tests/MSCorEEFacts.cs similarity index 100% rename from src/MSCorEE.Tests/MSCorEEFacts.cs rename to test/MSCorEE.Tests/MSCorEEFacts.cs diff --git a/src/DbgHelp.Tests/DbgHelp.Tests.csproj b/test/Magnification.Tests/Magnification.Tests.csproj similarity index 50% rename from src/DbgHelp.Tests/DbgHelp.Tests.csproj rename to test/Magnification.Tests/Magnification.Tests.csproj index 879b0553..7d245aa5 100644 --- a/src/DbgHelp.Tests/DbgHelp.Tests.csproj +++ b/test/Magnification.Tests/Magnification.Tests.csproj @@ -3,9 +3,7 @@ net472 - - - - + + diff --git a/src/Magnification.Tests/MagnificationFacts.cs b/test/Magnification.Tests/MagnificationFacts.cs similarity index 100% rename from src/Magnification.Tests/MagnificationFacts.cs rename to test/Magnification.Tests/MagnificationFacts.cs diff --git a/src/NewDev.Tests/NewDev.Tests.csproj b/test/Msi.Tests/Msi.Tests.csproj similarity index 72% rename from src/NewDev.Tests/NewDev.Tests.csproj rename to test/Msi.Tests/Msi.Tests.csproj index ede069df..87106e80 100644 --- a/src/NewDev.Tests/NewDev.Tests.csproj +++ b/test/Msi.Tests/Msi.Tests.csproj @@ -3,6 +3,6 @@ net472 - + diff --git a/src/Msi.Tests/MsiFacts.cs b/test/Msi.Tests/MsiFacts.cs similarity index 100% rename from src/Msi.Tests/MsiFacts.cs rename to test/Msi.Tests/MsiFacts.cs diff --git a/src/NCrypt.Tests/NCrypt.Tests.csproj b/test/NCrypt.Tests/NCrypt.Tests.csproj similarity index 67% rename from src/NCrypt.Tests/NCrypt.Tests.csproj rename to test/NCrypt.Tests/NCrypt.Tests.csproj index 39d4bb8a..f39e21d9 100644 --- a/src/NCrypt.Tests/NCrypt.Tests.csproj +++ b/test/NCrypt.Tests/NCrypt.Tests.csproj @@ -3,14 +3,11 @@ net472 - + UseCultureAttribute.cs - - - diff --git a/src/NCrypt.Tests/NCryptExtensionsFacts.cs b/test/NCrypt.Tests/NCryptExtensionsFacts.cs similarity index 100% rename from src/NCrypt.Tests/NCryptExtensionsFacts.cs rename to test/NCrypt.Tests/NCryptExtensionsFacts.cs diff --git a/src/NCrypt.Tests/NCryptFacts.cs b/test/NCrypt.Tests/NCryptFacts.cs similarity index 100% rename from src/NCrypt.Tests/NCryptFacts.cs rename to test/NCrypt.Tests/NCryptFacts.cs diff --git a/src/NCrypt.Tests/SecurityStatusExceptionFacts.cs b/test/NCrypt.Tests/SecurityStatusExceptionFacts.cs similarity index 100% rename from src/NCrypt.Tests/SecurityStatusExceptionFacts.cs rename to test/NCrypt.Tests/SecurityStatusExceptionFacts.cs diff --git a/test/NTDll.Tests/NTDll.Tests.csproj b/test/NTDll.Tests/NTDll.Tests.csproj new file mode 100644 index 00000000..62ed9308 --- /dev/null +++ b/test/NTDll.Tests/NTDll.Tests.csproj @@ -0,0 +1,9 @@ + + + net472 + + + + + + diff --git a/src/NTDll.Tests/NTDllFacts.cs b/test/NTDll.Tests/NTDllFacts.cs similarity index 100% rename from src/NTDll.Tests/NTDllFacts.cs rename to test/NTDll.Tests/NTDllFacts.cs diff --git a/test/NetApi32.Tests/NetApi32.Tests.csproj b/test/NetApi32.Tests/NetApi32.Tests.csproj new file mode 100644 index 00000000..5f8079f1 --- /dev/null +++ b/test/NetApi32.Tests/NetApi32.Tests.csproj @@ -0,0 +1,8 @@ + + + net472 + + + + + diff --git a/src/NetApi32.Tests/NetApi32Facts.cs b/test/NetApi32.Tests/NetApi32Facts.cs similarity index 100% rename from src/NetApi32.Tests/NetApi32Facts.cs rename to test/NetApi32.Tests/NetApi32Facts.cs diff --git a/src/IPHlpApi.Tests/IPHlpApi.Tests.csproj b/test/NewDev.Tests/NewDev.Tests.csproj similarity index 71% rename from src/IPHlpApi.Tests/IPHlpApi.Tests.csproj rename to test/NewDev.Tests/NewDev.Tests.csproj index 5919a10f..c15adda9 100644 --- a/src/IPHlpApi.Tests/IPHlpApi.Tests.csproj +++ b/test/NewDev.Tests/NewDev.Tests.csproj @@ -3,6 +3,6 @@ net472 - + diff --git a/src/NewDev.Tests/NewDevFacts.cs b/test/NewDev.Tests/NewDevFacts.cs similarity index 100% rename from src/NewDev.Tests/NewDevFacts.cs rename to test/NewDev.Tests/NewDevFacts.cs diff --git a/test/Ole32.Tests/Ole32.Tests.csproj b/test/Ole32.Tests/Ole32.Tests.csproj new file mode 100644 index 00000000..ba0aa0ac --- /dev/null +++ b/test/Ole32.Tests/Ole32.Tests.csproj @@ -0,0 +1,9 @@ + + + net472 + + + + + + diff --git a/src/Ole32.Tests/Ole32Facts.cs b/test/Ole32.Tests/Ole32Facts.cs similarity index 100% rename from src/Ole32.Tests/Ole32Facts.cs rename to test/Ole32.Tests/Ole32Facts.cs diff --git a/src/CfgMgr32.Tests/CfgMgr32.Tests.csproj b/test/Psapi.Tests/Psapi.Tests.csproj similarity index 71% rename from src/CfgMgr32.Tests/CfgMgr32.Tests.csproj rename to test/Psapi.Tests/Psapi.Tests.csproj index ec4f8d13..cf4057b7 100644 --- a/src/CfgMgr32.Tests/CfgMgr32.Tests.csproj +++ b/test/Psapi.Tests/Psapi.Tests.csproj @@ -3,6 +3,6 @@ net472 - + diff --git a/src/Psapi.Tests/PsapiFacts.cs b/test/Psapi.Tests/PsapiFacts.cs similarity index 100% rename from src/Psapi.Tests/PsapiFacts.cs rename to test/Psapi.Tests/PsapiFacts.cs diff --git a/test/SHCore.Tests/SHCore.Tests.csproj b/test/SHCore.Tests/SHCore.Tests.csproj new file mode 100644 index 00000000..58836089 --- /dev/null +++ b/test/SHCore.Tests/SHCore.Tests.csproj @@ -0,0 +1,8 @@ + + + net472 + + + + + diff --git a/src/SHCore.Tests/SHCoreFacts.cs b/test/SHCore.Tests/SHCoreFacts.cs similarity index 100% rename from src/SHCore.Tests/SHCoreFacts.cs rename to test/SHCore.Tests/SHCoreFacts.cs diff --git a/src/SetupApi.Tests/SP_DEVINFO_DATAFacts.cs b/test/SetupApi.Tests/SP_DEVINFO_DATAFacts.cs similarity index 100% rename from src/SetupApi.Tests/SP_DEVINFO_DATAFacts.cs rename to test/SetupApi.Tests/SP_DEVINFO_DATAFacts.cs diff --git a/src/SetupApi.Tests/SP_DEVINSTALL_PARAMSFacts.cs b/test/SetupApi.Tests/SP_DEVINSTALL_PARAMSFacts.cs similarity index 100% rename from src/SetupApi.Tests/SP_DEVINSTALL_PARAMSFacts.cs rename to test/SetupApi.Tests/SP_DEVINSTALL_PARAMSFacts.cs diff --git a/src/SetupApi.Tests/SP_DRVINFO_DATAFacts.cs b/test/SetupApi.Tests/SP_DRVINFO_DATAFacts.cs similarity index 100% rename from src/SetupApi.Tests/SP_DRVINFO_DATAFacts.cs rename to test/SetupApi.Tests/SP_DRVINFO_DATAFacts.cs diff --git a/src/SetupApi.Tests/SP_DRVINFO_DETAIL_DATAFacts.cs b/test/SetupApi.Tests/SP_DRVINFO_DETAIL_DATAFacts.cs similarity index 100% rename from src/SetupApi.Tests/SP_DRVINFO_DETAIL_DATAFacts.cs rename to test/SetupApi.Tests/SP_DRVINFO_DETAIL_DATAFacts.cs diff --git a/test/SetupApi.Tests/SetupApi.Tests.csproj b/test/SetupApi.Tests/SetupApi.Tests.csproj new file mode 100644 index 00000000..f358f694 --- /dev/null +++ b/test/SetupApi.Tests/SetupApi.Tests.csproj @@ -0,0 +1,8 @@ + + + net472 + + + + + diff --git a/src/SetupApi.Tests/SetupApiFacts.cs b/test/SetupApi.Tests/SetupApiFacts.cs similarity index 100% rename from src/SetupApi.Tests/SetupApiFacts.cs rename to test/SetupApi.Tests/SetupApiFacts.cs diff --git a/test/Shell32.Tests/Shell32.Tests.csproj b/test/Shell32.Tests/Shell32.Tests.csproj new file mode 100644 index 00000000..7a67b2c0 --- /dev/null +++ b/test/Shell32.Tests/Shell32.Tests.csproj @@ -0,0 +1,8 @@ + + + net472 + + + + + diff --git a/src/Shell32.Tests/Shell32Facts.cs b/test/Shell32.Tests/Shell32Facts.cs similarity index 100% rename from src/Shell32.Tests/Shell32Facts.cs rename to test/Shell32.Tests/Shell32Facts.cs diff --git a/test/User32.Tests/User32.Tests.csproj b/test/User32.Tests/User32.Tests.csproj new file mode 100644 index 00000000..a9deaf11 --- /dev/null +++ b/test/User32.Tests/User32.Tests.csproj @@ -0,0 +1,8 @@ + + + net472 + + + + + diff --git a/src/User32.Tests/User32Facts+EnumDisplaySettingsFacts.cs b/test/User32.Tests/User32Facts+EnumDisplaySettingsFacts.cs similarity index 100% rename from src/User32.Tests/User32Facts+EnumDisplaySettingsFacts.cs rename to test/User32.Tests/User32Facts+EnumDisplaySettingsFacts.cs diff --git a/src/User32.Tests/User32Facts+HwndSubClass.cs b/test/User32.Tests/User32Facts+HwndSubClass.cs similarity index 100% rename from src/User32.Tests/User32Facts+HwndSubClass.cs rename to test/User32.Tests/User32Facts+HwndSubClass.cs diff --git a/src/User32.Tests/User32Facts+WindowMessage.cs b/test/User32.Tests/User32Facts+WindowMessage.cs similarity index 100% rename from src/User32.Tests/User32Facts+WindowMessage.cs rename to test/User32.Tests/User32Facts+WindowMessage.cs diff --git a/src/User32.Tests/User32Facts.cs b/test/User32.Tests/User32Facts.cs similarity index 100% rename from src/User32.Tests/User32Facts.cs rename to test/User32.Tests/User32Facts.cs diff --git a/test/Userenv.Tests/Userenv.Tests.csproj b/test/Userenv.Tests/Userenv.Tests.csproj new file mode 100644 index 00000000..94832881 --- /dev/null +++ b/test/Userenv.Tests/Userenv.Tests.csproj @@ -0,0 +1,8 @@ + + + net472 + + + + + diff --git a/src/Userenv.Tests/UserenvFacts.cs b/test/Userenv.Tests/UserenvFacts.cs similarity index 100% rename from src/Userenv.Tests/UserenvFacts.cs rename to test/Userenv.Tests/UserenvFacts.cs diff --git a/test/UxTheme.Tests/UxTheme.Tests.csproj b/test/UxTheme.Tests/UxTheme.Tests.csproj new file mode 100644 index 00000000..568305d7 --- /dev/null +++ b/test/UxTheme.Tests/UxTheme.Tests.csproj @@ -0,0 +1,8 @@ + + + net472 + + + + + diff --git a/src/UxTheme.Tests/UxThemeFacts.cs b/test/UxTheme.Tests/UxThemeFacts.cs similarity index 100% rename from src/UxTheme.Tests/UxThemeFacts.cs rename to test/UxTheme.Tests/UxThemeFacts.cs diff --git a/src/WinUsb.Tests/WinUsb.Tests.csproj b/test/WinUsb.Tests/WinUsb.Tests.csproj similarity index 71% rename from src/WinUsb.Tests/WinUsb.Tests.csproj rename to test/WinUsb.Tests/WinUsb.Tests.csproj index e9302c8f..56bd8b28 100644 --- a/src/WinUsb.Tests/WinUsb.Tests.csproj +++ b/test/WinUsb.Tests/WinUsb.Tests.csproj @@ -3,6 +3,6 @@ net472 - + diff --git a/src/WinUsb.Tests/WinUsbFacts.cs b/test/WinUsb.Tests/WinUsbFacts.cs similarity index 100% rename from src/WinUsb.Tests/WinUsbFacts.cs rename to test/WinUsb.Tests/WinUsbFacts.cs diff --git a/src/Windows.Core.Tests/HResultFacts.cs b/test/Windows.Core.Tests/HResultFacts.cs similarity index 100% rename from src/Windows.Core.Tests/HResultFacts.cs rename to test/Windows.Core.Tests/HResultFacts.cs diff --git a/src/Windows.Core.Tests/NTStatusFacts.cs b/test/Windows.Core.Tests/NTStatusFacts.cs similarity index 100% rename from src/Windows.Core.Tests/NTStatusFacts.cs rename to test/Windows.Core.Tests/NTStatusFacts.cs diff --git a/src/Windows.Core.Tests/PInvokeExtensionsFacts.cs b/test/Windows.Core.Tests/PInvokeExtensionsFacts.cs similarity index 100% rename from src/Windows.Core.Tests/PInvokeExtensionsFacts.cs rename to test/Windows.Core.Tests/PInvokeExtensionsFacts.cs diff --git a/test/Windows.Core.Tests/Windows.Core.Tests.csproj b/test/Windows.Core.Tests/Windows.Core.Tests.csproj new file mode 100644 index 00000000..6fa918cc --- /dev/null +++ b/test/Windows.Core.Tests/Windows.Core.Tests.csproj @@ -0,0 +1,8 @@ + + + net472 + + + + + diff --git a/test/WtsApi32.Tests/WtsApi32.Tests.csproj b/test/WtsApi32.Tests/WtsApi32.Tests.csproj new file mode 100644 index 00000000..10a521d6 --- /dev/null +++ b/test/WtsApi32.Tests/WtsApi32.Tests.csproj @@ -0,0 +1,8 @@ + + + net472 + + + + + diff --git a/src/WtsApi32.Tests/WtsApi32Facts.cs b/test/WtsApi32.Tests/WtsApi32Facts.cs similarity index 100% rename from src/WtsApi32.Tests/WtsApi32Facts.cs rename to test/WtsApi32.Tests/WtsApi32Facts.cs diff --git a/tools/Create-PInvokeTxtFile.ps1 b/tools/Create-PInvokeTxtFile.ps1 index 634970eb..136fbbbc 100644 --- a/tools/Create-PInvokeTxtFile.ps1 +++ b/tools/Create-PInvokeTxtFile.ps1 @@ -13,12 +13,12 @@ Param( $exportedMethods = @() if (Test-Path $AssemblyPath) { - Add-Type -LiteralPath $AssemblyPath -PassThru |% { + Add-Type -LiteralPath $AssemblyPath -PassThru |% { $_.GetMethods($([Reflection.BindingFlags]'NonPublic,Public,Static')) | Where {!$_.GetMethodBody()} |% { $attribute = $_.GetCustomAttributes([System.Runtime.InteropServices.DllImportAttribute], $false) | Select -First 1 if ($attribute){ $exportedMethods += $attribute.EntryPoint - } + } } } } @@ -26,10 +26,10 @@ else { Write-Error "Unable to find file $AssemblyPath." } if ($exportedMethods.Count -gt 0) { - $fileName = (Get-Item $AssemblyPath).Basename -replace "PInvoke.", "" - $filePath = Join-Path (Get-Item $AssemblyPath).DirectoryName "$fileName.pinvokes.txt"; + $fileName = (Get-Item $AssemblyPath).Basename -replace "PInvoke.", "" + $filePath = Join-Path (Get-Item $AssemblyPath).DirectoryName "$fileName.pinvokes.txt"; Set-Content $filePath ($exportedMethods | Sort-Object) - Write-Verbose "P/Invoke method names written to $filePath" + Write-Verbose "P/Invoke method names written to $filePath" } else { - Write-Verbose "No P/Invoke methods found for $AssemblyPath." -} \ No newline at end of file + Write-Verbose "No P/Invoke methods found for $AssemblyPath." +} diff --git a/tools/Get-CoverageReport.ps1 b/tools/Get-CoverageReport.ps1 index 42076cd6..7d181f75 100644 --- a/tools/Get-CoverageReport.ps1 +++ b/tools/Get-CoverageReport.ps1 @@ -24,8 +24,8 @@ if (!$NoBuild) { $Shields = & "$PSScriptRoot\Get-Shields.ps1" -Directory "$PSScriptRoot\..\bin\$Configuration" -$version = & (& "$PSScriptRoot\..\azure-pipelines\Get-nbgv.ps1") get-version -p "$PSScriptRoot\..\src" -v SemVer2 -$commit = & (& "$PSScriptRoot\..\azure-pipelines\Get-nbgv.ps1") get-version -p "$PSScriptRoot\..\src" -v GitCommitId +$version = & (& "$PSScriptRoot\..\azure-pipelines\Get-nbgv.ps1") get-version -p "$PSScriptRoot\.." -v SemVer2 +$commit = & (& "$PSScriptRoot\..\azure-pipelines\Get-nbgv.ps1") get-version -p "$PSScriptRoot\.." -v GitCommitId $report = "# P/Invoke coverage report Coverage | Package