Skip to content

Commit

Permalink
Merge pull request dotnet#3683 from StephenBonikowsky/stebon/master/u…
Browse files Browse the repository at this point in the history
…pdatedependencies

Update to latest .NET Tools
  • Loading branch information
StephenBonikowsky authored Jun 11, 2019
2 parents d73646c + 72ba665 commit d58487a
Show file tree
Hide file tree
Showing 23 changed files with 716 additions and 112 deletions.
16 changes: 8 additions & 8 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
<ProductDependencies>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.19266.4">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.19311.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>61cc7d4d347300835925ce5245bfc3ecb6b621d7</Sha>
<Sha>dfc41299b9aadb1ca98093d660df81811eca901b</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.SignTool" Version="1.0.0-beta.19266.4">
<Dependency Name="Microsoft.DotNet.SignTool" Version="1.0.0-beta.19311.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>61cc7d4d347300835925ce5245bfc3ecb6b621d7</Sha>
<Sha>dfc41299b9aadb1ca98093d660df81811eca901b</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="2.0.0-beta.19266.4">
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="2.0.0-beta.19311.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>61cc7d4d347300835925ce5245bfc3ecb6b621d7</Sha>
<Sha>dfc41299b9aadb1ca98093d660df81811eca901b</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.GenFacades" Version="1.0.0-beta.19266.4">
<Dependency Name="Microsoft.DotNet.GenFacades" Version="1.0.0-beta.19311.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>61cc7d4d347300835925ce5245bfc3ecb6b621d7</Sha>
<Sha>dfc41299b9aadb1ca98093d660df81811eca901b</Sha>
</Dependency>
<!--[todo: arcade] Updating XUnitExtensions to a newer version causes compile errors
related to the use of "Assert" an xunit type in our Scenario test common project.-->
Expand Down
8 changes: 4 additions & 4 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
</PropertyGroup>
<!-- Arcade dependencies -->
<PropertyGroup>
<MicrosoftDotNetArcadeSdkPackageVersion>1.0.0-beta.19266.4</MicrosoftDotNetArcadeSdkPackageVersion>
<MicrosoftDotNetHelixSdkPackageVersion>2.0.0-beta.19266.4</MicrosoftDotNetHelixSdkPackageVersion>
<MicrosoftDotNetGenFacadesPackageVersion>1.0.0-beta.19266.4</MicrosoftDotNetGenFacadesPackageVersion>
<MicrosoftDotNetArcadeSdkPackageVersion>1.0.0-beta.19311.2</MicrosoftDotNetArcadeSdkPackageVersion>
<MicrosoftDotNetHelixSdkPackageVersion>2.0.0-beta.19311.2</MicrosoftDotNetHelixSdkPackageVersion>
<MicrosoftDotNetGenFacadesPackageVersion>1.0.0-beta.19311.2</MicrosoftDotNetGenFacadesPackageVersion>
<MicrosoftDotNetXUnitExtensionsPackageVersion>2.4.0-beta.19171.6</MicrosoftDotNetXUnitExtensionsPackageVersion>
<MicrosoftDotNetSignToolVersion>1.0.0-beta.19266.4</MicrosoftDotNetSignToolVersion>
<MicrosoftDotNetSignToolVersion>1.0.0-beta.19311.2</MicrosoftDotNetSignToolVersion>
</PropertyGroup>
<!-- CoreFx dependencies -->
<PropertyGroup>
Expand Down
146 changes: 146 additions & 0 deletions eng/common/LoggingCommandFunctions.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
# Source for this file was taken from https://github.com/microsoft/azure-pipelines-task-lib/blob/11c9439d4af17e6475d9fe058e6b2e03914d17e6/powershell/VstsTaskSdk/LoggingCommandFunctions.ps1

# NOTE: You should not be calling these method directly as they are likely to change. Instead you should be calling the Write-Pipeline* functions defined in tools.ps1

