* 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.
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
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
)
)
- 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)
--- /dev/null
+<configuration>
+ <!-- Don't use any higher level config files.
+ Our builds need to be isolated from user/machine state -->
+ <fallbackPackageFolders>
+ <clear />
+ </fallbackPackageFolders>
+ <packageSources>
+ <clear/>
+ <add key="dotnet-core-internal-tooling" value="https://devdiv.pkgs.visualstudio.com/_packaging/dotnet-core-internal-tooling/nuget/v3/index.json" />
+ </packageSources>
+ <disabledPackageSources>
+ <clear />
+ </disabledPackageSources>
+</configuration>
</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>