This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Manual update to 20190320.3 of arcade (#36196)
* Manual update to 20190320.3 of arcade * Disable use of PackageLicenseExpression We need to workaround NuGet issue NuGet/Home#7894
- Loading branch information
1 parent
ce8dff7
commit 71c986e
Showing
16 changed files
with
278 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
Param( | ||
[Parameter(Mandatory=$true)][string] $barToken, # Token generated at https://maestro-prod.westus2.cloudapp.azure.com/Account/Tokens | ||
[Parameter(Mandatory=$true)][string] $gitHubPat, # GitHub personal access token from https://github.com/settings/tokens (no auth scopes needed) | ||
[Parameter(Mandatory=$true)][string] $azdoPat, # Azure Dev Ops tokens from https://dev.azure.com/dnceng/_details/security/tokens (code read scope needed) | ||
[Parameter(Mandatory=$true)][string] $outputFolder, # Where the graphviz.txt file will be created | ||
[string] $darcVersion = '1.1.0-beta.19169.5', # darc's version | ||
[string] $graphvizVersion = '2.38', # GraphViz version | ||
[switch] $includeToolset # Whether the graph should include toolset dependencies or not. i.e. arcade, optimization. For more about | ||
# toolset dependencies see https://github.com/dotnet/arcade/blob/master/Documentation/Darc.md#toolset-vs-product-dependencies | ||
) | ||
|
||
$ErrorActionPreference = "Stop" | ||
. $PSScriptRoot\tools.ps1 | ||
|
||
Import-Module -Name (Join-Path $PSScriptRoot "native\CommonLibrary.psm1") | ||
|
||
function CheckExitCode ([string]$stage) | ||
{ | ||
$exitCode = $LASTEXITCODE | ||
if ($exitCode -ne 0) { | ||
Write-Host "Something failed in stage: '$stage'. Check for errors above. Exiting now..." | ||
ExitWithExitCode $exitCode | ||
} | ||
} | ||
|
||
try { | ||
Push-Location $PSScriptRoot | ||
|
||
Write-Host "Installing darc..." | ||
. .\darc-init.ps1 -darcVersion $darcVersion | ||
CheckExitCode "Running darc-init" | ||
|
||
$engCommonBaseDir = Join-Path $PSScriptRoot "native\" | ||
$graphvizInstallDir = CommonLibrary\Get-NativeInstallDirectory | ||
$nativeToolBaseUri = "https://netcorenativeassets.blob.core.windows.net/resource-packages/external" | ||
$installBin = Join-Path $graphvizInstallDir "bin" | ||
|
||
Write-Host "Installing dot..." | ||
.\native\install-tool.ps1 -ToolName graphviz -InstallPath $installBin -BaseUri $nativeToolBaseUri -CommonLibraryDirectory $engCommonBaseDir -Version $graphvizVersion -Verbose | ||
|
||
$darcExe = "$env:USERPROFILE\.dotnet\tools" | ||
$darcExe = Resolve-Path "$darcExe\darc.exe" | ||
|
||
Create-Directory $outputFolder | ||
|
||
# Generate 3 graph descriptions: | ||
# 1. Flat with coherency information | ||
# 2. Graphviz (dot) file | ||
# 3. Standard dependency graph | ||
$graphVizFilePath = "$outputFolder\graphviz.txt" | ||
$graphVizImageFilePath = "$outputFolder\graph.png" | ||
$normalGraphFilePath = "$outputFolder\graph-full.txt" | ||
$flatGraphFilePath = "$outputFolder\graph-flat.txt" | ||
$baseOptions = "get-dependency-graph --github-pat $gitHubPat --azdev-pat $azdoPat --password $barToken" | ||
|
||
if ($includeToolset) { | ||
Write-Host "Toolsets will be included in the graph..." | ||
$baseOptions += " --include-toolset" | ||
} | ||
|
||
Write-Host "Generating standard dependency graph..." | ||
Invoke-Expression "& `"$darcExe`" $baseOptions --output-file $normalGraphFilePath" | ||
CheckExitCode "Generating normal dependency graph" | ||
|
||
Write-Host "Generating flat dependency graph and graphviz file..." | ||
Invoke-Expression "& `"$darcExe`" $baseOptions --flat --coherency --graphviz $graphVizFilePath --output-file $flatGraphFilePath" | ||
CheckExitCode "Generating flat and graphviz dependency graph" | ||
|
||
Write-Host "Generating graph image $graphVizFilePath" | ||
$dotFilePath = Join-Path $installBin "graphviz\$graphvizVersion\release\bin\dot.exe" | ||
Invoke-Expression "& `"$dotFilePath`" -Tpng -o'$graphVizImageFilePath' `"$graphVizFilePath`"" | ||
CheckExitCode "Generating graphviz image" | ||
|
||
Write-Host "'$graphVizFilePath', '$flatGraphFilePath', '$normalGraphFilePath' and '$graphVizImageFilePath' created!" | ||
} | ||
catch { | ||
if (!$includeToolset) { | ||
Write-Host "This might be a toolset repo which includes only toolset dependencies. " -NoNewline -ForegroundColor Yellow | ||
Write-Host "Since -includeToolset is not set there is no graph to create. Include -includeToolset and try again..." -ForegroundColor Yellow | ||
} | ||
Write-Host $_ | ||
Write-Host $_.Exception | ||
Write-Host $_.ScriptStackTrace | ||
ExitWithExitCode 1 | ||
} finally { | ||
Pop-Location | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
parameters: | ||
# Optional: dependencies of the job | ||
dependsOn: '' | ||
|
||
# Optional: A defined YAML pool - https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=vsts&tabs=schema#pool | ||
pool: {} | ||
|
||
# Optional: Include toolset dependencies in the generated graph files | ||
includeToolset: false | ||
|
||
jobs: | ||
- job: Generate_Graph_Files | ||
|
||
dependsOn: ${{ parameters.dependsOn }} | ||
|
||
displayName: Generate Graph Files | ||
|
||
pool: ${{ parameters.pool }} | ||
|
||
variables: | ||
# Publish-Build-Assets provides: MaestroAccessToken, BotAccount-dotnet-maestro-bot-PAT | ||
# DotNet-AllOrgs-Darc-Pats provides: dn-bot-devdiv-dnceng-rw-code-pat | ||
- group: Publish-Build-Assets | ||
- group: DotNet-AllOrgs-Darc-Pats | ||
- name: _GraphArguments | ||
value: -gitHubPat $(BotAccount-dotnet-maestro-bot-PAT) | ||
-azdoPat $(dn-bot-devdiv-dnceng-rw-code-pat) | ||
-barToken $(MaestroAccessToken) | ||
-outputFolder '$(Build.StagingDirectory)/GraphFiles/' | ||
- ${{ if ne(parameters.includeToolset, 'false') }}: | ||
- name: _GraphArguments | ||
value: ${{ variables._GraphArguments }} -includeToolset | ||
|
||
steps: | ||
- task: PowerShell@2 | ||
displayName: Generate Graph Files | ||
inputs: | ||
filePath: eng\common\generate-graph-files.ps1 | ||
arguments: $(_GraphArguments) | ||
continueOnError: true | ||
- task: PublishBuildArtifacts@1 | ||
displayName: Publish Graph to Artifacts | ||
inputs: | ||
PathtoPublish: '$(Build.StagingDirectory)/GraphFiles' | ||
PublishLocation: Container | ||
ArtifactName: GraphFiles | ||
continueOnError: true | ||
condition: always() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.