$script:loggingCommandPrefix = '##vso['
$script:loggingCommandEscapeMappings = @( # TODO: WHAT ABOUT "="? WHAT ABOUT "%"?
New-Object psobject -Property @{ Token = ';' ; Replacement = '%3B' }
New-Object psobject -Property @{ Token = "`r" ; Replacement = '%0D' }
New-Object psobject -Property @{ Token = "`n" ; Replacement = '%0A' }
New-Object psobject -Property @{ Token = "]" ; Replacement = '%5D' }
)
# TODO: BUG: Escape % ???
# TODO: Add test to verify don't need to escape "=".

<########################################
# Private functions.
########################################>
function Format-LoggingCommandData {
[CmdletBinding()]
param([string]$Value, [switch]$Reverse)

if (!$Value) {
return ''
}

if (!$Reverse) {
foreach ($mapping in $script:loggingCommandEscapeMappings) {
$Value = $Value.Replace($mapping.Token, $mapping.Replacement)
}
} else {
for ($i = $script:loggingCommandEscapeMappings.Length - 1 ; $i -ge 0 ; $i--) {
$mapping = $script:loggingCommandEscapeMappings[$i]
$Value = $Value.Replace($mapping.Replacement, $mapping.Token)
}
}

return $Value
}

function Format-LoggingCommand {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string]$Area,
[Parameter(Mandatory = $true)]
[string]$Event,
[string]$Data,
[hashtable]$Properties)

# Append the preamble.
[System.Text.StringBuilder]$sb = New-Object -TypeName System.Text.StringBuilder
$null = $sb.Append($script:loggingCommandPrefix).Append($Area).Append('.').Append($Event)

# Append the properties.
if ($Properties) {
$first = $true
foreach ($key in $Properties.Keys) {
[string]$value = Format-LoggingCommandData $Properties[$key]
if ($value) {
if ($first) {
$null = $sb.Append(' ')
$first = $false
} else {
$null = $sb.Append(';')
}

$null = $sb.Append("$key=$value")
}
}
}

# Append the tail and output the value.
$Data = Format-LoggingCommandData $Data
$sb.Append(']').Append($Data).ToString()
}

function Write-LoggingCommand {
[CmdletBinding(DefaultParameterSetName = 'Parameters')]
param(
[Parameter(Mandatory = $true, ParameterSetName = 'Parameters')]
[string]$Area,
[Parameter(Mandatory = $true, ParameterSetName = 'Parameters')]
[string]$Event,
[Parameter(ParameterSetName = 'Parameters')]
[string]$Data,
[Parameter(ParameterSetName = 'Parameters')]
[hashtable]$Properties,
[Parameter(Mandatory = $true, ParameterSetName = 'Object')]
$Command,
[switch]$AsOutput)

if ($PSCmdlet.ParameterSetName -eq 'Object') {
Write-LoggingCommand -Area $Command.Area -Event $Command.Event -Data $Command.Data -Properties $Command.Properties -AsOutput:$AsOutput
return
}

$command = Format-LoggingCommand -Area $Area -Event $Event -Data $Data -Properties $Properties
if ($AsOutput) {
$command
} else {
Write-Host $command
}
}

