Skip to content

Commit

Permalink
Use RepoTools instead of global tools (dotnet/corefx#37858)
Browse files Browse the repository at this point in the history
Commit migrated from dotnet/corefx@58c30f7
  • Loading branch information
ViktorHofer authored May 23, 2019
1 parent fe30cd4 commit a671100
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 43 deletions.
18 changes: 18 additions & 0 deletions eng/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"version": 1,
"isRoot": true,
"tools": {
"coverlet.console": {
"version": "1.5.1",
"commands": [
"coverlet"
]
},
"dotnet-reportgenerator-globaltool": {
"version": "4.1.6",
"commands": [
"reportgenerator"
]
}
}
}
55 changes: 12 additions & 43 deletions eng/sendtohelix.proj
Original file line number Diff line number Diff line change
Expand Up @@ -50,72 +50,40 @@
<HelixCommand>$(HelixCommand) /p:LocalPackagesPath="%HELIX_CORRELATION_PAYLOAD%\packages\</HelixCommand>
</PropertyGroup>

<!-- Define which workloads require global tools. -->
<PropertyGroup Condition="'$(UseGlobalTools)' == ''">
<UseGlobalTools Condition="'$(Coverage)' == 'true'">true</UseGlobalTools>
</PropertyGroup>

<PropertyGroup Condition="'$(HelixCommand)' == '' and '$(TargetsWindows)' == 'true'">
<PropertyGroup Condition="'$(HelixCommand)' == ''">
<!--
For windows we need to use call, since the command is going to be called from a bat script created by Helix
and we exit /b at the end of RunTests.cmd, Helix runs some other commands after ours within the bat script,
if we don't use call, then we cause the parent script to exit, and anything after will not be executed.
-->
<HelixCommand>call RunTests.cmd --runtime-path %HELIX_CORRELATION_PAYLOAD% --dotnet-root %HELIX_CORRELATION_PAYLOAD%</HelixCommand>
<HelixCommand Condition="'$(UseGlobalTools)' == 'true'">$(HelixCommand) --global-tools-dir "%HELIX_CORRELATION_PAYLOAD%\tools"</HelixCommand>
</PropertyGroup>

<PropertyGroup Condition="'$(HelixCommand)' == '' and '$(TargetsWindows)' != 'true'">
<HelixCommand>./RunTests.sh --runtime-path "$HELIX_CORRELATION_PAYLOAD" --dotnet-root "$HELIX_CORRELATION_PAYLOAD"</HelixCommand>
<HelixCommand Condition="'$(UseGlobalTools)' == 'true'">$(HelixCommand) --global-tools-dir "$HELIX_CORRELATION_PAYLOAD/tools"</HelixCommand>
<HelixCommand Condition="'$(TargetsWindows)' == 'true'">call RunTests.cmd --runtime-path %HELIX_CORRELATION_PAYLOAD% --dotnet-root %HELIX_CORRELATION_PAYLOAD%</HelixCommand>
<HelixCommand Condition="'$(TargetsWindows)' != 'true'">./RunTests.sh --runtime-path "$HELIX_CORRELATION_PAYLOAD" --dotnet-root "$HELIX_CORRELATION_PAYLOAD"</HelixCommand>
</PropertyGroup>

<!-- We need to include all dlls in the runtime path as inputs to make it really incremental
if we use the root folder, if a dll is updated, the folder's timestamp is not updated, therefore skipped. -->
<!--
We need to include all dlls in the runtime path as inputs to make it really incremental if we use the root folder,
if a dll is updated, the folder's timestamp is not updated, therefore skipped.
-->
<ItemGroup>
<_RuntimeInputs Include="$(TestHostRootPath)**/*.dll" />
</ItemGroup>

<!-- Add global tools to runtime -->
<ItemGroup Condition="'$(UseGlobalTools)' == 'true'">
<TestArchiveRuntimeDependency Include="$(DotNetRoot)shared\Microsoft.NETCore.App\**\*.*" DestinationDir="shared\Microsoft.NETCore.App" />
<TestArchiveRuntimeDependency Include="$(DotNetRoot)host\**\*.*" DestinationDir="host" />
<TestArchiveRuntimeDependency Include="$(GlobalToolsDir)**\*.*" DestinationDir="tools" />
</ItemGroup>

<Target Name="CompressRuntimeDirectory"
Inputs="@(_RuntimeInputs);@(TestArchiveRuntimeDependency)"
Outputs="$(TestArchiveRuntimeFile)"
Condition="'$(TargetGroup)' != 'AllConfigurations'">

<!-- Copy additional test dependencies. -->
<ItemGroup>
<_TestArchiveRuntimeDependency Include="@(TestArchiveRuntimeDependency)">
<DestinationDir>%(TestArchiveRuntimeDependency.DestinationDir)\%(RecursiveDir)</DestinationDir>
</_TestArchiveRuntimeDependency>
</ItemGroup>

<Copy SourceFiles="@(_TestArchiveRuntimeDependency)"
DestinationFiles="@(_TestArchiveRuntimeDependency -> '$([MSBuild]::NormalizePath('$(TestHostRootPath)', '%(DestinationDir)', '%(Filename)%(Extension)'))')"
SkipUnchangedFiles="true"
OverwriteReadOnlyFiles="true"
Retries="3"
RetryDelayMilliseconds="300">
<Output TaskParameter="DestinationFiles" ItemName="FileWrites" />
</Copy>

<MakeDir Directories="$(TestArchiveRuntimeRoot)" />
<ZipDirectory
SourceDirectory="$(TestHostRootPath)"
DestinationFile="$(TestArchiveRuntimeFile)"
Overwrite="true" />
<ZipDirectory SourceDirectory="$(TestHostRootPath)"
DestinationFile="$(TestArchiveRuntimeFile)"
Overwrite="true" />

</Target>

<Target Name="BuildHelixWorkItems"
DependsOnTargets="CompressRuntimeDirectory">
<ItemGroup>

<ItemGroup>
<HelixCorrelationPayload Include="$(HelixCorrelationPayload)" />

<_WorkItem Include="$(WorkItemArchiveWildCard)" Exclude="$(HelixCorrelationPayload)" />
Expand All @@ -126,5 +94,6 @@
<Timeout>$(_timeoutSpan)</Timeout>
</HelixWorkItem>
</ItemGroup>

</Target>
</Project>

0 comments on commit a671100

Please sign in to comment.