From 931fa65996fef1d6139bd2fe7e4ddc59a8fb7e02 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Thu, 2 Sep 2021 21:36:15 -0600 Subject: [PATCH] Build authoring cleanup (#630) * Don't launch debugger during build unless an environment variable is set * Add .editorconfig and apply to msbuild files * Delete obsolete sample pack script * Suppress some pack warnings * Build the metadata package to the same path as docs by default * Lots of build authoring cleanup * Consolidate nuget.config files wherever possible. * Consolidate msbuild sdk versions into a global.json file. * Consolidate definitions of OutputPath in msbuild projects. * Remove/fix msbuild properties that were inconsistently or redundantly applied in project files. * Move Project Sdk attributes from Sdk.props to each project that imported it. * Remove a bunch of 1-project solution files in favor of a new BuildTools.sln that contains them all. * Target net5.0 instead of netcoreapp3.1 * Add task to print out .NET version info * Disable signing consistently * Set up VS env vars * Fix bad paths for winmd --- apidocs/.editorconfig => .editorconfig | 13 +- BuildTools/BuildTools.proj | 7 +- Directory.Build.props | 23 +++- apidocs/Directory.Build.props | 2 - .../Microsoft.Windows.SDK.Win32Docs.csproj | 7 -- apidocs/ScrapeDocs/Directory.Build.props | 6 - apidocs/ScrapeDocs/ScrapeDocs.csproj | 1 + apidocs/global.json | 5 - azure-pipelines.yml | 84 ++++++++++--- global.json | 12 ++ .../DiaSdk/nuget.config => nuget.config | 0 scripts/BuildMetadataBin.ps1 | 3 +- scripts/CommonUtils.ps1 | 30 ++--- scripts/SamplePack.ps1 | 2 - sources/BuildTools.sln | 54 +++++++++ .../ClangSharpSourceToWinmd.csproj | 11 +- .../ClangSharpSourceToWinmd.sln | 49 -------- .../ConstantsScraper/ConstantsScraper.csproj | 10 +- sources/ConstantsScraper/ConstantsScraper.sln | 37 ------ sources/MetadataUtils/MetadataUtils.csproj | 6 +- sources/PartitionUtils/PartitionUtils.csproj | 2 +- sources/WinmdUtils/WinmdUtils.csproj | 6 +- sources/WinmdUtils/WinmdUtils.sln | 25 ---- sources/msbuild/DiaSdk/DiaSdk.proj | 112 ++++++++--------- .../DiaSdk/Microsoft.Dia.Win32Metadata.nuspec | 2 +- .../GeneratorSample/GeneratorSample.proj | 40 +++--- sources/msbuild/GeneratorSample/nuget.config | 12 -- .../GeneratorSampleDebug.proj | 65 +++++----- .../msbuild/GeneratorSampleDebug/nuget.config | 11 -- sources/msbuild/MetadataTasks/CompileIdls.cs | 5 +- .../MetadataTasks/MetadataTasks.csproj | 15 +-- .../msbuild/MetadataTasks/MetadataTasks.sln | 25 ---- sources/msbuild/MetadataTasks/ScanLibs.cs | 13 +- .../msbuild/MetadataTasks/ScrapeHeaders.cs | 82 ++++++------- .../WebView2SampleDebug.proj | 65 +++++----- .../msbuild/WebView2SampleDebug/nuget.config | 11 -- sources/msbuild/nuget/BuildSdk.nuspec | 6 +- sources/msbuild/nuget/BuildSdk.proj | 18 +-- sources/msbuild/sdk/sdk.props | 46 +++---- sources/msbuild/sdk/sdk.targets | 114 +++++++++--------- .../Win32MetadataNuget.proj | 3 +- 41 files changed, 474 insertions(+), 566 deletions(-) rename apidocs/.editorconfig => .editorconfig (95%) delete mode 100644 apidocs/ScrapeDocs/Directory.Build.props delete mode 100644 apidocs/global.json create mode 100644 global.json rename sources/msbuild/DiaSdk/nuget.config => nuget.config (100%) delete mode 100644 scripts/SamplePack.ps1 create mode 100644 sources/BuildTools.sln delete mode 100644 sources/ClangSharpSourceToWinmd/ClangSharpSourceToWinmd.sln delete mode 100644 sources/ConstantsScraper/ConstantsScraper.sln delete mode 100644 sources/WinmdUtils/WinmdUtils.sln delete mode 100644 sources/msbuild/GeneratorSample/nuget.config delete mode 100644 sources/msbuild/GeneratorSampleDebug/nuget.config delete mode 100644 sources/msbuild/MetadataTasks/MetadataTasks.sln delete mode 100644 sources/msbuild/WebView2SampleDebug/nuget.config diff --git a/apidocs/.editorconfig b/.editorconfig similarity index 95% rename from apidocs/.editorconfig rename to .editorconfig index 5cd2d9ef..0689e4e0 100644 --- a/apidocs/.editorconfig +++ b/.editorconfig @@ -30,6 +30,7 @@ indent_size = 2 # JSON files [*.json] indent_size = 2 +indent_style = space # Dotnet code style settings: [*.{cs,vb}] @@ -128,9 +129,9 @@ csharp_indent_switch_labels = true csharp_indent_labels = flush_left # Prefer "var" everywhere -csharp_style_var_for_built_in_types = true:suggestion +csharp_style_var_for_built_in_types = false csharp_style_var_when_type_is_apparent = true:suggestion -csharp_style_var_elsewhere = false:suggestion +csharp_style_var_elsewhere = false:warning # Prefer method-like constructs to have a block body csharp_style_expression_bodied_methods = false:none @@ -160,10 +161,14 @@ csharp_new_line_before_members_in_anonymous_types = true # Blocks are allowed csharp_prefer_braces = true:silent -[*.cs] - # SA1130: Use lambda syntax dotnet_diagnostic.SA1130.severity = silent +# CA1508: Avoid dead conditional code +dotnet_diagnostic.CA1508.severity = warning + +# IDE1006: Naming Styles - StyleCop handles these for us +dotnet_diagnostic.IDE1006.severity = none + [*.sln] indent_style = tab diff --git a/BuildTools/BuildTools.proj b/BuildTools/BuildTools.proj index 57b456fc..73a10129 100644 --- a/BuildTools/BuildTools.proj +++ b/BuildTools/BuildTools.proj @@ -1,8 +1,4 @@ - - - Release - - + @@ -11,6 +7,7 @@ + diff --git a/Directory.Build.props b/Directory.Build.props index 489342e5..23db1c25 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -11,12 +11,27 @@ Debug $(MSBuildThisFileDirectory) + $(RepoRootPath)obj\$(MSBuildProjectName)\ + $(RepoRootPath)bin\$(Configuration) + $(MSBuildThisFileDirectory)bin\Packages\$(Configuration)\NuGet\ + + $(RepoRootPath)bin\$(Configuration)\netstandard2.0\ + + 9 + + Microsoft + Microsoft + © Microsoft Corporation. All rights reserved. + https://github.com/microsoft/win32metadata + true + images/windows.png - - 3.4.194 - all - + + + + + diff --git a/apidocs/Directory.Build.props b/apidocs/Directory.Build.props index 036cf95a..db3af843 100644 --- a/apidocs/Directory.Build.props +++ b/apidocs/Directory.Build.props @@ -2,9 +2,7 @@ - $(RepoRootPath)bin\Packages\$(Configuration)\NuGet\ true - 9.0 enable true $(RepoRootPath)\strongname.snk diff --git a/apidocs/Microsoft.Windows.SDK.Win32Docs/Microsoft.Windows.SDK.Win32Docs.csproj b/apidocs/Microsoft.Windows.SDK.Win32Docs/Microsoft.Windows.SDK.Win32Docs.csproj index 24d65b75..b9e7890c 100644 --- a/apidocs/Microsoft.Windows.SDK.Win32Docs/Microsoft.Windows.SDK.Win32Docs.csproj +++ b/apidocs/Microsoft.Windows.SDK.Win32Docs/Microsoft.Windows.SDK.Win32Docs.csproj @@ -5,15 +5,9 @@ $(NoWarn);NU5128;NU5125 true - Microsoft - Microsoft - © Microsoft Corporation. All rights reserved. Microsoft Windows API documentation Win32 Metadata - https://github.com/microsoft/win32metadata https://aka.ms/WinSDKLicenseURL - true - images/windows.png @@ -22,7 +16,6 @@ - diff --git a/apidocs/ScrapeDocs/Directory.Build.props b/apidocs/ScrapeDocs/Directory.Build.props deleted file mode 100644 index a3b22a14..00000000 --- a/apidocs/ScrapeDocs/Directory.Build.props +++ /dev/null @@ -1,6 +0,0 @@ - - - true - - - diff --git a/apidocs/ScrapeDocs/ScrapeDocs.csproj b/apidocs/ScrapeDocs/ScrapeDocs.csproj index b899a058..5491c72c 100644 --- a/apidocs/ScrapeDocs/ScrapeDocs.csproj +++ b/apidocs/ScrapeDocs/ScrapeDocs.csproj @@ -2,6 +2,7 @@ Exe + net5.0 false diff --git a/apidocs/global.json b/apidocs/global.json deleted file mode 100644 index 5ecd5ee6..00000000 --- a/apidocs/global.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "sdk": { - "version": "5.0.301" - } -} diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 80109353..641ce50a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -21,10 +21,10 @@ jobs: lfs: true - task: UseDotNet@2 - displayName: Use DotNet 3.x + displayName: ⚙ Install .NET SDK inputs: - packageType: 'sdk' - version: '3.x' + packageType: sdk + useGlobalJson: true - task: PowerShell@2 displayName: Set build version @@ -70,10 +70,10 @@ jobs: - checkout: self lfs: true - task: UseDotNet@2 - displayName: Use DotNet 3.x + displayName: ⚙ Install .NET SDK inputs: - packageType: 'sdk' - version: '3.x' + packageType: sdk + useGlobalJson: true - task: PowerShell@2 displayName: GenerateMetadataSource.ps1 - x86 @@ -97,10 +97,10 @@ jobs: - checkout: self lfs: true - task: UseDotNet@2 - displayName: Use DotNet 3.x + displayName: ⚙ Install .NET SDK inputs: - packageType: 'sdk' - version: '3.x' + packageType: sdk + useGlobalJson: true - task: PowerShell@2 displayName: GenerateMetadataSource.ps1 - arm64 @@ -127,17 +127,17 @@ jobs: - checkout: self lfs: true - - task: UseDotNet@2 - displayName: Use DotNet 3.x + - task: BatchScript@1 + displayName: Set up VS environment inputs: - packageType: 'sdk' - version: '3.x' + filename: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat' + modifyEnvironment: true - task: UseDotNet@2 - displayName: Use DotNet 5.x + displayName: ⚙ Install .NET SDK inputs: - packageType: 'sdk' - version: '5.x' + packageType: sdk + useGlobalJson: true # ESRP Authenticode sign package DLLs - task: UseDotNet@2 @@ -146,6 +146,9 @@ jobs: packageType: runtime version: 2.1.x + - script: dotnet --info + displayName: Display .NET SDK/runtime info + - task: DownloadPipelineArtifact@2 displayName: Download x64 scraper obj assets inputs: @@ -230,11 +233,53 @@ jobs: condition: and(succeeded(), eq(variables['SignFiles'], 'true'), ne(variables['Build.Reason'], 'PullRequest')) - task: EsrpCodeSigning@1 - displayName: 'Authenticode Sign Binaries in MSBuild SDK package' + displayName: Authenticode sign net5.0 binaries in MSBuild SDK package inputs: ConnectedServiceName: 'Undocked RegFree Signing Connection' - FolderPath: '$(Build.SourcesDirectory)\bin\release\netcoreapp3.1' - Pattern: 'ClangSharpSourceToWinmd.dll,ConstantsScraper.dll,MetadataTasks.dll,MetadataUtils.dll,WinmdUtils.dll' + FolderPath: '$(Build.SourcesDirectory)\bin\$(BuildConfiguration)\net5.0' + Pattern: 'ClangSharpSourceToWinmd.dll,ConstantsScraper.dll,MetadataUtils.dll,WinmdUtils.dll' + signConfigType: 'inlineSignParams' + inlineOperation: | + [ + { + "keyCode": "CP-230012", + "operationSetCode": "SigntoolSign", + "parameters": [ + { + "parameterName": "OpusName", + "parameterValue": "Microsoft" + }, + { + "parameterName": "OpusInfo", + "parameterValue": "http://www.microsoft.com" + }, + { + "parameterName": "PageHash", + "parameterValue": "/NPH" + }, + { + "parameterName": "FileDigest", + "parameterValue": "/fd sha256" + }, + { + "parameterName": "TimeStamp", + "parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256" + } + ], + "toolName": "signtool.exe", + "toolVersion": "6.2.9304.0" + } + ] + SessionTimeout: '60' + MaxConcurrency: '50' + MaxRetryAttempts: '2' + condition: and(succeeded(), eq(variables['SignFiles'], 'true'), ne(variables['Build.Reason'], 'PullRequest')) + - task: EsrpCodeSigning@1 + displayName: Authenticode sign netstandard2.0 binaries in MSBuild SDK package + inputs: + ConnectedServiceName: 'Undocked RegFree Signing Connection' + FolderPath: '$(Build.SourcesDirectory)\bin\$(BuildConfiguration)\netstandard2.0' + Pattern: 'MetadataTasks.dll' signConfigType: 'inlineSignParams' inlineOperation: | [ @@ -361,7 +406,6 @@ jobs: inputs: packageType: sdk useGlobalJson: true - workingDirectory: apidocs # ESRP Authenticode sign package DLLs - task: UseDotNet@2 diff --git a/global.json b/global.json new file mode 100644 index 00000000..8ad26141 --- /dev/null +++ b/global.json @@ -0,0 +1,12 @@ +{ + "sdk": { + "version": "5.0.400", + "allowPrerelease": false, + "rollForward": "feature" + }, + "msbuild-sdks": { + "Microsoft.Build.NoTargets": "3.0.4", + "Microsoft.Build.Traversal": "3.0.23", + "Microsoft.Windows.WinmdGenerator": "0.2.118-preview" + } +} diff --git a/sources/msbuild/DiaSdk/nuget.config b/nuget.config similarity index 100% rename from sources/msbuild/DiaSdk/nuget.config rename to nuget.config diff --git a/scripts/BuildMetadataBin.ps1 b/scripts/BuildMetadataBin.ps1 index 9511fbfa..b99f2179 100644 --- a/scripts/BuildMetadataBin.ps1 +++ b/scripts/BuildMetadataBin.ps1 @@ -26,8 +26,7 @@ $assemblyVersion = nbgv get-version -v AssemblyVersion $constantsScraperPathBin = "$metadataToolsBin\ConstantsScraper.dll" $clangSharpSourceToWinmdBin = "$metadataToolsBin\ClangSharpSourceToWinmd.dll" -$metadataInteropPath = "$sourcesDir\Win32MetadataInterop" -$metadataInteropBin = "$metadataInteropPath\bin\Release\netstandard2.1\Windows.Win32.Interop.dll" +$metadataInteropBin = "$PSScriptRoot\..\bin\Release\netstandard2.1\Windows.Win32.Interop.dll" Copy-Item $metadataInteropBin $binDir diff --git a/scripts/CommonUtils.ps1 b/scripts/CommonUtils.ps1 index 064ebd8b..28779a20 100644 --- a/scripts/CommonUtils.ps1 +++ b/scripts/CommonUtils.ps1 @@ -12,7 +12,7 @@ $sdkApiPath = "$rootDir\ext\sdk-api" $sdkGeneratedSourceDir = "$emitterDir\generated" $artifactsDir = "$scraperDir\obj" $recompiledIdlHeadersDir = "$artifactsDir\RecompiledIdlHeaders" -$metadataToolsBin = "$binDir\release\netcoreapp3.1" +$metadataToolsBin = "$binDir\release\net5.0" if (Test-Path -Path $binDir -PathType leaf) { @@ -24,17 +24,17 @@ if (!(Test-Path -Path $binDir)) New-Item -ItemType Directory -Force -Path $binDir | Out-Null } -function Create-Directory([string[]] $Path) +function Create-Directory([string[]] $Path) { - if (!(Test-Path -Path $Path)) + if (!(Test-Path -Path $Path)) { New-Item -Path $Path -Force -ItemType "Directory" | Out-Null } } -function Remove-Directory([string[]] $Path) +function Remove-Directory([string[]] $Path) { - if ((Test-Path -Path $Path)) + if ((Test-Path -Path $Path)) { Remove-Item $Path -Recurse } @@ -67,7 +67,7 @@ function Install-BuildTools Install-DotNetTool -Name ClangSharpPInvokeGenerator -Version 11.0.0-beta3 Install-DotNetTool -Name nbgv - & dotnet build "$rootDir\BuildTools\BuildTools.proj" -c Release + & dotnet build "$rootDir\buildtools" -c Release } function Replace-Text @@ -79,20 +79,20 @@ function Replace-Text { $content = $content.Replace($key, $items[$key]); } - + Set-Content -path $path -Encoding UTF8 -value $content } function Get-LibMappingsFile { $libMappingOutputFileName = Join-Path -Path $scraperDir -ChildPath "libMappings.rsp" - + return $libMappingOutputFileName } function Get-BuildToolsNugetProps { - [xml]$buildNugetProps = Get-Content -path "$rootDir\BuildTools\obj\BuildTools.proj.nuget.g.props" + [xml]$buildNugetProps = Get-Content -path "$rootDir\obj\BuildTools\BuildTools.proj.nuget.g.props" return $buildNugetProps; } @@ -144,7 +144,7 @@ function Invoke-RecompileMidlHeaders copy-item -Path "$sdkIncludeDir\winrt" -destination "$recompiledIdlHeadersDir" -recurse Write-Output "Recompiling midl headers with SAL annotations in $recompiledIdlHeadersDir" - + $version = $defaultWinSDKNugetVersion $sdkParts = $version.Split('.') $sdkVersion = "$($sdkParts[0]).$($sdkParts[1]).$($sdkParts[2]).0" @@ -163,13 +163,13 @@ function Get-VcDirPath $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" $installDir = & $vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath - if ($installDir) + if ($installDir) { $path = join-path $installDir 'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt' - if (test-path $path) + if (test-path $path) { $version = Get-Content -raw $path - if ($version) + if ($version) { $version = $version.Trim() $path = join-path $installDir "VC\Tools\MSVC\$version\bin\Host$HostArch\$Arch" @@ -196,7 +196,7 @@ function Get-OutputWinmdFileName return $path } - + function Download-Nupkg { Param ([string] $name, [string] $version, [string] $outputDir) @@ -212,7 +212,7 @@ function Get-ExcludedItems { param ([string[]]$rspFiles) [hashtable]$excludedItems = @{} - + $inExcluded = $false foreach ($rsp in $rspFiles) { diff --git a/scripts/SamplePack.ps1 b/scripts/SamplePack.ps1 deleted file mode 100644 index a4fff721..00000000 --- a/scripts/SamplePack.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -.\tools\nuget.exe pack .\sources\nuget\Microsoft.Windows.SDK.Win32Metadata\Microsoft.Windows.SDK.Win32Metadata.nuspec -version 10.0.20195.1001-preview.rs-onecore-dep -BasePath . -verbosity Detailed -OutputDirectory $env:TEMP - diff --git a/sources/BuildTools.sln b/sources/BuildTools.sln new file mode 100644 index 00000000..f44e2fa0 --- /dev/null +++ b/sources/BuildTools.sln @@ -0,0 +1,54 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31629.42 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "msbuild", "msbuild", "{D3E6399F-0983-4742-B07C-874B6ED80E51}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MetadataTasks", "msbuild\MetadataTasks\MetadataTasks.csproj", "{5B6F6176-0031-4105-B9FF-B713499D8975}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConstantsScraper", "ConstantsScraper\ConstantsScraper.csproj", "{8C0897A4-2BA6-40D5-AF41-130BE109C024}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClangSharpSourceToWinmd", "ClangSharpSourceToWinmd\ClangSharpSourceToWinmd.csproj", "{74D143DF-9C79-4E34-83C8-0347826317D7}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinmdUtils", "WinmdUtils\WinmdUtils.csproj", "{D58855C2-F427-4C4D-990A-7F932A7B4CA3}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win32MetadataInterop", "Win32MetadataInterop\Win32MetadataInterop.csproj", "{C8AA8253-FF34-4963-9CD0-B7A4C28D33BB}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5B6F6176-0031-4105-B9FF-B713499D8975}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5B6F6176-0031-4105-B9FF-B713499D8975}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5B6F6176-0031-4105-B9FF-B713499D8975}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5B6F6176-0031-4105-B9FF-B713499D8975}.Release|Any CPU.Build.0 = Release|Any CPU + {8C0897A4-2BA6-40D5-AF41-130BE109C024}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8C0897A4-2BA6-40D5-AF41-130BE109C024}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8C0897A4-2BA6-40D5-AF41-130BE109C024}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8C0897A4-2BA6-40D5-AF41-130BE109C024}.Release|Any CPU.Build.0 = Release|Any CPU + {74D143DF-9C79-4E34-83C8-0347826317D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {74D143DF-9C79-4E34-83C8-0347826317D7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {74D143DF-9C79-4E34-83C8-0347826317D7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {74D143DF-9C79-4E34-83C8-0347826317D7}.Release|Any CPU.Build.0 = Release|Any CPU + {D58855C2-F427-4C4D-990A-7F932A7B4CA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D58855C2-F427-4C4D-990A-7F932A7B4CA3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D58855C2-F427-4C4D-990A-7F932A7B4CA3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D58855C2-F427-4C4D-990A-7F932A7B4CA3}.Release|Any CPU.Build.0 = Release|Any CPU + {C8AA8253-FF34-4963-9CD0-B7A4C28D33BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C8AA8253-FF34-4963-9CD0-B7A4C28D33BB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C8AA8253-FF34-4963-9CD0-B7A4C28D33BB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C8AA8253-FF34-4963-9CD0-B7A4C28D33BB}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {5B6F6176-0031-4105-B9FF-B713499D8975} = {D3E6399F-0983-4742-B07C-874B6ED80E51} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {156D7600-E986-417B-9D16-E6FA1039AF42} + EndGlobalSection +EndGlobal diff --git a/sources/ClangSharpSourceToWinmd/ClangSharpSourceToWinmd.csproj b/sources/ClangSharpSourceToWinmd/ClangSharpSourceToWinmd.csproj index 66cce9ac..72f66e02 100644 --- a/sources/ClangSharpSourceToWinmd/ClangSharpSourceToWinmd.csproj +++ b/sources/ClangSharpSourceToWinmd/ClangSharpSourceToWinmd.csproj @@ -2,19 +2,10 @@ Exe - netcoreapp3.1 - - - - DEBUG;TRACE + net5.0 true - - true - ..\..\bin\release - - diff --git a/sources/ClangSharpSourceToWinmd/ClangSharpSourceToWinmd.sln b/sources/ClangSharpSourceToWinmd/ClangSharpSourceToWinmd.sln deleted file mode 100644 index ab136a77..00000000 --- a/sources/ClangSharpSourceToWinmd/ClangSharpSourceToWinmd.sln +++ /dev/null @@ -1,49 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30413.136 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClangSharpSourceToWinmd", "ClangSharpSourceToWinmd.csproj", "{1A969AD2-5215-469C-BCBB-C7B38F4DA253}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win32MetadataInterop", "..\Win32MetadataInterop\Win32MetadataInterop.csproj", "{C08DB25A-5497-4CE2-82F2-2D8624283387}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinmdUtils", "..\WinmdUtils\WinmdUtils.csproj", "{6D8F0882-429D-4359-A3DD-CBD905D95C14}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConstantsScraper", "..\ConstantsScraper\ConstantsScraper.csproj", "{0EFEA32F-64C4-4FA3-A507-0ECD38CF0678}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MetadataUtils", "..\MetadataUtils\MetadataUtils.csproj", "{BCE1D6B7-74EB-461A-A971-E55BFEA44DDF}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {1A969AD2-5215-469C-BCBB-C7B38F4DA253}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1A969AD2-5215-469C-BCBB-C7B38F4DA253}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1A969AD2-5215-469C-BCBB-C7B38F4DA253}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1A969AD2-5215-469C-BCBB-C7B38F4DA253}.Release|Any CPU.Build.0 = Release|Any CPU - {C08DB25A-5497-4CE2-82F2-2D8624283387}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C08DB25A-5497-4CE2-82F2-2D8624283387}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C08DB25A-5497-4CE2-82F2-2D8624283387}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C08DB25A-5497-4CE2-82F2-2D8624283387}.Release|Any CPU.Build.0 = Release|Any CPU - {6D8F0882-429D-4359-A3DD-CBD905D95C14}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6D8F0882-429D-4359-A3DD-CBD905D95C14}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6D8F0882-429D-4359-A3DD-CBD905D95C14}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6D8F0882-429D-4359-A3DD-CBD905D95C14}.Release|Any CPU.Build.0 = Release|Any CPU - {0EFEA32F-64C4-4FA3-A507-0ECD38CF0678}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0EFEA32F-64C4-4FA3-A507-0ECD38CF0678}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0EFEA32F-64C4-4FA3-A507-0ECD38CF0678}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0EFEA32F-64C4-4FA3-A507-0ECD38CF0678}.Release|Any CPU.Build.0 = Release|Any CPU - {BCE1D6B7-74EB-461A-A971-E55BFEA44DDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BCE1D6B7-74EB-461A-A971-E55BFEA44DDF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BCE1D6B7-74EB-461A-A971-E55BFEA44DDF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BCE1D6B7-74EB-461A-A971-E55BFEA44DDF}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {55478AB3-8FFE-47CD-B394-F089CFD6F5FC} - EndGlobalSection -EndGlobal diff --git a/sources/ConstantsScraper/ConstantsScraper.csproj b/sources/ConstantsScraper/ConstantsScraper.csproj index 186a56a6..b372e460 100644 --- a/sources/ConstantsScraper/ConstantsScraper.csproj +++ b/sources/ConstantsScraper/ConstantsScraper.csproj @@ -2,15 +2,7 @@ Exe - netcoreapp3.1 - - - - - - - - ..\..\bin\release + net5.0 diff --git a/sources/ConstantsScraper/ConstantsScraper.sln b/sources/ConstantsScraper/ConstantsScraper.sln deleted file mode 100644 index 52230181..00000000 --- a/sources/ConstantsScraper/ConstantsScraper.sln +++ /dev/null @@ -1,37 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30804.86 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConstantsScraper", "ConstantsScraper.csproj", "{39E2AD50-323F-4490-8B05-A6C6AFCC1443}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PartitionUtils", "..\PartitionUtils\PartitionUtils.csproj", "{7D60EA7C-6A97-421E-A84E-8F61F73DB245}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MetadataUtils", "..\MetadataUtils\MetadataUtils.csproj", "{B101B407-94A4-4BC6-A1E8-A0E1AC04B246}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {39E2AD50-323F-4490-8B05-A6C6AFCC1443}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {39E2AD50-323F-4490-8B05-A6C6AFCC1443}.Debug|Any CPU.Build.0 = Debug|Any CPU - {39E2AD50-323F-4490-8B05-A6C6AFCC1443}.Release|Any CPU.ActiveCfg = Release|Any CPU - {39E2AD50-323F-4490-8B05-A6C6AFCC1443}.Release|Any CPU.Build.0 = Release|Any CPU - {7D60EA7C-6A97-421E-A84E-8F61F73DB245}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7D60EA7C-6A97-421E-A84E-8F61F73DB245}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7D60EA7C-6A97-421E-A84E-8F61F73DB245}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7D60EA7C-6A97-421E-A84E-8F61F73DB245}.Release|Any CPU.Build.0 = Release|Any CPU - {B101B407-94A4-4BC6-A1E8-A0E1AC04B246}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B101B407-94A4-4BC6-A1E8-A0E1AC04B246}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B101B407-94A4-4BC6-A1E8-A0E1AC04B246}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B101B407-94A4-4BC6-A1E8-A0E1AC04B246}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {570EE57B-A467-4DAE-A45C-60EBE8A0872B} - EndGlobalSection -EndGlobal diff --git a/sources/MetadataUtils/MetadataUtils.csproj b/sources/MetadataUtils/MetadataUtils.csproj index 874f91d3..4ebe43e2 100644 --- a/sources/MetadataUtils/MetadataUtils.csproj +++ b/sources/MetadataUtils/MetadataUtils.csproj @@ -1,13 +1,11 @@  - netcoreapp3.1 + net5.0 - - true + true - ..\..\bin\release diff --git a/sources/PartitionUtils/PartitionUtils.csproj b/sources/PartitionUtils/PartitionUtils.csproj index 5288987b..3c2e12b1 100644 --- a/sources/PartitionUtils/PartitionUtils.csproj +++ b/sources/PartitionUtils/PartitionUtils.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net5.0 diff --git a/sources/WinmdUtils/WinmdUtils.csproj b/sources/WinmdUtils/WinmdUtils.csproj index b921b261..4a12a3d3 100644 --- a/sources/WinmdUtils/WinmdUtils.csproj +++ b/sources/WinmdUtils/WinmdUtils.csproj @@ -2,11 +2,7 @@ Exe - netcoreapp3.1 - - - - ..\..\bin\release + net5.0 diff --git a/sources/WinmdUtils/WinmdUtils.sln b/sources/WinmdUtils/WinmdUtils.sln deleted file mode 100644 index 2ce4b55d..00000000 --- a/sources/WinmdUtils/WinmdUtils.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30804.86 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinmdUtils", "WinmdUtils.csproj", "{E9A699AC-A690-42ED-83E1-66CB7F65058D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E9A699AC-A690-42ED-83E1-66CB7F65058D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E9A699AC-A690-42ED-83E1-66CB7F65058D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E9A699AC-A690-42ED-83E1-66CB7F65058D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E9A699AC-A690-42ED-83E1-66CB7F65058D}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {10CB32D9-2A44-4DE0-B020-26B136672FE1} - EndGlobalSection -EndGlobal diff --git a/sources/msbuild/DiaSdk/DiaSdk.proj b/sources/msbuild/DiaSdk/DiaSdk.proj index 5dfde44d..a50d4601 100644 --- a/sources/msbuild/DiaSdk/DiaSdk.proj +++ b/sources/msbuild/DiaSdk/DiaSdk.proj @@ -1,58 +1,62 @@ - - - + + + + $(RepoRootPath)bin\$(Configuration)\net5.0 + $(RepoRootPath)tools + $(RepoRootPath)scripts + $(RepoRootPath)generation\scraper + $(RepoRootPath)generation\scraper\obj\x64 + $(RepoRootPath)bin + + + + + + $(RepoRootPath)bin\Microsoft.Dia.winmd + 1.0.0.0 + false + $(VSINSTALLDIR)\DIA SDK + $(DiaSdkRoot)\idl + $(DiaSdkRoot)\include + $(CompiledHeadersDir);$(DiaIncRoot) + + + + false + Microsoft.Dia.Win32Metadata.nuspec + + . + netstandard2.0 + $(NoWarn);NU5100;NU5127 + + + + + + + + + + + @(Headers) + Microsoft.Dia + __MIDL___MIDL_itf_dia2_0000_0033_0001;__MIDL___MIDL_itf_dia2_0000_0000_0001;PfnPDBDebugDirV + __MIDL___MIDL_itf_dia2_0000_0042_0001=FPODATA + dia.manual.cs + + + + + + + + + - $(MSBuildThisFileDirectory)..\..\..\bin\release\netcoreapp3.1 - $(MSBuildThisFileDirectory)..\..\..\bin\release\netcoreapp3.1 - $(MSBuildThisFileDirectory)..\..\..\tools - $(MSBuildThisFileDirectory)..\..\..\scripts - $(MSBuildThisFileDirectory)..\..\..\generation\scraper - $(MSBuildThisFileDirectory)..\..\..\generation\scraper\obj\x64 - $(MSBuildThisFileDirectory)..\..\..\bin + $(NuspecProperties);OutputWinmd=$(OutputWinmd);Version=$(Version) + - - - - bin\Microsoft.Dia.winmd - 1.0.0.0 - false - C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\DIA SDK - $(DiaSdkRoot)\idl - $(DiaSdkRoot)\include - $(CompiledHeadersDir);$(DiaIncRoot) - - - - false - Microsoft.Dia.Win32Metadata.nuspec - - . - netstandard2.0 - - - - - - - - - - - @(Headers) - Microsoft.Dia - __MIDL___MIDL_itf_dia2_0000_0033_0001;__MIDL___MIDL_itf_dia2_0000_0000_0001;PfnPDBDebugDirV - __MIDL___MIDL_itf_dia2_0000_0042_0001=FPODATA - dia.manual.cs - - - - - - $(NuspecProperties);Version=$(Version) - - - - - \ No newline at end of file + + diff --git a/sources/msbuild/DiaSdk/Microsoft.Dia.Win32Metadata.nuspec b/sources/msbuild/DiaSdk/Microsoft.Dia.Win32Metadata.nuspec index 82a24590..3dedacfb 100644 --- a/sources/msbuild/DiaSdk/Microsoft.Dia.Win32Metadata.nuspec +++ b/sources/msbuild/DiaSdk/Microsoft.Dia.Win32Metadata.nuspec @@ -21,7 +21,7 @@ - + diff --git a/sources/msbuild/GeneratorSample/GeneratorSample.proj b/sources/msbuild/GeneratorSample/GeneratorSample.proj index f058c900..db440043 100644 --- a/sources/msbuild/GeneratorSample/GeneratorSample.proj +++ b/sources/msbuild/GeneratorSample/GeneratorSample.proj @@ -1,26 +1,26 @@ - - - - bin\Windows.Win32.Graphics.DirectWriteCore.winmd - 1.0.0.0 - false - + - - - + + bin\Windows.Win32.Graphics.DirectWriteCore.winmd + 1.0.0.0 + false + - - - @(DWriteHeaders) - Windows.Win32.Graphics.DirectWriteCore - ID2D1SimplifiedGeometrySink;_D3DCOLORVALUE - - + + + - - - + + + @(DWriteHeaders) + Windows.Win32.Graphics.DirectWriteCore + ID2D1SimplifiedGeometrySink;_D3DCOLORVALUE + + + + + + diff --git a/sources/msbuild/GeneratorSample/nuget.config b/sources/msbuild/GeneratorSample/nuget.config deleted file mode 100644 index ccb51fb5..00000000 --- a/sources/msbuild/GeneratorSample/nuget.config +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/sources/msbuild/GeneratorSampleDebug/GeneratorSampleDebug.proj b/sources/msbuild/GeneratorSampleDebug/GeneratorSampleDebug.proj index 44e1258f..11826c57 100644 --- a/sources/msbuild/GeneratorSampleDebug/GeneratorSampleDebug.proj +++ b/sources/msbuild/GeneratorSampleDebug/GeneratorSampleDebug.proj @@ -1,40 +1,39 @@ - - - - - $(MSBuildThisFileDirectory)..\..\..\bin\release\netcoreapp3.1 - $(MSBuildThisFileDirectory)..\..\..\bin\release\netcoreapp3.1 - $(MSBuildThisFileDirectory)..\..\..\tools - $(MSBuildThisFileDirectory)..\..\..\scripts - $(MSBuildThisFileDirectory)..\..\..\generation\scraper - $(MSBuildThisFileDirectory)..\..\..\generation\scraper\obj\x64 - $(MSBuildThisFileDirectory)..\..\..\bin - + - + + + $(RepoRootPath)bin\$(Configuration)\net5.0 + $(RepoRootPath)tools + $(RepoRootPath)scripts + $(RepoRootPath)generation\scraper + $(RepoRootPath)generation\scraper\obj\x64 + $(RepoRootPath)bin + - - bin\Windows.Win32.Graphics.DirectWriteCore.winmd - 1.0.0.0 - false - + - - - + + bin\Windows.Win32.Graphics.DirectWriteCore.winmd + 1.0.0.0 + false + - - - @(DWriteHeaders) - Windows.Win32.Graphics.DirectWriteCore - ID2D1SimplifiedGeometrySink;_D3DCOLORVALUE - - + + + - - - + + + @(DWriteHeaders) + Windows.Win32.Graphics.DirectWriteCore + ID2D1SimplifiedGeometrySink;_D3DCOLORVALUE + + - - \ No newline at end of file + + + + + + diff --git a/sources/msbuild/GeneratorSampleDebug/nuget.config b/sources/msbuild/GeneratorSampleDebug/nuget.config deleted file mode 100644 index 86799ffe..00000000 --- a/sources/msbuild/GeneratorSampleDebug/nuget.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/sources/msbuild/MetadataTasks/CompileIdls.cs b/sources/msbuild/MetadataTasks/CompileIdls.cs index 4bb79a81..478aa3a3 100644 --- a/sources/msbuild/MetadataTasks/CompileIdls.cs +++ b/sources/msbuild/MetadataTasks/CompileIdls.cs @@ -59,7 +59,10 @@ namespace MetadataTasks public override bool Execute() { #if DEBUG - System.Diagnostics.Debugger.Launch(); + if (System.Environment.GetEnvironmentVariable("DEBUG_TASKS") == "1") + { + System.Diagnostics.Debugger.Launch(); + } #endif string[] idls = GetIdls(); diff --git a/sources/msbuild/MetadataTasks/MetadataTasks.csproj b/sources/msbuild/MetadataTasks/MetadataTasks.csproj index 3c0d1cc3..608fb430 100644 --- a/sources/msbuild/MetadataTasks/MetadataTasks.csproj +++ b/sources/msbuild/MetadataTasks/MetadataTasks.csproj @@ -1,24 +1,11 @@  - netcoreapp3.1 - - - + netstandard2.0 5 - ..\..\..\bin\debug 1701;1702; - DEBUG;TRACE - - ..\..\..\bin\release - - - - - - diff --git a/sources/msbuild/MetadataTasks/MetadataTasks.sln b/sources/msbuild/MetadataTasks/MetadataTasks.sln deleted file mode 100644 index 5b1d2c85..00000000 --- a/sources/msbuild/MetadataTasks/MetadataTasks.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30804.86 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MetadataTasks", "MetadataTasks.csproj", "{225700CA-AB1B-4C80-8C06-9F6C86749E44}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {225700CA-AB1B-4C80-8C06-9F6C86749E44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {225700CA-AB1B-4C80-8C06-9F6C86749E44}.Debug|Any CPU.Build.0 = Debug|Any CPU - {225700CA-AB1B-4C80-8C06-9F6C86749E44}.Release|Any CPU.ActiveCfg = Release|Any CPU - {225700CA-AB1B-4C80-8C06-9F6C86749E44}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {41360FA1-98C7-4974-B24E-B62EBAA5D8E1} - EndGlobalSection -EndGlobal diff --git a/sources/msbuild/MetadataTasks/ScanLibs.cs b/sources/msbuild/MetadataTasks/ScanLibs.cs index 7fbfcfca..f9f3e06c 100644 --- a/sources/msbuild/MetadataTasks/ScanLibs.cs +++ b/sources/msbuild/MetadataTasks/ScanLibs.cs @@ -36,7 +36,10 @@ namespace MetadataTasks public override bool Execute() { #if DEBUG - System.Diagnostics.Debugger.Launch(); + if (System.Environment.GetEnvironmentVariable("DEBUG_TASKS") == "1") + { + System.Diagnostics.Debugger.Launch(); + } #endif Log.LogMessage($"Scanning libs..."); @@ -56,7 +59,7 @@ namespace MetadataTasks var functionName = match.Groups[2].Value; if (!functionNames.Contains(functionName)) - { + { if (libLines.Length == 0) { libLines.AppendLine("--with-librarypath"); @@ -85,8 +88,8 @@ namespace MetadataTasks private string[] GetLibs() { List ret = new List(); - if (this.Libs != null) - { + if (this.Libs != null) + { foreach (var libItem in this.Libs) { var libPath = libItem.ItemSpec; @@ -96,7 +99,7 @@ namespace MetadataTasks } ret.Add(libPath); - } + } } return ret.ToArray(); diff --git a/sources/msbuild/MetadataTasks/ScrapeHeaders.cs b/sources/msbuild/MetadataTasks/ScrapeHeaders.cs index c78c89cc..367138da 100644 --- a/sources/msbuild/MetadataTasks/ScrapeHeaders.cs +++ b/sources/msbuild/MetadataTasks/ScrapeHeaders.cs @@ -103,7 +103,7 @@ namespace MetadataTasks this.partitionsDir = Path.Combine(this.scraperDir, "Partitions"); this.emitterDir = Path.Combine(this.generationDir, "emitter"); - + // Output parameter for the emitter this.GeneratedSourceDir = this.emitterDir; @@ -153,25 +153,25 @@ namespace MetadataTasks } private void CopyManualItems(ITaskItem partitionItem, string partitionName) - { + { string[] manualFiles = GetManualFiles(partitionItem); - - if (manualFiles != null && manualFiles.Length > 0) - { + + if (manualFiles != null && manualFiles.Length > 0) + { Log.LogMessage($"Copying manual files for partition {partitionItem}..."); - - string manualDestDir = Path.Combine(this.generatedDir, "manual", partitionName); - if (!Directory.Exists(manualDestDir)) - { - Directory.CreateDirectory(manualDestDir); - } - - foreach (var manualFile in manualFiles) - { - string destFile = Path.Combine(manualDestDir, Path.GetFileName(manualFile)); - File.Copy(manualFile, destFile, true); - } - } + + string manualDestDir = Path.Combine(this.generatedDir, "manual", partitionName); + if (!Directory.Exists(manualDestDir)) + { + Directory.CreateDirectory(manualDestDir); + } + + foreach (var manualFile in manualFiles) + { + string destFile = Path.Combine(manualDestDir, Path.GetFileName(manualFile)); + File.Copy(manualFile, destFile, true); + } + } } private bool ProcessPartitionItem(ITaskItem partitionItem) @@ -214,21 +214,21 @@ namespace MetadataTasks HashSet includeDirHash = new HashSet(); List includeDirs = new List(); - + // For sal.h, etc. includeDirs.Add(this.Win32MetadataScraperAssetsDir); if (this.AdditionalIncludes != null) - { - string[] dirs = this.AdditionalIncludes.Split(';'); - foreach (var dir in dirs) - { - if (!includeDirHash.Contains(dir)) - { - includeDirHash.Add(dir); - includeDirs.Add(dir); + { + string[] dirs = this.AdditionalIncludes.Split(';'); + foreach (var dir in dirs) + { + if (!includeDirHash.Contains(dir)) + { + includeDirHash.Add(dir); + includeDirs.Add(dir); } - } + } } foreach (var traverseFile in traverseFiles) @@ -259,7 +259,7 @@ $@"--file --headerFile {headerTextFile} --include-directory"); - + foreach (var include in includeDirs) { rspWriter.WriteLine(include); @@ -307,17 +307,17 @@ $@"--file AddWin32GeneratedRsp(args, "autoTypes.generated.rsp"); AddWin32GeneratedRsp(args, "functionPointerFixups.generated.rsp"); - if (this.Rsps != null) - { - foreach (var rspItem in this.Rsps) - { - var rspPath = rspItem.ItemSpec; - if (!Path.IsPathRooted(rspPath)) - { - rspPath = Path.Combine(this.MSBuildProjectDirectory, rspPath); - } - - args.Append($" \"@{rspPath}\""); + if (this.Rsps != null) + { + foreach (var rspItem in this.Rsps) + { + var rspPath = rspItem.ItemSpec; + if (!Path.IsPathRooted(rspPath)) + { + rspPath = Path.Combine(this.MSBuildProjectDirectory, rspPath); + } + + args.Append($" \"@{rspPath}\""); } } @@ -353,7 +353,7 @@ $@"--file private string[] GetFilesFromMetadata(ITaskItem item, string name) { - string[] items = item.GetMetadata(name).Split(';', System.StringSplitOptions.RemoveEmptyEntries); + string[] items = item.GetMetadata(name).Split(new[] { ';' }, System.StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < items.Length; i++) { if (!Path.IsPathRooted(items[i])) diff --git a/sources/msbuild/WebView2SampleDebug/WebView2SampleDebug.proj b/sources/msbuild/WebView2SampleDebug/WebView2SampleDebug.proj index 334cbe95..c74a54c4 100644 --- a/sources/msbuild/WebView2SampleDebug/WebView2SampleDebug.proj +++ b/sources/msbuild/WebView2SampleDebug/WebView2SampleDebug.proj @@ -1,43 +1,42 @@ - + - - - $(MSBuildThisFileDirectory)..\..\..\bin\release\netcoreapp3.1 - $(MSBuildThisFileDirectory)..\..\..\bin\release\netcoreapp3.1 - $(MSBuildThisFileDirectory)..\..\..\tools - $(MSBuildThisFileDirectory)..\..\..\scripts - $(MSBuildThisFileDirectory)..\..\..\generation\scraper - $(MSBuildThisFileDirectory)..\..\..\generation\scraper\obj\x64 - $(MSBuildThisFileDirectory)..\..\..\bin - + + + $(RepoRootPath)bin\$(Configuration)\net5.0 + $(RepoRootPath)tools + $(RepoRootPath)scripts + $(RepoRootPath)generation\scraper + $(RepoRootPath)generation\scraper\obj\x64 + $(RepoRootPath)bin + - + - - bin\Microsoft.Web.WebView2.winmd - 1.0.864.35 - false - + + bin\Microsoft.Web.WebView2.winmd + 1.0.864.35 + false + - - - + + + - - WebView2Loader=WebView2LoaderStatic - + + WebView2Loader=WebView2LoaderStatic + - - @(WebView2Headers) - Microsoft.Web.WebView2.Win32 - CoreWebView2EnvironmentOptions - - + + @(WebView2Headers) + Microsoft.Web.WebView2.Win32 + CoreWebView2EnvironmentOptions + + - - - + + + - + diff --git a/sources/msbuild/WebView2SampleDebug/nuget.config b/sources/msbuild/WebView2SampleDebug/nuget.config deleted file mode 100644 index 86799ffe..00000000 --- a/sources/msbuild/WebView2SampleDebug/nuget.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/sources/msbuild/nuget/BuildSdk.nuspec b/sources/msbuild/nuget/BuildSdk.nuspec index 77653926..905bb559 100644 --- a/sources/msbuild/nuget/BuildSdk.nuspec +++ b/sources/msbuild/nuget/BuildSdk.nuspec @@ -26,9 +26,9 @@ - - - + + + diff --git a/sources/msbuild/nuget/BuildSdk.proj b/sources/msbuild/nuget/BuildSdk.proj index 10df36a9..ecee3b33 100644 --- a/sources/msbuild/nuget/BuildSdk.proj +++ b/sources/msbuild/nuget/BuildSdk.proj @@ -5,17 +5,17 @@ - - $(PowerShell) + + $(PowerShell) - $mainNugetVersion = nbgv get-version -v NuGetPackageVersion -p ..\..\.. - . ..\..\..\scripts\CommonUtils.ps1 + $mainNugetVersion = nbgv get-version -v NuGetPackageVersion -p ..\..\.. + . ..\..\..\scripts\CommonUtils.ps1 - copy ..\sdk\sdk.props ..\sdk\sdk.stamped.props + copy ..\sdk\sdk.props ..\sdk\sdk.stamped.props - [hashtable]$textToReplaceTable = @{ "10.0.19041.202-preview" = $mainNugetVersion } - Replace-Text "..\sdk\sdk.stamped.props" $textToReplaceTable - + [hashtable]$textToReplaceTable = @{ "10.0.19041.202-preview" = $mainNugetVersion } + Replace-Text "..\sdk\sdk.stamped.props" $textToReplaceTable + @@ -36,4 +36,4 @@ ..\..\.. MSBuildSdk - \ No newline at end of file + diff --git a/sources/msbuild/sdk/sdk.props b/sources/msbuild/sdk/sdk.props index 8424abc8..cdb76f3f 100644 --- a/sources/msbuild/sdk/sdk.props +++ b/sources/msbuild/sdk/sdk.props @@ -1,27 +1,27 @@ - - - net5.0 - Windows - + + + net5.0 + Windows + - - $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..')) - $(Win32MetadataSdkRoot)\tools\netcoreapp3.1 - $(Win32MetadataSdkRoot)\tools\netcoreapp3.1 - $(Win32MetadataSdkRoot)\tools - $(Win32MetadataSdkRoot)\scripts - $(MSBuildProjectDirectory)\obj - $(ObjDir)\CompiledHeaders - $(TargetPlatformSdkRootOverride)\include\$(TargetPlatformVersion) - $(Win32MetadataSdkRoot)\tools\assets - $(Win32MetadataSdkRoot)\tools\assets - $(PkgMicrosoft_Windows_SDK_Win32Metadata) - # 2>nul || type %~df0|find /v "setlocal"|find /v "errorlevel"|powershell.exe -noninteractive -& exit %errorlevel% || # - + + $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..')) + $(Win32MetadataSdkRoot)\tools\net5.0 + $(Win32MetadataSdkRoot)\tools\net5.0 + $(Win32MetadataSdkRoot)\tools + $(Win32MetadataSdkRoot)\scripts + $(MSBuildProjectDirectory)\obj + $(ObjDir)\CompiledHeaders + $(TargetPlatformSdkRootOverride)\include\$(TargetPlatformVersion) + $(Win32MetadataSdkRoot)\tools\assets + $(Win32MetadataSdkRoot)\tools\assets + $(PkgMicrosoft_Windows_SDK_Win32Metadata) + # 2>nul || type %~df0|find /v "setlocal"|find /v "errorlevel"|powershell.exe -noninteractive -& exit %errorlevel% || # + - - - - + + + + diff --git a/sources/msbuild/sdk/sdk.targets b/sources/msbuild/sdk/sdk.targets index 735519fa..9cdb31d4 100644 --- a/sources/msbuild/sdk/sdk.targets +++ b/sources/msbuild/sdk/sdk.targets @@ -1,65 +1,65 @@ - - - - + + + + - - - - $(PowerShell) + + + + $(PowerShell) - $(ScriptsDir)\InstallTools.ps1 - - + $(ScriptsDir)\InstallTools.ps1 + + - + - - - - - - - - - - + + + + + + + + + + - - - + + + diff --git a/sources/nuget/Microsoft.Windows.SDK.Win32Metadata/Win32MetadataNuget.proj b/sources/nuget/Microsoft.Windows.SDK.Win32Metadata/Win32MetadataNuget.proj index ae04e144..cf2d2c71 100644 --- a/sources/nuget/Microsoft.Windows.SDK.Win32Metadata/Win32MetadataNuget.proj +++ b/sources/nuget/Microsoft.Windows.SDK.Win32Metadata/Win32MetadataNuget.proj @@ -12,5 +12,6 @@ Microsoft.Windows.SDK.Win32Metadata.nuspec ..\..\.. + $(NoWarn);NU5100;NU5127 - \ No newline at end of file +