function Write-LogIssue {
[CmdletBinding()]
param(
[ValidateSet('warning', 'error')]
[Parameter(Mandatory = $true)]
[string]$Type,
[string]$Message,
[string]$ErrCode,
[string]$SourcePath,
[string]$LineNumber,
[string]$ColumnNumber,
[switch]$AsOutput)

$command = Format-LoggingCommand -Area 'task' -Event 'logissue' -Data $Message -Properties @{
'type' = $Type
'code' = $ErrCode
'sourcepath' = $SourcePath
'linenumber' = $LineNumber
'columnnumber' = $ColumnNumber
}
if ($AsOutput) {
return $command
}

if ($Type -eq 'error') {
$foregroundColor = $host.PrivateData.ErrorForegroundColor
$backgroundColor = $host.PrivateData.ErrorBackgroundColor
if ($foregroundColor -isnot [System.ConsoleColor] -or $backgroundColor -isnot [System.ConsoleColor]) {
$foregroundColor = [System.ConsoleColor]::Red
$backgroundColor = [System.ConsoleColor]::Black
}
} else {
$foregroundColor = $host.PrivateData.WarningForegroundColor
$backgroundColor = $host.PrivateData.WarningBackgroundColor
if ($foregroundColor -isnot [System.ConsoleColor] -or $backgroundColor -isnot [System.ConsoleColor]) {
$foregroundColor = [System.ConsoleColor]::Yellow
$backgroundColor = [System.ConsoleColor]::Black
}
}

Write-Host $command -ForegroundColor $foregroundColor -BackgroundColor $backgroundColor
}
1 change: 1 addition & 0 deletions eng/common/PublishToPackageFeed.proj
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
<TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == 'WINDOWSDESKTOP'">https://dotnetfeed.blob.core.windows.net/dotnet-windowsdesktop/index.json</TargetStaticFeed>
<TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == 'NUGETCLIENT'">https://dotnetfeed.blob.core.windows.net/nuget-nugetclient/index.json</TargetStaticFeed>
<TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == 'ASPNETENTITYFRAMEWORK6'">https://dotnetfeed.blob.core.windows.net/aspnet-entityframework6/index.json</TargetStaticFeed>
<TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == 'ASPNETBLAZOR'">https://dotnetfeed.blob.core.windows.net/aspnet-blazor/index.json</TargetStaticFeed>
</PropertyGroup>

