提交 1ba7c86a 编写于 作者: J Jeremy Koritzinsky 提交者: GitHub

Restore IBCMerge using an authenticated service connection (dotnet/coreclr#24284)

* Add separate build steps to do the IBCMerge restore.

* Attempt 1 to get config picked up.

* Attempt 2 getting ibcmerge restore working.

* Fix invalid MSBuild syntax.

* Fix getting IBC package version.


Commit migrated from https://github.com/dotnet/coreclr/commit/9cf8b4b5c7d43c4352823ad57493dc91640a4fe2
上级 b828ad59
......@@ -101,6 +101,26 @@ jobs:
- script: eng\common\init-tools-native.cmd -InstallDirectory $(Build.SourcesDirectory)\native-tools -Force
displayName: Install native dependencies
# Install internal tools on official builds
# Since our internal tools are behind an authenticated feed,
# we need to use the DotNetCli AzDO task to restore from the feed using a service connection.
# We can't do this from within the build, so we need to do this as a separate step.
- ${{ if and(and(eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')), eq(parameters.osGroup, 'Windows_NT')) }}:
- task: DotNetCoreInstaller@0
inputs:
packageType: 'sdk'
version: '2.1.503'
- task: DotNetCoreCLI@2
displayName: Restore internal tools
inputs:
command: restore
feedsToUse: config
projects: 'src/.nuget/optdata/ibcmerge.csproj'
nugetConfigPath: 'eng/internal/NuGet.config'
restoreDirectory: '$(Build.SourcesDirectory)\packages'
verbosityRestore: 'normal'
externalFeedCredentials: 'dotnet-core-internal-tooling'
# Build
- ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
- script: ./build.sh $(buildConfig) $(archType) $(crossArg) -skiptests -skipnuget $(clangArg) $(stripSymbolsArg) $(officialBuildIdArg)
......
......@@ -670,11 +670,7 @@ if %__BuildCoreLib% EQU 1 (
for /f "tokens=*" %%s in ('call "%__ProjectDir%\dotnet.cmd" msbuild "!IbcMergeProjectFilePath!" /t:DumpIbcMergePackageVersion /nologo') do @(
set __IbcMergeVersion=%%s
)
echo Restoring IBCMerge version !__IbcMergeVersion!...
echo Running: %__ProjectDir%\dotnet.cmd restore src/.nuget/optdata/ibcmerge.csproj --no-cache --packages "%__PackagesDir%" --source "https://devdiv.pkgs.visualstudio.com/_packaging/dotnet-core-internal-tooling/nuget/v3/index.json"
call %__ProjectDir%\dotnet.cmd restore src/.nuget/optdata/ibcmerge.csproj --no-cache --packages "%__PackagesDir%" --source "https://devdiv.pkgs.visualstudio.com/_packaging/dotnet-core-internal-tooling/nuget/v3/index.json"
set IbcMergePath=%__PackagesDir%\microsoft.dotnet.ibcmerge\!__IbcMergeVersion!\tools\netcoreapp2.0\ibcmerge.dll
if exist !IbcMergePath! (
echo %__MsgPrefix%Optimizing using IBC training data
......@@ -754,7 +750,7 @@ if %__BuildCoreLib% EQU 1 (
goto CrossgenFailure
)
) else (
echo Could not find IBCMerge at !IbcMergePath!
echo Could not find IBCMerge at !IbcMergePath!. Have you restored src/.nuget/optdata/ibcmerge.csproj?
goto CrossgenFailure
)
)
......
......@@ -9,11 +9,16 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="microsoft.dotnet.ibcmerge" Version="$(IbcMergePackageVersion)" Condition="'$(IbcMergePackageVersion)'!=''" />
<PackageReference Include="microsoft.dotnet.ibcmerge" Version="[$(IbcMergePackageVersion)]" Condition="'$(IbcMergePackageVersion)'!=''" />
</ItemGroup>
<Target Name="DumpIbcMergePackageVersion">
<Message Importance="high" Text="$(IbcMergePackageVersion)" />
</Target>
<PropertyGroup>
<RestoreSources>
https://devdiv.pkgs.visualstudio.com/_packaging/dotnet-core-internal-tooling/nuget/v3/index.json;
</RestoreSources>
</PropertyGroup>
</Project>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册