Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dotnet/sourcelink
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.0.0-beta2-19351-01
Choose a base ref
...
head repository: dotnet/sourcelink
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1.0.0-beta2-19367-01
Choose a head ref

Commits on Jul 1, 2019

  1. Update README, TPN (#313)

    tmat authored Jul 1, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    643c540 View commit details
  2. Remove unused scripts (#314)

    tmat authored Jul 1, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f1beae8 View commit details
  3. Enable symbol uploader (#315)

    tmat authored Jul 1, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    65434f3 View commit details
  4. Copy the full SHA
    ba5f7c8 View commit details

Commits on Jul 2, 2019

  1. Update dependencies from https://github.com/dotnet/arcade build 20190…

    …701.4 (#317)
    
    - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19351.4
    dotnet-maestro[bot] authored Jul 2, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    caf630a View commit details

Commits on Jul 3, 2019

  1. Update dependencies from https://github.com/dotnet/arcade build 20190…

    …702.7 (#319)
    
    - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19352.7
    dotnet-maestro[bot] authored Jul 3, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    dc5b4d0 View commit details

Commits on Jul 4, 2019

  1. Update dependencies from https://github.com/dotnet/arcade build 20190…

    …703.19 (#320)
    
    - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19353.19
    dotnet-maestro[bot] authored Jul 4, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    cc1edc4 View commit details

Commits on Jul 5, 2019

  1. Update dependencies from https://github.com/dotnet/arcade build 20190…

    …704.2 (#321)
    
    - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19354.2
    dotnet-maestro[bot] authored Jul 5, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3df47f4 View commit details

Commits on Jul 6, 2019

  1. Update dependencies from https://github.com/dotnet/arcade build 20190…

    …705.2 (#323)
    
    - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19355.2
    dotnet-maestro[bot] authored Jul 6, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f1a5782 View commit details

Commits on Jul 7, 2019

  1. Update dependencies from https://github.com/dotnet/arcade build 20190…

    …706.1 (#325)
    
    - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19356.1
    dotnet-maestro[bot] authored Jul 7, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1d0d32b View commit details

Commits on Jul 8, 2019

  1. Update dependencies from https://github.com/dotnet/arcade build 20190…

    …708.1 (#326)
    
    - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19358.1
    dotnet-maestro[bot] authored Jul 8, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    25fa48b View commit details

Commits on Jul 9, 2019

  1. Update dependencies from https://github.com/dotnet/arcade build 20190…

    …709.1 (#329)
    
    - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19359.1
    dotnet-maestro[bot] authored Jul 9, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    7353333 View commit details

Commits on Jul 10, 2019

  1. Check if file needs to be rebuilt before writing it (#333)

    * Check if file needs to be reubilt before writing it
    
    * feedback
    jkotalik authored and tmat committed Jul 10, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ad7ef66 View commit details
  2. Update dependencies from https://github.com/dotnet/arcade build 20190…

    …709.6 (#335)
    
    - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19359.6
    dotnet-maestro[bot] authored Jul 10, 2019
    Copy the full SHA
    c2c3def View commit details

Commits on Jul 11, 2019

  1. Update dependencies from https://github.com/dotnet/arcade build 20190…

    …710.8 (#336)
    
    - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19360.8
    dotnet-maestro[bot] authored Jul 11, 2019
    Copy the full SHA
    9eb74d1 View commit details

Commits on Jul 12, 2019

  1. Update dependencies from https://github.com/dotnet/arcade build 20190…

    …711.7 (#338)
    
    - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19361.7
    dotnet-maestro[bot] authored Jul 12, 2019
    Copy the full SHA
    441baa2 View commit details

Commits on Jul 13, 2019

  1. Update dependencies from https://github.com/dotnet/arcade build 20190…

    …712.5 (#339)
    
    - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19362.5
    dotnet-maestro[bot] authored Jul 13, 2019
    Copy the full SHA
    6daefb1 View commit details

Commits on Jul 14, 2019

  1. Update dependencies from https://github.com/dotnet/arcade build 20190…

    …713.1 (#340)
    
    - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19363.1
    dotnet-maestro[bot] authored Jul 14, 2019
    Copy the full SHA
    8a6e420 View commit details

Commits on Jul 15, 2019

  1. Update dependencies from https://github.com/dotnet/arcade build 20190…

    …714.1 (#341)
    
    - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19364.1
    dotnet-maestro[bot] authored Jul 15, 2019
    Copy the full SHA
    a9897d9 View commit details

Commits on Jul 16, 2019

  1. Update dependencies from https://github.com/dotnet/arcade build 20190…

    …715.4 (#342)
    
    - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19365.4
    dotnet-maestro[bot] authored Jul 16, 2019
    Copy the full SHA
    0d5f554 View commit details
  2. Copy the full SHA
    8ad71a4 View commit details
  3. Implement packed-refs (#344)

    tmat authored Jul 16, 2019
    Copy the full SHA
    b138bff View commit details
  4. Copy the full SHA
    855afb5 View commit details
Showing with 1,232 additions and 2,071 deletions.
  1. +8 −9 README.md
  2. +2 −2 eng/Version.Details.xml
  3. +3 −4 eng/Versions.props
  4. +1 −1 eng/common/SigningValidation.proj
  5. +77 −0 eng/common/performance/perfhelixpublish.proj
  6. +91 −0 eng/common/performance/performance-setup.ps1
  7. +176 −0 eng/common/performance/performance-setup.sh
  8. +4 −3 eng/common/pipeline-logging-functions.ps1
  9. +3 −3 eng/common/post-build/trigger-subscriptions.ps1
  10. +5 −3 eng/common/sdl/execute-all-sdl-tools.ps1
  11. +7 −5 eng/common/sdl/run-sdl.ps1
  12. +93 −0 eng/common/templates/job/performance.yml
  13. +4 −4 eng/common/templates/post-build/channels/internal-servicing.yml
  14. +1 −0 eng/common/templates/post-build/channels/public-dev-release.yml
  15. +4 −4 eng/common/templates/post-build/channels/public-release.yml
  16. +1 −0 eng/common/templates/post-build/channels/public-validation-release.yml
  17. +3 −0 eng/common/templates/post-build/common-variables.yml
  18. +66 −0 eng/common/templates/steps/perf-send-to-helix.yml
  19. +2 −2 eng/common/tools.ps1
  20. +1 −1 global.json
  21. +0 −129 scripts/RuntimeIdMapGenerator.csx
  22. +0 −1,702 scripts/runtime.json
  23. +13 −4 src/Common/GetSourceLinkUrlGitTask.cs
  24. +39 −0 src/Microsoft.Build.Tasks.Git.UnitTests/GitEnvironmentTests.cs
  25. +133 −0 src/Microsoft.Build.Tasks.Git.UnitTests/GitReferenceResolverTests.cs
  26. +1 −45 src/Microsoft.Build.Tasks.Git.UnitTests/GitRepositoryTests.cs
  27. +1 −0 src/Microsoft.Build.Tasks.Git/GitDataReader/CharUtils.cs
  28. +47 −35 src/Microsoft.Build.Tasks.Git/GitDataReader/GitEnvironment.cs
  29. +240 −0 src/Microsoft.Build.Tasks.Git/GitDataReader/GitReferenceResolver.cs
  30. +14 −102 src/Microsoft.Build.Tasks.Git/GitDataReader/GitRepository.cs
  31. +3 −0 src/Microsoft.Build.Tasks.Git/GitDataReader/PathUtils.cs
  32. +7 −6 src/Microsoft.Build.Tasks.Git/GitOperations.cs
  33. +1 −2 src/Microsoft.Build.Tasks.Git/RepositoryTask.cs
  34. +28 −0 src/SourceLink.Common.UnitTests/GenerateSourceLinkFileTests.cs
  35. +23 −0 src/SourceLink.Common.UnitTests/GetSourceLinkUrlTests.cs
  36. +10 −0 src/SourceLink.Common/GenerateSourceLinkFile.cs
  37. +2 −2 src/SourceLink.Git.IntegrationTests/GitHubTests.cs
  38. +1 −1 { → src/SourceLink.Git.IntegrationTests}/THIRD-PARTY-NOTICES.txt
  39. +114 −0 src/SourceLink.Git.IntegrationTests/VstsAndGitHubTests.cs
  40. +1 −0 src/SourceLink.Vsts.Git/build/Microsoft.SourceLink.Vsts.Git.props
  41. +2 −2 src/TestUtilities/DotNetSdk/DotNetSdkTestBase.cs
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -52,7 +52,7 @@ For projects hosted by [GitHub](http://github.com) or [GitHub Enterprise](https:

```xml
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-19324-01" PrivateAssets="All"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-19351-01" PrivateAssets="All"/>
</ItemGroup>
```

@@ -62,7 +62,7 @@ For projects hosted by [Azure DevOps](https://www.visualstudio.com/team-services

```xml
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.Vsts.Git" Version="1.0.0-beta2-19324-01" PrivateAssets="All"/>
<PackageReference Include="Microsoft.SourceLink.Vsts.Git" Version="1.0.0-beta2-19351-01" PrivateAssets="All"/>
</ItemGroup>
```

@@ -73,7 +73,7 @@ For projects hosted by on-prem [Team Foundation Server](https://visualstudio.mic

```xml
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.Tfs.Git" Version="1.0.0-beta2-19324-01" PrivateAssets="All"/>
<PackageReference Include="Microsoft.SourceLink.Tfs.Git" Version="1.0.0-beta2-19351-01" PrivateAssets="All"/>
<SourceLinkTfsGitHost Include="tfs-server-name" VirtualDirectory="tfs"/>
</ItemGroup>
```
@@ -86,7 +86,7 @@ For projects hosted by [GitLab](https://gitlab.com) reference [Microsoft.SourceL

```xml
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitLab" Version="1.0.0-beta2-19324-01" PrivateAssets="All"/>
<PackageReference Include="Microsoft.SourceLink.GitLab" Version="1.0.0-beta2-19351-01" PrivateAssets="All"/>
</ItemGroup>
```

@@ -96,7 +96,7 @@ For projects in git repositories hosted on [Bitbucket.org](https://bitbucket.org

```xml
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.Bitbucket.Git" Version="1.0.0-beta2-19324-01" PrivateAssets="All"/>
<PackageReference Include="Microsoft.SourceLink.Bitbucket.Git" Version="1.0.0-beta2-19351-01" PrivateAssets="All"/>
</ItemGroup>
```

@@ -123,9 +123,9 @@ To add Source Link support to your native project add package references corresp

```xml
<packages>
<package id="Microsoft.Build.Tasks.Git" version="1.0.0-beta2-19324-01" targetFramework="native" developmentDependency="true" />
<package id="Microsoft.SourceLink.Common" version="1.0.0-beta2-19324-01" targetFramework="native" developmentDependency="true" />
<package id="Microsoft.SourceLink.GitHub" version="1.0.0-beta2-19324-01" targetFramework="native" developmentDependency="true" />
<package id="Microsoft.Build.Tasks.Git" version="1.0.0-beta2-19351-01" targetFramework="native" developmentDependency="true" />
<package id="Microsoft.SourceLink.Common" version="1.0.0-beta2-19351-01" targetFramework="native" developmentDependency="true" />
<package id="Microsoft.SourceLink.GitHub" version="1.0.0-beta2-19351-01" targetFramework="native" developmentDependency="true" />
</packages>
```

@@ -154,7 +154,6 @@ The VC++ linker supports `/SOURCELINK` [switch](https://docs.microsoft.com/en-us
## Known issues

- `EmbedUntrackedSources` does not work in Visual Basic projects that use .NET SDK: https://github.com/dotnet/sourcelink/issues/193 (fixed in Visual Studio 2019)
- Various build issues on Mono: https://github.com/dotnet/sourcelink/issues/155
- Issues with WPF projects when building with `/p:ContinuousIntegrationBuild=true`: https://github.com/dotnet/sourcelink/issues/91

## Alternative PDB distribution
4 changes: 2 additions & 2 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
@@ -3,9 +3,9 @@
<ProductDependencies>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.19330.1">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.19365.4">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>89fab80685c91024c8f9e21f1c37f62580f648f8</Sha>
<Sha>fb27fd4d8a2b67d4333e33d4b898c65171c9f3c1</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
7 changes: 3 additions & 4 deletions eng/Versions.props
Original file line number Diff line number Diff line change
@@ -7,8 +7,7 @@
<SemanticVersioningV1>true</SemanticVersioningV1>
<!-- Opt-in repo features -->
<UsingToolNetFrameworkReferenceAssemblies>true</UsingToolNetFrameworkReferenceAssemblies>
<!-- TODO: enable when we switch to snupkgs
<UsingToolSymbolUploader>true</UsingToolSymbolUploader> -->
<UsingToolSymbolUploader>true</UsingToolSymbolUploader>
<XUnitVersion>2.4.1</XUnitVersion>
<!--
MSBuild: Keep the version at 15.7 until we can target net472.
@@ -18,12 +17,12 @@
-->
<MicrosoftBuildVersion>15.7.179</MicrosoftBuildVersion>
<MicrosoftBuildTasksCore>15.7.179</MicrosoftBuildTasksCore>
<!-- Libs -->
<LibGit2SharpVersion>0.26.0-preview-0070</LibGit2SharpVersion>
<MicrosoftTeamFoundationServerExtendedClientVersion>15.112.1</MicrosoftTeamFoundationServerExtendedClientVersion>
<MicrosoftDotNetPlatformAbstractionsVersion>2.1.0</MicrosoftDotNetPlatformAbstractionsVersion>
<NuGetVersioningVersion>4.9.2</NuGetVersioningVersion>
<MicrosoftSourceLinkVersion>1.0.0-beta2-19322-03</MicrosoftSourceLinkVersion>
<SystemValueTupleVersion>4.5.0</SystemValueTupleVersion>
<!-- libgit2 used for integration tests -->
<LibGit2SharpVersion>0.26.0-preview-0070</LibGit2SharpVersion>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion eng/common/SigningValidation.proj
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
<!--
This MSBuild file is intended to be used as the body of the default
publishing release pipeline. The release pipeline will use this file
to invoke the the SignCheck tool to validate that packages about to
to invoke the SignCheck tool to validate that packages about to
be published are correctly signed.
Parameters:
77 changes: 77 additions & 0 deletions eng/common/performance/perfhelixpublish.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<Project Sdk="Microsoft.DotNet.Helix.Sdk" DefaultTargets="Test">

<PropertyGroup Condition="'$(AGENT_OS)' == 'Windows_NT'">
<WorkItemCommand>%HELIX_CORRELATION_PAYLOAD%\performance\scripts\benchmarks_ci.py --csproj %HELIX_CORRELATION_PAYLOAD%\performance\$(TargetCsproj)</WorkItemCommand>
<CliArguments>--dotnet-versions %DOTNET_VERSION% --cli-source-info args --cli-branch %PERFLAB_BRANCH% --cli-commit-sha %PERFLAB_HASH% --cli-repository https://github.com/%PERFLAB_REPO% --cli-source-timestamp %PERFLAB_BUILDTIMESTAMP%</CliArguments>
<Python>py -3</Python>
<CoreRun>%HELIX_CORRELATION_PAYLOAD%\Core_Root\CoreRun.exe</CoreRun>
<HelixPreCommands>$(HelixPreCommands);call %HELIX_CORRELATION_PAYLOAD%\performance\tools\machine-setup.cmd</HelixPreCommands>
<ArtifactsDirectory>%HELIX_CORRELATION_PAYLOAD%\artifacts\BenchmarkDotNet.Artifacts</ArtifactsDirectory>
</PropertyGroup>

<PropertyGroup Condition="'$(AGENT_OS)' != 'Windows_NT' and '$(RunFromPerfRepo)' == 'false'">
<BaseDirectory>$HELIX_CORRELATION_PAYLOAD</BaseDirectory>
<PerformanceDirectory>$(BaseDirectory)/performance</PerformanceDirectory>
</PropertyGroup>

<PropertyGroup Condition="'$(AGENT_OS)' != 'Windows_NT' and '$(RunFromPerfRepo)' == 'true'">
<BaseDirectory>$HELIX_WORKITEM_PAYLOAD</BaseDirectory>
<PerformanceDirectory>$(BaseDirectory)</PerformanceDirectory>
</PropertyGroup>

<PropertyGroup Condition="'$(AGENT_OS)' != 'Windows_NT'">
<WorkItemCommand>$(PerformanceDirectory)/scripts/benchmarks_ci.py --csproj $(PerformanceDirectory)/$(TargetCsproj)</WorkItemCommand>
<CliArguments>--dotnet-versions $DOTNET_VERSION --cli-source-info args --cli-branch $PERFLAB_BRANCH --cli-commit-sha $PERFLAB_HASH --cli-repository https://github.com/$PERFLAB_REPO --cli-source-timestamp $PERFLAB_BUILDTIMESTAMP</CliArguments>
<Python>python3</Python>
<CoreRun>$(BaseDirectory)/Core_Root/corerun</CoreRun>
<HelixPreCommands>$(HelixPreCommands);chmod +x $(PerformanceDirectory)/tools/machine-setup.sh;. $(PerformanceDirectory)/tools/machine-setup.sh</HelixPreCommands>
<ArtifactsDirectory>$(BaseDirectory)/artifacts/BenchmarkDotNet.Artifacts</ArtifactsDirectory>
</PropertyGroup>

<PropertyGroup Condition="'$(UseCoreRun)' == 'true'">
<CoreRunArgument>--corerun $(CoreRun)</CoreRunArgument>
</PropertyGroup>

<PropertyGroup Condition="'$(WorkItemCommand)' != ''">
<WorkItemCommand>$(Python) $(WorkItemCommand) --incremental no --architecture $(Architecture) -f $(_Framework) $(PerfLabArguments)</WorkItemCommand>
</PropertyGroup>

<PropertyGroup Condition="'$(_Framework)' != 'net461'">
<WorkItemCommand>$(WorkItemCommand) $(CliArguments)</WorkItemCommand>
</PropertyGroup>

<ItemGroup>
<HelixCorrelationPayload Include="$(CorrelationPayloadDirectory)">
<PayloadDirectory>%(Identity)</PayloadDirectory>
</HelixCorrelationPayload>
</ItemGroup>

<PropertyGroup>
<PartitionCount>5</PartitionCount>
</PropertyGroup>
<ItemGroup>
<Partition Include="$(BuildConfig).Partition0" Index="0" />
<Partition Include="$(BuildConfig).Partition1" Index="1" />
<Partition Include="$(BuildConfig).Partition2" Index="2" />
<Partition Include="$(BuildConfig).Partition3" Index="3" />
<Partition Include="$(BuildConfig).Partition4" Index="4" />
</ItemGroup>

<!--
Partition the Microbenchmarks project, but nothing else
-->
<ItemGroup Condition="$(TargetCsproj.Contains('MicroBenchmarks.csproj'))">
<HelixWorkItem Include="@(Partition)">
<PayloadDirectory>$(WorkItemDirectory)</PayloadDirectory>
<Command>$(WorkItemCommand) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(CoreRunArgument) --artifacts $(ArtifactsDirectory) --partition-count $(PartitionCount) --partition-index %(HelixWorkItem.Index)"</Command>
<Timeout>4:00</Timeout>
</HelixWorkItem>
</ItemGroup>
<ItemGroup Condition="!$(TargetCsproj.Contains('MicroBenchmarks.csproj'))">
<HelixWorkItem Include="$(BuildConfig).WorkItem">
<PayloadDirectory>$(WorkItemDirectory)</PayloadDirectory>
<Command>$(WorkItemCommand) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(CoreRunArgument) --artifacts $(ArtifactsDirectory)"</Command>
<Timeout>4:00</Timeout>
</HelixWorkItem>
</ItemGroup>
</Project>
91 changes: 91 additions & 0 deletions eng/common/performance/performance-setup.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
Param(
[string] $SourceDirectory=$env:BUILD_SOURCESDIRECTORY,
[string] $CoreRootDirectory,
[string] $Architecture="x64",
[string] $Framework="netcoreapp3.0",
[string] $CompilationMode="Tiered",
[string] $Repository=$env:BUILD_REPOSITORY_NAME,
[string] $Branch=$env:BUILD_SOURCEBRANCH,
[string] $CommitSha=$env:BUILD_SOURCEVERSION,
[string] $BuildNumber=$env:BUILD_BUILDNUMBER,
[string] $RunCategories="coreclr corefx",
[string] $Csproj="src\benchmarks\micro\MicroBenchmarks.csproj",
[string] $Kind="micro",
[switch] $Internal,
[string] $Configurations="CompilationMode=$CompilationMode"
)

$RunFromPerformanceRepo = ($Repository -eq "dotnet/performance")
$UseCoreRun = ($CoreRootDirectory -ne [string]::Empty)

$PayloadDirectory = (Join-Path $SourceDirectory "Payload")
$PerformanceDirectory = (Join-Path $PayloadDirectory "performance")
$WorkItemDirectory = (Join-Path $SourceDirectory "workitem")
$ExtraBenchmarkDotNetArguments = "--iterationCount 1 --warmupCount 0 --invocationCount 1 --unrollFactor 1 --strategy ColdStart --stopOnFirstError true"
$Creator = $env:BUILD_DEFINITIONNAME
$PerfLabArguments = ""
$HelixSourcePrefix = "pr"

$Queue = "Windows.10.Amd64.ClientRS4.DevEx.15.8.Open"

if ($Framework.StartsWith("netcoreapp")) {
$Queue = "Windows.10.Amd64.ClientRS4.Open"
}

if ($Internal) {
$Queue = "Windows.10.Amd64.ClientRS5.Perf"
$PerfLabArguments = "--upload-to-perflab-container"
$ExtraBenchmarkDotNetArguments = ""
$Creator = ""
$HelixSourcePrefix = "official"
}

$CommonSetupArguments="--frameworks $Framework --queue $Queue --build-number $BuildNumber --build-configs $Configurations"
$SetupArguments = "--repository https://github.com/$Repository --branch $Branch --get-perf-hash --commit-sha $CommitSha $CommonSetupArguments"

if ($RunFromPerformanceRepo) {
$SetupArguments = "--perf-hash $CommitSha $CommonSetupArguments"

robocopy $SourceDirectory $PerformanceDirectory /E /XD $PayloadDirectory $SourceDirectory\artifacts $SourceDirectory\.git
}
else {
git clone --branch master --depth 1 --quiet https://github.com/dotnet/performance $PerformanceDirectory
}

if ($UseCoreRun) {
$NewCoreRoot = (Join-Path $PayloadDirectory "Core_Root")
Move-Item -Path $CoreRootDirectory -Destination $NewCoreRoot
}

$DocsDir = (Join-Path $PerformanceDirectory "docs")
robocopy $DocsDir $WorkItemDirectory

# Set variables that we will need to have in future steps
$ci = $true

. "$PSScriptRoot\..\pipeline-logging-functions.ps1"

# Directories
Write-PipelineSetVariable -Name 'PayloadDirectory' -Value "$PayloadDirectory" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'PerformanceDirectory' -Value "$PerformanceDirectory" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'WorkItemDirectory' -Value "$WorkItemDirectory" -IsMultiJobVariable $false

# Script Arguments
Write-PipelineSetVariable -Name 'Python' -Value "py -3" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'ExtraBenchmarkDotNetArguments' -Value "$ExtraBenchmarkDotNetArguments" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'SetupArguments' -Value "$SetupArguments" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'PerfLabArguments' -Value "$PerfLabArguments" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'BDNCategories' -Value "$RunCategories" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'TargetCsproj' -Value "$Csproj" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'Kind' -Value "$Kind" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'Architecture' -Value "$Architecture" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'UseCoreRun' -Value "$UseCoreRun" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'RunFromPerfRepo' -Value "$RunFromPerformanceRepo" -IsMultiJobVariable $false

# Helix Arguments
Write-PipelineSetVariable -Name 'Creator' -Value "$Creator" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'Queue' -Value "$Queue" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'HelixSourcePrefix' -Value "$HelixSourcePrefix" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name '_BuildConfig' -Value "$Architecture.$Kind.$Framework" -IsMultiJobVariable $false

exit 0
Loading