<Error
Expand Down
7 changes: 5 additions & 2 deletions eng/common/build.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[CmdletBinding(PositionalBinding=$false)]
Param(
[string][Alias('c')]$configuration = "Debug",
[string]$platform = $null,
[string] $projects,
[string][Alias('v')]$verbosity = "minimal",
[string] $msbuildEngine = $null,
Expand Down Expand Up @@ -29,6 +30,7 @@ Param(
function Print-Usage() {
Write-Host "Common settings:"
Write-Host " -configuration <value> Build configuration: 'Debug' or 'Release' (short: -c)"
Write-Host " -platform <value> Platform configuration: 'x86', 'x64' or any valid Platform value to pass to msbuild"
Write-Host " -verbosity <value> Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] (short: -v)"
Write-Host " -binaryLog Output binary log (short: -bl)"
Write-Host " -help Print help and exit"
Expand Down Expand Up @@ -77,6 +79,7 @@ function Build {
InitializeCustomToolset

$bl = if ($binaryLog) { "/bl:" + (Join-Path $LogDir "Build.binlog") } else { "" }
$platformArg = if ($platform) { "/p:Platform=$platform" } else { "" }

if ($projects) {
# Re-assign properties to a new variable because PowerShell doesn't let us append properties directly for unclear reasons.
Expand All @@ -88,6 +91,7 @@ function Build {

MSBuild $toolsetBuildProj `
$bl `
$platformArg `
/p:Configuration=$configuration `
/p:RepoRoot=$RepoRoot `
/p:Restore=$restore `
Expand Down Expand Up @@ -129,9 +133,8 @@ try {
Build
}
catch {
Write-Host $_
Write-Host $_.Exception
Write-Host $_.ScriptStackTrace
Write-PipelineTaskError -Message $_
ExitWithExitCode 1
}

Expand Down
5 changes: 5 additions & 0 deletions eng/common/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ ci=false
warn_as_error=true
node_reuse=true
binary_log=false
pipelines_log=false

projects=''
configuration='Debug'
Expand All @@ -92,6 +93,9 @@ while [[ $# > 0 ]]; do
-binarylog|-bl)
binary_log=true
;;
-pipelineslog|-pl)
pipelines_log=true
;;
-restore|-r)
restore=true
;;
Expand Down Expand Up @@ -146,6 +150,7 @@ while [[ $# > 0 ]]; do
done

if [[ "$ci" == true ]]; then
pipelines_log=true
binary_log=true
node_reuse=false
fi
Expand Down
6 changes: 3 additions & 3 deletions eng/common/cross/armel/tizen-fetch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,15 @@ fetch_tizen_pkgs()
Inform "Initialize arm base"
fetch_tizen_pkgs_init standard base
Inform "fetch common packages"
fetch_tizen_pkgs armv7l gcc glibc glibc-devel libicu libicu-devel
fetch_tizen_pkgs armv7l gcc glibc glibc-devel libicu libicu-devel libatomic
fetch_tizen_pkgs noarch linux-glibc-devel
Inform "fetch coreclr packages"
fetch_tizen_pkgs armv7l lldb lldb-devel libgcc libstdc++ libstdc++-devel libunwind libunwind-devel tizen-release lttng-ust-devel lttng-ust userspace-rcu-devel userspace-rcu
fetch_tizen_pkgs armv7l lldb lldb-devel libgcc libstdc++ libstdc++-devel libunwind libunwind-devel lttng-ust-devel lttng-ust userspace-rcu-devel userspace-rcu
Inform "fetch corefx packages"
fetch_tizen_pkgs armv7l libcom_err libcom_err-devel zlib zlib-devel libopenssl libopenssl-devel krb5 krb5-devel libcurl libcurl-devel

Inform "Initialize standard unified"
fetch_tizen_pkgs_init standard unified
Inform "fetch corefx packages"
fetch_tizen_pkgs armv7l gssdp gssdp-devel
fetch_tizen_pkgs armv7l gssdp gssdp-devel tizen-release

2 changes: 1 addition & 1 deletion eng/common/cross/build-rootfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ if [ -z "$__RootfsDir" ] && [ ! -z "$ROOTFS_DIR" ]; then
fi

if [ -z "$__RootfsDir" ]; then
__RootfsDir="$__CrossDir/rootfs/$__BuildArch"
__RootfsDir="$__CrossDir/../../../.tools/rootfs/$__BuildArch"
fi

if [ -d "$__RootfsDir" ]; then
Expand Down
8 changes: 4 additions & 4 deletions eng/common/darc-init.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ function InstallDarcCli ($darcVersion) {

$dotnetRoot = InitializeDotNetCli -install:$true
$dotnet = "$dotnetRoot\dotnet.exe"
$toolList = Invoke-Expression "& `"$dotnet`" tool list -g"
$toolList = & "$dotnet" tool list -g

if ($toolList -like "*$darcCliPackageName*") {
Invoke-Expression "& `"$dotnet`" tool uninstall $darcCliPackageName -g"
& "$dotnet" tool uninstall $darcCliPackageName -g
}

# If the user didn't explicitly specify the darc version,
# query the Maestro API for the correct version of darc to install.
if (-not $darcVersion) {
$darcVersion = $(Invoke-WebRequest -Uri $versionEndpoint -UseBasicParsing).Content
}

$arcadeServicesSource = 'https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json'

Write-Host "Installing Darc CLI version $darcVersion..."
Write-Host "You may need to restart your command window if this is the first dotnet tool you have installed."
Invoke-Expression "& `"$dotnet`" tool install $darcCliPackageName --version $darcVersion --add-source '$arcadeServicesSource' -v $verbosity -g"
& "$dotnet" tool install $darcCliPackageName --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity -g
}

InstallDarcCli $darcVersion
11 changes: 8 additions & 3 deletions eng/common/dotnet-install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ Param(

. $PSScriptRoot\tools.ps1

$dotnetRoot = Join-Path $RepoRoot ".dotnet"

$installdir = $dotnetRoot
try {
$dotnetRoot = Join-Path $RepoRoot ".dotnet"
InstallDotNet $dotnetRoot $version $architecture $runtime $true
if ($architecture -and $architecture.Trim() -eq "x86") {
$installdir = Join-Path $installdir "x86"
}
InstallDotNet $installdir $version $architecture $runtime $true
}
catch {
Write-Host $_
Expand All @@ -19,4 +24,4 @@ catch {
ExitWithExitCode 1
}

ExitWithExitCode 0
ExitWithExitCode 0
Loading

0 comments on commit d58487a

Please sign in to comment.