diff --git a/.gitattributes b/.gitattributes index 1ff0c42304..e53d317832 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,63 +1,49 @@ ############################################################################### -# Set default behavior to automatically normalize line endings. +# Set default behavior to: +# automatically normalize line endings on check-in, and +# convert to Windows-style line endings on check-out ############################################################################### -* text=auto +* text=auto encoding=UTF-8 +*.sh text eol=lf ############################################################################### -# Set default behavior for command prompt diff. -# -# This is need for earlier builds of msysgit that does not have it on by -# default for csharp files. -# Note: This is only used by command line +# Set file behavior to: +# treat as text, and +# diff as C# source code ############################################################################### -#*.cs diff=csharp +*.cs text diff=csharp ############################################################################### -# Set the merge driver for project and solution files -# -# Merging from the command prompt will add diff markers to the files if there -# are conflicts (Merging from VS is not affected by the settings below, in VS -# the diff markers are never inserted). Diff markers may cause the following -# file extensions to fail to load in VS. An alternative would be to treat -# these files as binary and thus will always conflict and require user -# intervention with every merge. To do so, just uncomment the entries below -############################################################################### -#*.sln merge=binary -#*.csproj merge=binary -#*.vbproj merge=binary -#*.vcxproj merge=binary -#*.vcproj merge=binary -#*.dbproj merge=binary -#*.fsproj merge=binary -#*.lsproj merge=binary -#*.wixproj merge=binary -#*.modelproj merge=binary -#*.sqlproj merge=binary -#*.wwaproj merge=binary +# Set file behavior to: +# treat as text +############################################################################### +*.cmd text +*.config text +*.csproj text +*.groovy text +*.json text +*.md text +*.nuspec text +*.pkgdef text +*.proj text +*.projitems text +*.props text +*.ps1 text +*.resx text +*.ruleset text +*.shproj text +*.sln text +*.targets text +*.vb text +*.vbproj text +*.vcxproj text +*.vcxproj.filters text +*.vsct text +*.vsixmanifest text ############################################################################### -# behavior for image files -# -# image files are treated as binary by default. +# Set file behavior to: +# treat as binary ############################################################################### -#*.jpg binary -#*.png binary -#*.gif binary - -############################################################################### -# diff behavior for common document formats -# -# Convert binary document formats to text before diffing them. This feature -# is only available from the command line. Turn it on by uncommenting the -# entries below. -############################################################################### -#*.doc diff=astextplain -#*.DOC diff=astextplain -#*.docx diff=astextplain -#*.DOCX diff=astextplain -#*.dot diff=astextplain -#*.DOT diff=astextplain -#*.pdf diff=astextplain -#*.PDF diff=astextplain -#*.rtf diff=astextplain -#*.RTF diff=astextplain +*.png binary +*.snk binary diff --git a/.gitignore b/.gitignore index 366c625e1e..2a0a37eae9 100644 --- a/.gitignore +++ b/.gitignore @@ -4,105 +4,34 @@ # User-specific files *.suo *.user -*.sln.docstates .vs/ -*.VC.db +.vscode/ # Build results -[Aa]rtifacts/ -[Dd]ebug/ -[Rr]elease/ -x64/ -[Bb]in/ -[Oo]bj/ +artifacts/ +Debug/ +Release/ +bin/ +obj/ .dotnet/ .tools/ +.packages/ # Per-user project properties -*_i.c -*_p.c -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.wrn -*.vspscc -*.vssscc -.builds -*.pidb -*.log -*.scc - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opensdf -*.sdf -*.cachefile -*.VC.opendb +launchSettings.json # Visual Studio profiler *.psess *.vsp *.vspx -# Guidance Automation Toolkit -*.gpState - # ReSharper is a .NET coding add-in _ReSharper*/ *.[Rr]e[Ss]harper -# TeamCity is a build add-in -_TeamCity* - # DotCover is a Code Coverage Tool *.dotCover # NCrunch *.ncrunch* .*crunch*.local.xml - -# Others -sql/ -*.Cache -ClientBin/ -[Ss]tyle[Cc]op.* -~$* -*~ -*.dbmdl -*.[Pp]ublish.xml -*.pfx -*.publishsettings - -# SQL Server files -App_Data/*.mdf -App_Data/*.ldf - -# ========================= -# Windows detritus -# ========================= - -# Windows image file caches -Thumbs.db -ehthumbs.db - -# Folder config file -Desktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Mac desktop service store files -.DS_Store diff --git a/.vsts-ci.yml b/.vsts-ci.yml index c839eb31dd..c2be89097a 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -15,7 +15,7 @@ steps: signType: real esrpSigning: true -- script: build\CIBuild.cmd -configuration $(BuildConfiguration) +- script: eng\common\CIBuild.cmd -configuration $(BuildConfiguration) displayName: Build - task: PublishTestResults@1 diff --git a/Build.cmd b/Build.cmd index acaa29c3d5..7e77544624 100644 --- a/Build.cmd +++ b/Build.cmd @@ -1,3 +1,3 @@ @echo off -powershell -ExecutionPolicy ByPass -NoProfile %~dp0build\Build.ps1 -restore -build -deploy %* +powershell -ExecutionPolicy ByPass -command "& """%~dp0eng\common\Build.ps1""" -restore -build %*" exit /b %ErrorLevel% diff --git a/Directory.Build.props b/Directory.Build.props index a6980945d7..ca6653686f 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,43 +1,7 @@ - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - - - - - - - - - - - Debug - - $(RestoreSources);https://dotnet.myget.org/F/roslyn-tools/api/v3/index.json - - $(MSBuildThisFileDirectory) - - - <_RepoToolsetDir>$(NuGetPackageRoot)roslyntools.repotoolset\$(RoslynToolsRepoToolsetVersion)\tools\ - $(_RepoToolsetDir) - - $(RepoRoot)assets\ - - https://github.com/dotnet/roslyn-analyzers - $(RepositoryUrl) - + $(MSBuildThisFileDirectory)assets\ RoslynDev - - - \ No newline at end of file diff --git a/Restore.cmd b/Restore.cmd index 0d9cf6a0fd..3fc17e8f75 100644 --- a/Restore.cmd +++ b/Restore.cmd @@ -1,3 +1,3 @@ @echo off -powershell -ExecutionPolicy ByPass -NoProfile %~dp0build\Build.ps1 -restore %* +powershell -ExecutionPolicy ByPass -command "& """%~dp0eng\common\Build.ps1""" -restore %*" exit /b %ErrorLevel% diff --git a/Test.cmd b/Test.cmd index 0947a8db91..8a841f6818 100644 --- a/Test.cmd +++ b/Test.cmd @@ -1,3 +1,3 @@ @echo off -powershell -ExecutionPolicy ByPass -NoProfile %~dp0build\Build.ps1 -test %* +powershell -ExecutionPolicy ByPass -command "& """%~dp0eng\common\Build.ps1""" -test %*" exit /b %ErrorLevel% \ No newline at end of file diff --git a/build/CIBuild.cmd b/build/CIBuild.cmd deleted file mode 100644 index cf7c6a646f..0000000000 --- a/build/CIBuild.cmd +++ /dev/null @@ -1,3 +0,0 @@ -@echo off -powershell -ExecutionPolicy ByPass %~dp0Build.ps1 -restore -build -test -sign -pack -ci %* -exit /b %ErrorLevel% diff --git a/build/NuGet.props b/build/NuGet.props deleted file mode 100644 index 2826edf5e3..0000000000 --- a/build/NuGet.props +++ /dev/null @@ -1,14 +0,0 @@ - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - - - - $(NUGET_PACKAGES) - $(UserProfile)\.nuget\packages\ - $([System.Environment]::GetFolderPath(SpecialFolder.Personal))\.nuget\packages\ - $(NuGetPackageRoot)\ - - \ No newline at end of file diff --git a/build/RepoToolset/ProjectLayout.props b/build/RepoToolset/ProjectLayout.props deleted file mode 100644 index 781a60c558..0000000000 --- a/build/RepoToolset/ProjectLayout.props +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - - - - - $(MSBuildProjectName) - $([System.IO.Path]::GetFullPath('$(ArtifactsBinDir)$(OutDirName)\')) - $(BaseOutputPath) - $([System.IO.Path]::GetFullPath('$(ArtifactsObjDir)$(MSBuildProjectName)\')) - $(BaseIntermediateOutputPath) - - - \ No newline at end of file diff --git a/build/RepoToolset/RepoLayout.props b/build/RepoToolset/RepoLayout.props deleted file mode 100644 index 5aa2508fa3..0000000000 --- a/build/RepoToolset/RepoLayout.props +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - - - - $(DOTNET_INSTALL_DIR) - $(RepoRoot).dotnet\ - $(DotNetRoot)\ - - - - $(DotNetRoot)dotnet - $(DotNetTool).exe - $(RepoRoot)artifacts\ - $(ArtifactsDir)toolset\ - $(ArtifactsDir)$(Configuration)\ - $(ArtifactsConfigurationDir)bin\ - $(ArtifactsConfigurationDir)obj\ - $(ArtifactsConfigurationDir)log\ - $(ArtifactsConfigurationDir)tmp\ - $(ArtifactsConfigurationDir)TestResults\ - $(ArtifactsConfigurationDir)SymStore\ - $(ArtifactsConfigurationDir)packages\ - $(ArtifactsConfigurationDir)VSSetup\ - $(VisualStudioSetupOutputPath)Insertion\ - $(ArtifactsConfigurationDir)VSSetup.obj\ - - - \ No newline at end of file diff --git a/build/RepoToolset/RestoreSources.props b/build/RepoToolset/RestoreSources.props deleted file mode 100644 index 71a67a19cc..0000000000 --- a/build/RepoToolset/RestoreSources.props +++ /dev/null @@ -1,16 +0,0 @@ - - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - - - $(RestoreSources);https://api.nuget.org/v3/index.json - $(RestoreSources);https://dotnet.myget.org/F/dotnet-core/api/v3/index.json - $(RestoreSources);https://dotnet.myget.org/F/roslyn/api/v3/index.json - - - $(__ExternalRestoreSources);$(RestoreSources) - - \ No newline at end of file diff --git a/build/Toolset.proj b/build/Toolset.proj deleted file mode 100644 index 82848381a6..0000000000 --- a/build/Toolset.proj +++ /dev/null @@ -1,13 +0,0 @@ - - - - net462 - https://api.nuget.org/v3/index.json;https://dotnet.myget.org/F/roslyn-tools/api/v3/index.json;https://dotnet.myget.org/F/symreader-converter/api/v3/index.json - - - - - - - - \ No newline at end of file diff --git a/build/build.ps1 b/build/build.ps1 deleted file mode 100644 index 6037385eff..0000000000 --- a/build/build.ps1 +++ /dev/null @@ -1,205 +0,0 @@ -[CmdletBinding(PositionalBinding=$false)] -Param( - [string] $configuration = "Debug", - [string] $solution = "", - [string] $verbosity = "minimal", - [switch] $restore, - [switch] $deployDeps, - [switch] $build, - [switch] $rebuild, - [switch] $deploy, - [switch] $test, - [switch] $integrationTest, - [switch] $sign, - [switch] $pack, - [switch] $ci, - [switch] $prepareMachine, - [switch] $log, - [switch] $help, - [Parameter(ValueFromRemainingArguments=$true)][String[]]$properties -) - -set-strictmode -version 2.0 -$ErrorActionPreference = "Stop" -[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 - -function Print-Usage() { - Write-Host "Common settings:" - Write-Host " -configuration Build configuration Debug, Release" - Write-Host " -verbosity Msbuild verbosity (q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic])" - Write-Host " -help Print help and exit" - Write-Host "" - - Write-Host "Actions:" - Write-Host " -restore Restore dependencies" - Write-Host " -build Build solution" - Write-Host " -rebuild Rebuild solution" - Write-Host " -deploy Deploy built VSIXes" - Write-Host " -deployDeps Deploy dependencies (Roslyn VSIXes for integration tests)" - Write-Host " -test Run all unit tests in the solution" - Write-Host " -integrationTest Run all integration tests in the solution" - Write-Host " -sign Sign build outputs" - Write-Host " -pack Package build outputs into NuGet packages and Willow components" - Write-Host "" - - Write-Host "Advanced settings:" - Write-Host " -solution Path to solution to build" - Write-Host " -ci Set when running on CI server" - Write-Host " -log Enable logging (by default on CI)" - Write-Host " -prepareMachine Prepare machine for CI run" - Write-Host "" - Write-Host "Command line arguments not listed above are passed thru to msbuild." - Write-Host "The above arguments can be shortened as much as to be unambiguous (e.g. -co for configuration, -t for test, etc.)." -} - -if ($help -or (($properties -ne $null) -and ($properties.Contains("/help") -or $properties.Contains("/?")))) { - Print-Usage - exit 0 -} - -function Create-Directory([string[]] $path) { - if (!(Test-Path $path)) { - New-Item -path $path -force -itemType "Directory" | Out-Null - } -} - -function GetVersion([string] $name) { - foreach ($propertyGroup in $VersionsXml.Project.PropertyGroup) { - if (Get-Member -inputObject $propertyGroup -name $name) { - return $propertyGroup.$name - } - } - - throw "Failed to find $name in Versions.props" -} - -function LocateVisualStudio { - if ($InVSEnvironment) { - return Join-Path $env:VS150COMNTOOLS "..\.." - } - - $vswhereVersion = GetVersion("VSWhereVersion") - $vsWhereDir = Join-Path $ToolsRoot "vswhere\$vswhereVersion" - $vsWhereExe = Join-Path $vsWhereDir "vswhere.exe" - - if (!(Test-Path $vsWhereExe)) { - Create-Directory $vsWhereDir - Write-Host "Downloading vswhere" - Invoke-WebRequest "https://github.com/Microsoft/vswhere/releases/download/$vswhereVersion/vswhere.exe" -OutFile $vswhereExe - } - - $vsInstallDir = & $vsWhereExe -latest -prerelease -property installationPath -requires Microsoft.Component.MSBuild -requires Microsoft.VisualStudio.Component.VSSDK -requires Microsoft.Net.Component.4.6.TargetingPack -requires Microsoft.VisualStudio.Component.Roslyn.Compiler -requires Microsoft.VisualStudio.Component.VSSDK - - if (!(Test-Path $vsInstallDir)) { - throw "Failed to locate Visual Studio (exit code '$lastExitCode')." - } - - return $vsInstallDir -} - -function InstallToolset { - if (!(Test-Path $ToolsetBuildProj)) { - & $MsbuildExe $ToolsetRestoreProj /t:restore /m /nologo /clp:None /warnaserror /v:quiet /p:DeployDeps=$deployDeps /p:NuGetPackageRoot=$NuGetPackageRoot /p:BaseIntermediateOutputPath=$ToolsetDir /p:ExcludeRestorePackageImports=true - } -} - -function Build { - if ($ci -or $log) { - Create-Directory($logDir) - $logCmd = "/bl:" + (Join-Path $LogDir "Build.binlog") - } else { - $logCmd = "" - } - - $nodeReuse = !$ci - $useCodecov = $ci -and $env:CODECOV_TOKEN -and ($configuration -eq 'Debug') - $useOpenCover = $useCodecov - - & $MsbuildExe $ToolsetBuildProj /m /nologo /clp:Summary /nodeReuse:$nodeReuse /warnaserror /v:$verbosity $logCmd /p:Configuration=$configuration /p:SolutionPath=$solution /p:Restore=$restore /p:DeployDeps=$deployDeps /p:Build=$build /p:Rebuild=$rebuild /p:Deploy=$deploy /p:Test=$test /p:IntegrationTest=$integrationTest /p:Sign=$sign /p:Pack=$pack /p:UseCodecov=$useCodecov /p:UseOpenCover=$useOpenCover /p:CIBuild=$ci /p:NuGetPackageRoot=$NuGetPackageRoot $properties - - if ($useCodecov) { - $CodecovProj = Join-Path $PSScriptRoot 'Codecov.proj' - & $MsbuildExe $CodecovProj /m /nologo /clp:Summary /nodeReuse:$nodeReuse /warnaserror /v:diag /t:Codecov /p:Configuration=$configuration /p:UseCodecov=$useCodecov /p:NuGetPackageRoot=$NuGetPackageRoot $properties - } -} - -function Stop-Processes() { - Write-Host "Killing running build processes..." - Get-Process -Name "msbuild" -ErrorAction SilentlyContinue | Stop-Process - Get-Process -Name "vbcscompiler" -ErrorAction SilentlyContinue | Stop-Process -} - -function Clear-NuGetCache() { - # clean nuget packages -- necessary to avoid mismatching versions of swix microbuild build plugin and VSSDK on Jenkins - $nugetRoot = (Join-Path $env:USERPROFILE ".nuget\packages") - if (Test-Path $nugetRoot) { - Remove-Item $nugetRoot -Recurse -Force - } -} - -try { - $InVSEnvironment = !($env:VS150COMNTOOLS -eq $null) -and (Test-Path $env:VS150COMNTOOLS) - $RepoRoot = Join-Path $PSScriptRoot "..\" - $ToolsRoot = Join-Path $RepoRoot ".tools" - $ToolsetRestoreProj = Join-Path $PSScriptRoot "Toolset.proj" - $ArtifactsDir = Join-Path $RepoRoot "artifacts" - $ToolsetDir = Join-Path $ArtifactsDir "toolset" - $LogDir = Join-Path (Join-Path $ArtifactsDir $configuration) "log" - $TempDir = Join-Path (Join-Path $ArtifactsDir $configuration) "tmp" - [xml]$VersionsXml = Get-Content(Join-Path $PSScriptRoot "Versions.props") - - if ($solution -eq "") { - $solution = @(gci(Join-Path $RepoRoot "*.sln"))[0] - } - - if ($env:NUGET_PACKAGES -ne $null) { - $NuGetPackageRoot = $env:NUGET_PACKAGES.TrimEnd("\") + "\" - } else { - $NuGetPackageRoot = Join-Path $env:UserProfile ".nuget\packages\" - } - - $ToolsetVersion = GetVersion("RoslynToolsRepoToolsetVersion") - $ToolsetBuildProj = Join-Path $NuGetPackageRoot "RoslynTools.RepoToolset\$ToolsetVersion\tools\Build.proj" - - $vsInstallDir = LocateVisualStudio - $MsbuildExe = Join-Path $vsInstallDir "MSBuild\15.0\Bin\msbuild.exe" - - if ($ci) { - Create-Directory $TempDir - $env:TEMP = $TempDir - $env:TMP = $TempDir - - Write-Host "Using $MsbuildExe" - } - - if (!$InVSEnvironment) { - $env:VS150COMNTOOLS = Join-Path $vsInstallDir "Common7\Tools\" - $env:VSSDK150Install = Join-Path $vsInstallDir "VSSDK\" - $env:VSSDKInstall = Join-Path $vsInstallDir "VSSDK\" - } - - # Preparation of a CI machine - if ($prepareMachine) { - Clear-NuGetCache - } - - if ($restore) { - InstallToolset - } - - Build - exit $lastExitCode -} -catch { - Write-Host $_ - Write-Host $_.Exception - Write-Host $_.ScriptStackTrace - exit 1 -} -finally { - Pop-Location - if ($ci -and $prepareMachine) { - Stop-Processes - } -} - diff --git a/build/Codecov.proj b/eng/AfterSolutionBuild.targets similarity index 66% rename from build/Codecov.proj rename to eng/AfterSolutionBuild.targets index c9d04e6e4a..a1ef481722 100644 --- a/build/Codecov.proj +++ b/eng/AfterSolutionBuild.targets @@ -1,18 +1,12 @@ - + - - $(MSBuildThisFileDirectory)..\ - - - - - - + + <_CodecovPath>$(NuGetPackageRoot)codecov\$(CodecovVersion)\tools\Codecov.exe - + <_CoverageReports Include="$(ArtifactsTestResultsDir)*.coverage" /> <_CodecovArgs Include="-f;@(_CoverageReports)" /> @@ -25,7 +19,7 @@ <_CodecovArgs Include="--flag;$(Configuration)" Condition="'$(Configuration)' != ''" /> - + + diff --git a/build/Analyzers_NonShippingRules.ruleset b/eng/Analyzers_NonShippingRules.ruleset similarity index 100% rename from build/Analyzers_NonShippingRules.ruleset rename to eng/Analyzers_NonShippingRules.ruleset diff --git a/build/Analyzers_ShippingRules.ruleset b/eng/Analyzers_ShippingRules.ruleset similarity index 100% rename from build/Analyzers_ShippingRules.ruleset rename to eng/Analyzers_ShippingRules.ruleset diff --git a/build/GenerateAnalyzerNuspec.csx b/eng/GenerateAnalyzerNuspec.csx similarity index 86% rename from build/GenerateAnalyzerNuspec.csx rename to eng/GenerateAnalyzerNuspec.csx index d8a447998c..42b45e612d 100644 --- a/build/GenerateAnalyzerNuspec.csx +++ b/eng/GenerateAnalyzerNuspec.csx @@ -14,12 +14,22 @@ result.AppendLine(@""); string version = null; +string repositoryType = null; +string repositoryUrl = null; +string repositoryCommit = null; foreach (string entry in metadataList) { int equals = entry.IndexOf('='); string name = entry.Substring(0, equals); string value = entry.Substring(equals + 1); + switch (name) + { + case "repositoryType": repositoryType = value; continue; + case "repositoryUrl": repositoryUrl = value; continue; + case "repositoryCommit": repositoryCommit = value; continue; + } + if (value != "") { result.AppendLine($" <{name}>{value}"); @@ -31,6 +41,11 @@ foreach (string entry in metadataList) } } +if (!string.IsNullOrEmpty(repositoryType)) +{ + result.AppendLine($@" "); +} + if (dependencyList.Length > 0) { result.AppendLine(@" "); diff --git a/build/GenerateAnalyzerNuspec.targets b/eng/GenerateAnalyzerNuspec.targets similarity index 73% rename from build/GenerateAnalyzerNuspec.targets rename to eng/GenerateAnalyzerNuspec.targets index e29701fca2..53b6787ece 100644 --- a/build/GenerateAnalyzerNuspec.targets +++ b/eng/GenerateAnalyzerNuspec.targets @@ -10,7 +10,8 @@ $(NuspecPackageId) @@ -30,7 +31,10 @@ <_NuspecMetadata Include="tags=$(PackageTags)" /> <_NuspecMetadata Include="serviceable=$(Serviceable)" /> <_NuspecMetadata Include="developmentDependency=true" /> + <_NuspecMetadata Include="repositoryType=$(RepositoryType)" /> + <_NuspecMetadata Include="repositoryCommit=$(SourceRevisionId)" /> + <_NuspecMetadata Include="repositoryUrl=$(PrivateRepositoryUrl)" /> - + \ No newline at end of file diff --git a/build/RoslynInternalKey.Private.snk b/eng/RoslynInternalKey.Private.snk similarity index 100% rename from build/RoslynInternalKey.Private.snk rename to eng/RoslynInternalKey.Private.snk diff --git a/build/SignToolData.json b/eng/SignToolData.json similarity index 99% rename from build/SignToolData.json rename to eng/SignToolData.json index 055e7208e4..147c798f9c 100644 --- a/build/SignToolData.json +++ b/eng/SignToolData.json @@ -69,7 +69,8 @@ "certificate": "NuGet", "strongName": null, "values": [ - "packages/*.nupkg" + "packages/*.nupkg", + "packages/*/*.nupkg" ] } ] diff --git a/eng/Tools.props b/eng/Tools.props new file mode 100644 index 0000000000..e8fd9e8544 --- /dev/null +++ b/eng/Tools.props @@ -0,0 +1,10 @@ + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + + + + + + \ No newline at end of file diff --git a/build/Versions.props b/eng/Versions.props similarity index 90% rename from build/Versions.props rename to eng/Versions.props index 861d95ead8..de3e272d92 100644 --- a/build/Versions.props +++ b/eng/Versions.props @@ -4,15 +4,14 @@ - 2.6.1 + 2.6.1 beta1 true + true - 1.0.0-beta-62705-01 - 2.3.2 15.0.26201-alpha 1.1.0-beta1-62624-01 4.6.519 diff --git a/eng/common/CIBuild.cmd b/eng/common/CIBuild.cmd new file mode 100644 index 0000000000..42bb58ba2d --- /dev/null +++ b/eng/common/CIBuild.cmd @@ -0,0 +1,3 @@ +@echo off +powershell -ExecutionPolicy ByPass -command "& """%~dp0Build.ps1""" -restore -build -test -sign -pack -ci %*" +exit /b %ErrorLevel% diff --git a/eng/common/build.ps1 b/eng/common/build.ps1 new file mode 100644 index 0000000000..ecddd356fd --- /dev/null +++ b/eng/common/build.ps1 @@ -0,0 +1,286 @@ +[CmdletBinding(PositionalBinding=$false)] +Param( + [string] $configuration = "Debug", + [string] $projects = "", + [string] $verbosity = "minimal", + [switch] $restore, + [switch] $deployDeps, + [switch] $build, + [switch] $rebuild, + [switch] $deploy, + [switch] $test, + [switch] $integrationTest, + [switch] $sign, + [switch] $pack, + [switch] $ci, + [switch] $prepareMachine, + [switch] $help, + [Parameter(ValueFromRemainingArguments=$true)][String[]]$properties +) + +set-strictmode -version 2.0 +$ErrorActionPreference = "Stop" +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + +function Print-Usage() { + Write-Host "Common settings:" + Write-Host " -configuration Build configuration Debug, Release" + Write-Host " -verbosity Msbuild verbosity (q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic])" + Write-Host " -help Print help and exit" + Write-Host "" + + Write-Host "Actions:" + Write-Host " -restore Restore dependencies" + Write-Host " -build Build solution" + Write-Host " -rebuild Rebuild solution" + Write-Host " -deploy Deploy built VSIXes" + Write-Host " -deployDeps Deploy dependencies (e.g. VSIXes for integration tests)" + Write-Host " -test Run all unit tests in the solution" + Write-Host " -integrationTest Run all integration tests in the solution" + Write-Host " -sign Sign build outputs" + Write-Host " -pack Package build outputs into NuGet packages and Willow components" + Write-Host "" + + Write-Host "Advanced settings:" + Write-Host " -projects Semi-colon delimited list of sln/proj's to build. Globbing is supported (*.sln)" + Write-Host " -ci Set when running on CI server" + Write-Host " -prepareMachine Prepare machine for CI run" + Write-Host "" + Write-Host "Command line arguments not listed above are passed thru to msbuild." + Write-Host "The above arguments can be shortened as much as to be unambiguous (e.g. -co for configuration, -t for test, etc.)." +} + +if ($help -or (($properties -ne $null) -and ($properties.Contains("/help") -or $properties.Contains("/?")))) { + Print-Usage + exit 0 +} + +function Create-Directory([string[]] $path) { + if (!(Test-Path $path)) { + New-Item -path $path -force -itemType "Directory" | Out-Null + } +} + +function InitializeDotNetCli { + # Don't resolve runtime, shared framework, or SDK from other locations to ensure build determinism + $env:DOTNET_MULTILEVEL_LOOKUP=0 + + # Disable first run since we do not need all ASP.NET packages restored. + $env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 + + # Source Build uses DotNetCoreSdkDir variable + if ($env:DotNetCoreSdkDir -ne $null) { + $env:DOTNET_INSTALL_DIR = $env:DotNetCoreSdkDir + } + + # Use dotnet installation specified in DOTNET_INSTALL_DIR if it contains the required SDK version, + # otherwise install the dotnet CLI and SDK to repo local .dotnet directory to avoid potential permission issues. + if (($env:DOTNET_INSTALL_DIR -ne $null) -and (Test-Path(Join-Path $env:DOTNET_INSTALL_DIR "sdk\$($GlobalJson.sdk.version)"))) { + $dotnetRoot = $env:DOTNET_INSTALL_DIR + } else { + $dotnetRoot = Join-Path $RepoRoot ".dotnet" + $env:DOTNET_INSTALL_DIR = $dotnetRoot + + if ($restore) { + InstallDotNetSdk $dotnetRoot $GlobalJson.sdk.version + } + } + + return $dotnetRoot +} + +function GetDotNetInstallScript([string] $dotnetRoot) { + $installScript = "$dotnetRoot\dotnet-install.ps1" + if (!(Test-Path $installScript)) { + Create-Directory $dotnetRoot + Invoke-WebRequest "https://dot.net/v1/dotnet-install.ps1" -OutFile $installScript + } + + return $installScript +} + +function InstallDotNetSdk([string] $dotnetRoot, [string] $version) { + $installScript = GetDotNetInstallScript $dotnetRoot + + & $installScript -Version $version -InstallDir $dotnetRoot + if ($lastExitCode -ne 0) { + Write-Host "Failed to install dotnet cli (exit code '$lastExitCode')." -ForegroundColor Red + exit $lastExitCode + } +} + +function InitializeVisualStudioBuild { + $inVSEnvironment = !($env:VS150COMNTOOLS -eq $null) -and (Test-Path $env:VS150COMNTOOLS) + + if ($inVSEnvironment) { + $vsInstallDir = Join-Path $env:VS150COMNTOOLS "..\.." + } else { + $vsInstallDir = LocateVisualStudio + + $env:VS150COMNTOOLS = Join-Path $vsInstallDir "Common7\Tools\" + $env:VSSDK150Install = Join-Path $vsInstallDir "VSSDK\" + $env:VSSDKInstall = Join-Path $vsInstallDir "VSSDK\" + } + + return $vsInstallDir; +} + +function LocateVisualStudio { + $vswhereVersion = $GlobalJson.vswhere.version + $toolsRoot = Join-Path $RepoRoot ".tools" + $vsWhereDir = Join-Path $toolsRoot "vswhere\$vswhereVersion" + $vsWhereExe = Join-Path $vsWhereDir "vswhere.exe" + + if (!(Test-Path $vsWhereExe)) { + Create-Directory $vsWhereDir + Write-Host "Downloading vswhere" + Invoke-WebRequest "https://github.com/Microsoft/vswhere/releases/download/$vswhereVersion/vswhere.exe" -OutFile $vswhereExe + } + + $vsInstallDir = & $vsWhereExe -latest -prerelease -property installationPath -requires Microsoft.Component.MSBuild -requires Microsoft.VisualStudio.Component.VSSDK -requires Microsoft.Net.Component.4.6.TargetingPack -requires Microsoft.VisualStudio.Component.Roslyn.Compiler -requires Microsoft.VisualStudio.Component.VSSDK + + if ($lastExitCode -ne 0) { + Write-Host "Failed to locate Visual Studio (exit code '$lastExitCode')." -ForegroundColor Red + exit $lastExitCode + } + + return $vsInstallDir +} + +function InitializeToolset { + $toolsetVersion = $GlobalJson.'msbuild-sdks'.'RoslynTools.RepoToolset' + $toolsetLocationFile = Join-Path $ToolsetDir "$toolsetVersion.txt" + + if (Test-Path $toolsetLocationFile) { + $path = Get-Content $toolsetLocationFile -TotalCount 1 + if (Test-Path $path) { + $global:ToolsetBuildProj = $path + return + } + } + + if (-not $restore) { + Write-Host "Toolset version $toolsetVersion has not been restored." + exit 1 + } + + $proj = Join-Path $ToolsetDir "restore.proj" + + '' | Set-Content $proj + & $BuildDriver $BuildArgs $proj /t:__WriteToolsetLocation /m /nologo /clp:None /warnaserror /bl:$ToolsetRestoreLog /v:$verbosity /p:__ToolsetLocationOutputFile=$toolsetLocationFile + + if ($lastExitCode -ne 0) { + Write-Host "Failed to restore toolset (exit code '$lastExitCode')." -Color Red + Write-Host "Build log: $ToolsetRestoreLog" -ForegroundColor DarkGray + exit $lastExitCode + } + + $path = Get-Content $toolsetLocationFile -TotalCount 1 + if (!(Test-Path $path)) { + throw "Invalid toolset path: $path" + } + + $global:ToolsetBuildProj = $path +} + +function InitializeCustomToolset { + if (-not $restore) { + return + } + + $script = Join-Path $EngRoot "RestoreToolset.ps1" + + if (Test-Path $script) { + . $script + } +} + +function Build { + & $BuildDriver $BuildArgs $ToolsetBuildProj /m /nologo /clp:Summary /warnaserror /v:$verbosity /bl:$BuildLog /p:Configuration=$configuration /p:Projects=$projects /p:RepoRoot=$RepoRoot /p:Restore=$restore /p:DeployDeps=$deployDeps /p:Build=$build /p:Rebuild=$rebuild /p:Deploy=$deploy /p:Test=$test /p:IntegrationTest=$integrationTest /p:Sign=$sign /p:Pack=$pack /p:CIBuild=$ci $properties + if ($lastExitCode -ne 0) { + Write-Host "Build log: $BuildLog" -ForegroundColor DarkGray + exit $lastExitCode + } +} + +function Stop-Processes() { + Write-Host "Killing running build processes..." + Get-Process -Name "msbuild" -ErrorAction SilentlyContinue | Stop-Process + Get-Process -Name "dotnet" -ErrorAction SilentlyContinue | Stop-Process + Get-Process -Name "vbcscompiler" -ErrorAction SilentlyContinue | Stop-Process +} + +try { + $RepoRoot = Join-Path $PSScriptRoot "..\.." + $EngRoot = Join-Path $PSScriptRoot ".." + $ArtifactsDir = Join-Path $RepoRoot "artifacts" + $ToolsetDir = Join-Path $ArtifactsDir "toolset" + $LogDir = Join-Path (Join-Path $ArtifactsDir $configuration) "log" + $BuildLog = Join-Path $LogDir "Build.binlog" + $ToolsetRestoreLog = Join-Path $LogDir "ToolsetRestore.binlog" + $TempDir = Join-Path (Join-Path $ArtifactsDir $configuration) "tmp" + $GlobalJson = Get-Content -Raw -Path (Join-Path $RepoRoot "global.json") | ConvertFrom-Json + + if ($projects -eq "") { + $projects = Join-Path $RepoRoot "*.sln" + } + + if ($env:NUGET_PACKAGES -eq $null) { + # Use local cache on CI to ensure deterministic build, + # use global cache in dev builds to avoid cost of downloading packages. + $env:NUGET_PACKAGES = if ($ci) { Join-Path $RepoRoot ".packages" } + else { Join-Path $env:UserProfile ".nuget\packages" } + } + + Create-Directory $ToolsetDir + Create-Directory $LogDir + + if ($ci) { + Create-Directory $TempDir + $env:TEMP = $TempDir + $env:TMP = $TempDir + } + + if ((Get-Member -InputObject $GlobalJson -Name "sdk") -ne $null) { + $dotnetRoot = InitializeDotNetCli + + # by default build with dotnet cli: + $BuildDriver = Join-Path $dotnetRoot "dotnet.exe" + $BuildArgs = "msbuild" + } + + if ((Get-Member -InputObject $GlobalJson -Name "vswhere") -ne $null) { + $vsInstallDir = InitializeVisualStudioBuild + + # Presence of vswhere.version indicates the repo needs to build using VS msbuild: + $BuildDriver = Join-Path $vsInstallDir "MSBuild\15.0\Bin\msbuild.exe" + $BuildArgs = "/nodeReuse:$(!$ci)" + } + + if ($BuildDriver -eq $null) { + Write-Host "/global.json must either specify 'sdk.version' or 'vswhere.version'." -ForegroundColor Red + exit 1 + } + + if ($ci) { + Write-Host "Using $BuildDriver" + } + + InitializeToolset + InitializeCustomToolset + + Build +} +catch { + Write-Host $_ + Write-Host $_.Exception + Write-Host $_.ScriptStackTrace + exit 1 +} +finally { + Pop-Location + if ($ci -and $prepareMachine) { + Stop-Processes + } +} + diff --git a/eng/common/build.sh b/eng/common/build.sh new file mode 100644 index 0000000000..fd0418d8ce --- /dev/null +++ b/eng/common/build.sh @@ -0,0 +1,313 @@ +#!/usr/bin/env bash + +source="${BASH_SOURCE[0]}" + +# resolve $source until the file is no longer a symlink +while [[ -h "$source" ]]; do + scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + source="$(readlink "$source")" + # if $source was a relative symlink, we need to resolve it relative to the path where the + # symlink file was located + [[ $source != /* ]] && source="$scriptroot/$source" +done +scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + +build=false +ci=false +configuration='Debug' +help=false +pack=false +prepare_machine=false +rebuild=false +restore=false +sign=false +projects='' +test=false +verbosity='minimal' +properties='' + +repo_root="$scriptroot/../.." +eng_root="$scriptroot/.." +artifacts_dir="$repo_root/artifacts" +artifacts_configuration_dir="$artifacts_dir/$configuration" +toolset_dir="$artifacts_dir/toolset" +log_dir="$artifacts_configuration_dir/log" +build_log="$log_dir/Build.binlog" +toolset_restore_log="$log_dir/ToolsetRestore.binlog" +temp_dir="$artifacts_configuration_dir/tmp" + +global_json_file="$repo_root/global.json" +build_driver="" +toolset_build_proj="" + +while (($# > 0)); do + lowerI="$(echo $1 | awk '{print tolower($0)}')" + case $lowerI in + --build) + build=true + shift 1 + ;; + --ci) + ci=true + shift 1 + ;; + --configuration) + configuration=$2 + shift 2 + ;; + --help) + echo "Common settings:" + echo " --configuration Build configuration Debug, Release" + echo " --verbosity Msbuild verbosity (q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic])" + echo " --help Print help and exit" + echo "" + echo "Actions:" + echo " --restore Restore dependencies" + echo " --build Build solution" + echo " --rebuild Rebuild solution" + echo " --test Run all unit tests in the solution" + echo " --sign Sign build outputs" + echo " --pack Package build outputs into NuGet packages and Willow components" + echo "" + echo "Advanced settings:" + echo " --solution Path to solution to build" + echo " --ci Set when running on CI server" + echo " --prepareMachine Prepare machine for CI run" + echo "" + echo "Command line arguments not listed above are passed through to MSBuild." + exit 0 + ;; + --pack) + pack=true + shift 1 + ;; + --preparemachine) + prepare_machine=true + shift 1 + ;; + --rebuild) + rebuild=true + shift 1 + ;; + --restore) + restore=true + shift 1 + ;; + --sign) + sign=true + shift 1 + ;; + --solution) + solution=$2 + shift 2 + ;; + --test) + test=true + shift 1 + ;; + --verbosity) + verbosity=$2 + shift 2 + ;; + *) + properties="$properties $1" + shift 1 + ;; + esac +done + +# ReadJson [filename] [json key] +# Result: Sets 'readjsonvalue' to the value of the provided json key +# Note: this method may return unexpected results if there are duplicate +# keys in the json +function ReadJson { + local file=$1 + local key=$2 + + local unamestr="$(uname)" + local sedextended='-r' + if [[ "$unamestr" == 'Darwin' ]]; then + sedextended='-E' + fi; + + readjsonvalue="$(grep -m 1 "\"$key\"" $file | sed $sedextended 's/^ *//;s/.*: *"//;s/",?//')" + if [[ ! "$readjsonvalue" ]]; then + echo "Error: Cannot find \"$key\" in $file" >&2; + ExitWithExitCode 1 + fi; +} + +function InitializeDotNetCli { + # Disable first run since we want to control all package sources + export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 + + # Don't resolve runtime, shared framework, or SDK from other locations to ensure build determinism + export DOTNET_MULTILEVEL_LOOKUP=0 + + # Source Build uses DotNetCoreSdkDir variable + if [[ -n "$DotNetCoreSdkDir" ]]; then + export DOTNET_INSTALL_DIR="$DotNetCoreSdkDir" + fi + + ReadJson "$global_json_file" "version" + local dotnet_sdk_version="$readjsonvalue" + local dotnet_root="" + + # Use dotnet installation specified in DOTNET_INSTALL_DIR if it contains the required SDK version, + # otherwise install the dotnet CLI and SDK to repo local .dotnet directory to avoid potential permission issues. + if [[ -d "$DOTNET_INSTALL_DIR/sdk/$dotnet_sdk_version" ]]; then + dotnet_root="$DOTNET_INSTALL_DIR" + else + dotnet_root="$repo_root/.dotnet" + export DOTNET_INSTALL_DIR="$dotnet_root" + + if [[ "$restore" == true ]]; then + InstallDotNetSdk $dotnet_root $dotnet_sdk_version + fi + fi + + build_driver="$dotnet_root/dotnet" +} + +function InstallDotNetSdk { + local root=$1 + local version=$2 + + local install_script=`GetDotNetInstallScript $root` + + bash "$install_script" --version $version --install-dir $root + local lastexitcode=$? + + if [[ $lastexitcode != 0 ]]; then + echo "Failed to install dotnet SDK (exit code '$lastexitcode')." + ExitWithExitCode $lastexitcode + fi +} + +function GetDotNetInstallScript { + local root=$1 + local install_script="$root/dotnet-install.sh" + + if [[ ! -a "$install_script" ]]; then + mkdir -p "$root" + + # Use curl if available, otherwise use wget + if command -v curl > /dev/null; then + curl "https://dot.net/v1/dotnet-install.sh" -sSL --retry 10 --create-dirs -o "$install_script" + else + wget -q -O "$install_script" "https://dot.net/v1/dotnet-install.sh" + fi + fi + + # return value + echo "$install_script" +} + +function InitializeToolset { + ReadJson $global_json_file "RoslynTools.RepoToolset" + local toolset_version=$readjsonvalue + local toolset_location_file="$toolset_dir/$toolset_version.txt" + + if [[ -a "$toolset_location_file" ]]; then + local path=`cat $toolset_location_file` + if [[ -a "$path" ]]; then + toolset_build_proj=$path + return + fi + fi + + if [[ "$restore" != true ]]; then + echo "Toolset version $toolsetVersion has not been restored." + ExitWithExitCode 2 + fi + + local proj="$toolset_dir/restore.proj" + + echo '' > $proj + "$build_driver" msbuild $proj /t:__WriteToolsetLocation /m /nologo /clp:None /warnaserror /bl:$toolset_restore_log /v:$verbosity /p:__ToolsetLocationOutputFile=$toolset_location_file + local lastexitcode=$? + + if [[ $lastexitcode != 0 ]]; then + echo "Failed to restore toolset (exit code '$lastexitcode'). See log: $toolset_restore_log" + ExitWithExitCode $lastexitcode + fi + + toolset_build_proj=`cat $toolset_location_file` + + if [[ ! -a "$toolset_build_proj" ]]; then + echo "Invalid toolset path: $toolset_build_proj" + ExitWithExitCode 3 + fi +} + +function InitializeCustomToolset { + local script="$eng_root/RestoreToolset.sh" + + if [[ -a "$script" ]]; then + . "$script" + fi +} + +function Build { + "$build_driver" msbuild $toolset_build_proj /m /nologo /clp:Summary /warnaserror \ + /v:$verbosity /bl:$build_log /p:Configuration=$configuration /p:Projects=$projects /p:RepoRoot="$repo_root" \ + /p:Restore=$restore /p:Build=$build /p:Rebuild=$rebuild /p:Deploy=$deploy /p:Test=$test /p:Sign=$sign /p:Pack=$pack /p:CIBuild=$ci \ + $properties + local lastexitcode=$? + + if [[ $lastexitcode != 0 ]]; then + echo "Failed to build $toolset_build_proj" + ExitWithExitCode $lastexitcode + fi +} + +function ExitWithExitCode { + if [[ "$ci" == true && "$prepare_machine" == true ]]; then + StopProcesses + fi + exit $1 +} + +function StopProcesses { + echo "Killing running build processes..." + pkill -9 "dotnet" + pkill -9 "vbcscompiler" +} + +function Main { + # HOME may not be defined in some scenarios, but it is required by NuGet + if [[ -z $HOME ]]; then + export HOME="$repo_root/artifacts/.home/" + mkdir -p "$HOME" + fi + + if [[ -z $projects ]]; then + projects="$repo_root/*.sln" + fi + + if [[ -z $NUGET_PACKAGES ]]; then + if [[ $ci ]]; then + export NUGET_PACKAGES="$repo_root/.packages" + else + export NUGET_PACKAGES="$HOME/.nuget/packages" + fi + fi + + mkdir -p "$toolset_dir" + mkdir -p "$log_dir" + + if [[ $ci ]]; then + mkdir -p "$temp_dir" + export TEMP="$temp_dir" + export TMP="$temp_dir" + fi + + InitializeDotNetCli + InitializeToolset + InitializeCustomToolset + + Build + ExitWithExitCode $? +} + +Main \ No newline at end of file diff --git a/eng/common/cibuild.sh b/eng/common/cibuild.sh new file mode 100644 index 0000000000..b5112539e7 --- /dev/null +++ b/eng/common/cibuild.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +source="${BASH_SOURCE[0]}" + +# resolve $SOURCE until the file is no longer a symlink +while [[ -h $source ]]; do + scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + source="$(readlink "$source")" + + # if $source was a relative symlink, we need to resolve it relative to the path where + # the symlink file was located + [[ $source != /* ]] && source="$scriptroot/$source" +done +scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + +. "$scriptroot/build.sh" --restore --build --test --ci $@ \ No newline at end of file diff --git a/global.json b/global.json new file mode 100644 index 0000000000..442674a978 --- /dev/null +++ b/global.json @@ -0,0 +1,11 @@ +{ + "sdk": { + "version": "2.1.300-rtm-008866" + }, + "msbuild-sdks": { + "RoslynTools.RepoToolset": "1.0.0-beta2-62922-02" + }, + "vswhere": { + "version": "2.2.7" + } +} diff --git a/netci.groovy b/netci.groovy index 116ef8293e..1de88fa9fb 100644 --- a/netci.groovy +++ b/netci.groovy @@ -2,20 +2,16 @@ // Jenkins DSL: https://github.com/jenkinsci/job-dsl-plugin/wiki import jobs.generation.Utilities; -import jobs.generation.ArchivalSettings; static getJobName(def opsysName, def configName) { return "${opsysName}_${configName}" } static addArchival(def job, def filesToArchive, def filesToExclude) { - def archivalSettings = new ArchivalSettings() - archivalSettings.addFiles(filesToArchive) - archivalSettings.excludeFiles(filesToExclude) - archivalSettings.setFailIfNothingArchived() - archivalSettings.setArchiveOnFailure() + def doNotFailIfNothingArchived = false + def archiveOnlyIfSuccessful = false - Utilities.addArchival(job, archivalSettings) + Utilities.addArchival(job, filesToArchive, filesToExclude, doNotFailIfNothingArchived, archiveOnlyIfSuccessful) } static addGithubPRTriggerForBranch(def job, def branchName, def jobName) { @@ -33,8 +29,8 @@ static addXUnitDotNETResults(def job, def configName) { Utilities.addXUnitDotNETResults(job, resultFilePattern, skipIfNoTestFiles) } -static addBuildSteps(def job, def projectName, def opsysName, def configName, def isPR) { - def buildJobName = getJobName(opsysName, configName) +static addBuildSteps(def job, def projectName, def os, def configName, def isPR) { + def buildJobName = getJobName(os, configName) def buildFullJobName = Utilities.getFullJobName(projectName, buildJobName, isPR) job.with { @@ -44,22 +40,25 @@ static addBuildSteps(def job, def projectName, def opsysName, def configName, de } } steps { - batchFile(""".\\build\\CIBuild.cmd -configuration ${configName} -prepareMachine""") + if (os == "Windows_NT") { + batchFile(""".\\eng\\common\\CIBuild.cmd -configuration ${configName} -prepareMachine""") + } else { + shell("./eng/common/cibuild.sh --configuration ${configName} --prepareMachine") + } } } } [true, false].each { isPR -> - ['windows'].each { opsysName -> - ['debug', 'release'].each { configName -> + ['Ubuntu16.04', 'Windows_NT'].each { os -> + ['Debug', 'Release'].each { configName -> def projectName = GithubProject def branchName = GithubBranchName - def filesToArchive = "**/artifacts/**" - def filesToExclude = "**/artifacts/${configName}/obj/**" + def filesToArchive = "**/artifacts/${configName}/**" - def jobName = getJobName(opsysName, configName) + def jobName = getJobName(os, configName) def fullJobName = Utilities.getFullJobName(projectName, jobName, isPR) def myJob = job(fullJobName) @@ -71,12 +70,16 @@ static addBuildSteps(def job, def projectName, def opsysName, def configName, de Utilities.addGithubPushTrigger(myJob) } - addArchival(myJob, filesToArchive, filesToExclude) + addArchival(myJob, filesToArchive, "") addXUnitDotNETResults(myJob, configName) - Utilities.setMachineAffinity(myJob, 'Windows_NT', 'latest-dev15-3') + if (os == 'Windows_NT') { + Utilities.setMachineAffinity(myJob, 'Windows.10.Amd64.ClientRS3.DevEx.Open') + } else { + Utilities.setMachineAffinity(myJob, os, 'latest-or-auto') + } - addBuildSteps(myJob, projectName, opsysName, configName, isPR) + addBuildSteps(myJob, projectName, os, configName, isPR) } } } diff --git a/nuget.config b/nuget.config new file mode 100644 index 0000000000..17bcf4387c --- /dev/null +++ b/nuget.config @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/nuget/Directory.Build.props b/nuget/Directory.Build.props index a4f61c06bf..d6ddba81dc 100644 --- a/nuget/Directory.Build.props +++ b/nuget/Directory.Build.props @@ -5,5 +5,10 @@ - + + + false + + + \ No newline at end of file diff --git a/nuget/Directory.Build.targets b/nuget/Directory.Build.targets index 430b75fdfd..9c996be5f6 100644 --- a/nuget/Directory.Build.targets +++ b/nuget/Directory.Build.targets @@ -4,7 +4,8 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - + + diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 53dc429c7c..8ab111e407 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,12 +1,13 @@ + + - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + false - - - + + $(NoWarn);xUnit1004;xUnit2000;xUnit2003;xUnit2004;xUnit2009;xUnit2010;xUnit1013 @@ -26,7 +27,7 @@ - $(MSBuildThisFileDirectory)..\build\Analyzers_NonShippingRules.ruleset - $(MSBuildThisFileDirectory)..\build\Analyzers_ShippingRules.ruleset + $(MSBuildThisFileDirectory)..\eng\Analyzers_NonShippingRules.ruleset + $(MSBuildThisFileDirectory)..\eng\Analyzers_ShippingRules.ruleset diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets index 42480aacdf..b9e541396c 100644 --- a/src/Directory.Build.targets +++ b/src/Directory.Build.targets @@ -1,8 +1,5 @@ - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - + - $(MSBuildAllProjects);$(MSBuildThisFileDirectory)..\build\Analyzers_ShippingRules.ruleset + $(MSBuildAllProjects);$(MSBuildThisFileDirectory)..\build\Analyzers_ShippingRules.ruleset @@ -33,7 +30,7 @@ - + @@ -48,8 +45,9 @@ <_TestResultsOpenCoverPath>$(_TestOutPathNoExt).coverage <_RunOnCore>false <_RunOnCore Condition="$(TargetFramework.StartsWith('netcoreapp'))">true - <_UseOpenCover>$(UseOpenCover) - <_UseOpenCover Condition="'$(_RunOnCore)' == 'true'">false + + <_UseOpenCover>false + <_UseOpenCover Condition="'$(CODECOV_TOKEN)' != '' and '$(_RunOnCore)' != 'true'">true - + MetaCompilation Analyzers This is a sample diagnostic extension for the .NET Compiler Platform ("Roslyn"). diff --git a/src/Microsoft.CodeAnalysis.Analyzers/Setup/source.extension.vsixmanifest b/src/Microsoft.CodeAnalysis.Analyzers/Setup/source.extension.vsixmanifest index 58b3e1e7a9..47e107136a 100644 --- a/src/Microsoft.CodeAnalysis.Analyzers/Setup/source.extension.vsixmanifest +++ b/src/Microsoft.CodeAnalysis.Analyzers/Setup/source.extension.vsixmanifest @@ -2,7 +2,7 @@ - + .NET Compiler Platform (Roslyn) Analyzers Analyzers for .NET Compiler Platform (Roslyn) APIs. diff --git a/src/Microsoft.CodeAnalysis.FxCopAnalyzers/Setup/source.extension.vsixmanifest b/src/Microsoft.CodeAnalysis.FxCopAnalyzers/Setup/source.extension.vsixmanifest index d94b998d25..98cb96093c 100644 --- a/src/Microsoft.CodeAnalysis.FxCopAnalyzers/Setup/source.extension.vsixmanifest +++ b/src/Microsoft.CodeAnalysis.FxCopAnalyzers/Setup/source.extension.vsixmanifest @@ -2,7 +2,7 @@ - + Microsoft Code Analysis 2017 Live code analysis rules and code fixes addressing API design, performance, security, and best practices for C# and Visual Basic. https://go.microsoft.com/fwlink/?linkid=849061 @@ -19,7 +19,7 @@ - + Experimental Microsoft.CodeQuality Analyzers Experimental Microsoft.CodeQuality Analyzers diff --git a/src/Microsoft.CodeQuality.Analyzers/Setup/source.extension.vsixmanifest b/src/Microsoft.CodeQuality.Analyzers/Setup/source.extension.vsixmanifest index 90c913814b..c157f08337 100644 --- a/src/Microsoft.CodeQuality.Analyzers/Setup/source.extension.vsixmanifest +++ b/src/Microsoft.CodeQuality.Analyzers/Setup/source.extension.vsixmanifest @@ -2,7 +2,7 @@ - + Microsoft.CodeQuality Analyzers Microsoft.CodeQuality Analyzers diff --git a/src/Microsoft.NetCore.Analyzers/Setup/source.extension.vsixmanifest b/src/Microsoft.NetCore.Analyzers/Setup/source.extension.vsixmanifest index c6915378f1..6a27987764 100644 --- a/src/Microsoft.NetCore.Analyzers/Setup/source.extension.vsixmanifest +++ b/src/Microsoft.NetCore.Analyzers/Setup/source.extension.vsixmanifest @@ -2,7 +2,7 @@ - + Microsoft.NetCore Analyzers Analyzers for .NetCore APIs. diff --git a/src/Microsoft.NetFramework.Analyzers/Setup/source.extension.vsixmanifest b/src/Microsoft.NetFramework.Analyzers/Setup/source.extension.vsixmanifest index 6023db8217..7ea671af4d 100644 --- a/src/Microsoft.NetFramework.Analyzers/Setup/source.extension.vsixmanifest +++ b/src/Microsoft.NetFramework.Analyzers/Setup/source.extension.vsixmanifest @@ -2,7 +2,7 @@ - + Microsoft.NetFramework Analyzers Analyzers for APIs specific to the full .NetFramework which are not present in .NetCore diff --git a/src/Roslyn.Diagnostics.Analyzers/Setup/source.extension.vsixmanifest b/src/Roslyn.Diagnostics.Analyzers/Setup/source.extension.vsixmanifest index 9691cb2215..cc9e71212b 100644 --- a/src/Roslyn.Diagnostics.Analyzers/Setup/source.extension.vsixmanifest +++ b/src/Roslyn.Diagnostics.Analyzers/Setup/source.extension.vsixmanifest @@ -2,7 +2,7 @@ - + Roslyn.Diagnostics Analyzers Roslyn.Diagnostics Analyzers diff --git a/src/Test.Utilities/Directory.Build.targets b/src/Test.Utilities/Directory.Build.targets index 0a601f2fab..5eafa2327c 100644 --- a/src/Test.Utilities/Directory.Build.targets +++ b/src/Test.Utilities/Directory.Build.targets @@ -13,7 +13,7 @@ - $(RepoRoot)build\RoslynInternalKey.Private.snk + $(RepoRoot)eng\RoslynInternalKey.Private.snk 002400000480000094000000060200000024000052534131000400000100010055e0217eb635f69281051f9a823e0c7edd90f28063eb6c7a742a19b4f6139778ee0af438f47aed3b6e9f99838aa8dba689c7a71ddb860c96d923830b57bbd5cd6119406ddb9b002cf1c723bf272d6acbb7129e9d6dd5a5309c94e0ff4b2c884d45a55f475cd7dba59198086f61f5a8c8b5e601c0edbf269733f6f578fc8579c2 fc793a00266884fb diff --git a/src/Text.Analyzers/Setup/source.extension.vsixmanifest b/src/Text.Analyzers/Setup/source.extension.vsixmanifest index b2b2c3a778..455b83205c 100644 --- a/src/Text.Analyzers/Setup/source.extension.vsixmanifest +++ b/src/Text.Analyzers/Setup/source.extension.vsixmanifest @@ -2,7 +2,7 @@ - + Text Analyzers Text Analyzers diff --git a/src/Unfactored/AsyncPackage/AsyncPackage/AsyncPackage.csproj b/src/Unfactored/AsyncPackage/AsyncPackage/AsyncPackage.csproj index 8646c48352..cb3a1e2f50 100644 --- a/src/Unfactored/AsyncPackage/AsyncPackage/AsyncPackage.csproj +++ b/src/Unfactored/AsyncPackage/AsyncPackage/AsyncPackage.csproj @@ -1,8 +1,5 @@  - - - Debug AnyCPU @@ -139,7 +136,4 @@ - - - \ No newline at end of file diff --git a/src/Unfactored/AsyncPackage/AsyncPackage/source.extension.vsixmanifest b/src/Unfactored/AsyncPackage/AsyncPackage/source.extension.vsixmanifest index 3bc382e209..b7b5bf7b65 100644 --- a/src/Unfactored/AsyncPackage/AsyncPackage/source.extension.vsixmanifest +++ b/src/Unfactored/AsyncPackage/AsyncPackage/source.extension.vsixmanifest @@ -1,7 +1,7 @@  - + AsyncPackage This is a sample diagnostic extension for the .NET Compiler Platform ("Roslyn"). diff --git a/src/Unfactored/Roslyn/Setup/source.extension.vsixmanifest b/src/Unfactored/Roslyn/Setup/source.extension.vsixmanifest index 5412c0b6bc..77441d52a8 100644 --- a/src/Unfactored/Roslyn/Setup/source.extension.vsixmanifest +++ b/src/Unfactored/Roslyn/Setup/source.extension.vsixmanifest @@ -2,7 +2,7 @@ - + Roslyn Analyzers Diagnostics for the Roslyn codebase. diff --git a/tools/AnalyzerCodeGenerator/template/build/Targets/Analyzers.Imports.targets b/tools/AnalyzerCodeGenerator/template/build/Targets/Analyzers.Imports.targets index 4bf779752f..b21f336525 100644 --- a/tools/AnalyzerCodeGenerator/template/build/Targets/Analyzers.Imports.targets +++ b/tools/AnalyzerCodeGenerator/template/build/Targets/Analyzers.Imports.targets @@ -48,7 +48,7 @@ - + diff --git a/tools/AnalyzerCodeGenerator/template/src/REPLACE.ME/Setup/source.extension.vsixmanifest b/tools/AnalyzerCodeGenerator/template/src/REPLACE.ME/Setup/source.extension.vsixmanifest index 787d3c35b2..bae20ee8b2 100644 --- a/tools/AnalyzerCodeGenerator/template/src/REPLACE.ME/Setup/source.extension.vsixmanifest +++ b/tools/AnalyzerCodeGenerator/template/src/REPLACE.ME/Setup/source.extension.vsixmanifest @@ -2,7 +2,7 @@ - + REPLACE.ME Analyzers Setup REPLACE.ME Analyzers Setup diff --git a/tools/AnalyzersStatusGenerator/AnalyzersStatusGenerator.csproj b/tools/AnalyzersStatusGenerator/AnalyzersStatusGenerator.csproj index 3314b61b3f..e7c06a211a 100644 --- a/tools/AnalyzersStatusGenerator/AnalyzersStatusGenerator.csproj +++ b/tools/AnalyzersStatusGenerator/AnalyzersStatusGenerator.csproj @@ -1,7 +1,4 @@  - - - net46 AnalyzersStatusGenerator @@ -25,7 +22,4 @@ - - - \ No newline at end of file diff --git a/tools/a2md/a2md.csproj b/tools/a2md/a2md.csproj index 2beaf8e24d..52a249155d 100644 --- a/tools/a2md/a2md.csproj +++ b/tools/a2md/a2md.csproj @@ -1,8 +1,5 @@  - - - net46 a2md @@ -25,7 +22,4 @@ - - - \ No newline at end of file