enable Microsoft.DiaSymReader* packages to be overridden during build

This commit is contained in:
Brett V. Forsgren 2018-02-05 12:54:07 -08:00
Родитель 316976ec39
Коммит e13a0584ac
5 изменённых файлов: 80 добавлений и 2 удалений

Просмотреть файл

@ -605,6 +605,27 @@ if "%RestorePackages%" == "true" (
call %~dp0init-tools.cmd
echo ----------- Done with package restore, starting dependency uptake check -------------
if not "%PB_PackageVersionPropsUrl%" == "" (
set dependencyUptakeDir=%~dp0Tools\dependencyUptake
if not exist "!dependencyUptakeDir!" mkdir "!dependencyUptakeDir!"
:: download package version overrides
echo powershell -noprofile -executionPolicy RemoteSigned -command "Invoke-WebRequest -Uri '%PB_PackageVersionPropsUrl%' -OutFile '!dependencyUptakeDir!\PackageVersions.props'"
powershell -noprofile -executionPolicy RemoteSigned -command "Invoke-WebRequest -Uri '%PB_PackageVersionPropsUrl%' -OutFile '!dependencyUptakeDir!\PackageVersions.props'"
if ERRORLEVEL 1 echo Error downloading package version properties && goto :failure
:: prepare dependency uptake files
echo %_msbuildexe% %msbuildflags% %~dp0build\projects\PrepareDependencyUptake.proj /t:Build
%_msbuildexe% %msbuildflags% %~dp0build\projects\PrepareDependencyUptake.proj /t:Build
if ERRORLEVEL 1 echo Error building dependency uptake files && goto :failure
:: restore dependencies
%_nugetexe% restore !dependencyUptakeDir!\packages.config -PackagesDirectory packages -ConfigFile !dependencyUptakeDir!\NuGet.config
if ERRORLEVEL 1 echo Error restoring dependency uptake packages && goto :failure
)
set _dotnetcliexe=%~dp0Tools\dotnetcli\dotnet.exe
set _dotnet20exe=%~dp0Tools\dotnet20\dotnet.exe
set NUGET_PACKAGES=%~dp0Packages

Просмотреть файл

@ -486,6 +486,22 @@ fi
# TODO: Check for existence of fsi (either on the system, or from the FSharp.Compiler.Tools package that was restored).
build_status "Done with package restore, starting dependency uptake check"
if [ "$PB_PACKAGEVERSIONPROPSURL" != "" ]; then
dependencyUptakeDir="${_scriptdir}Tools/dependencyUptake"
mkdir -p "$dependencyUptakeDir"
# download package version overrides
{ printeval "curl '$PB_PACKAGEVERSIONPROPSURL' -o '$dependencyUptakeDir/PackageVersions.props'"; } || failwith "downloading package version properties failed"
# prepare dependency uptake files
{ printeval "$_msbuildexe $msbuildflags ${scriptdir}build/projects/PrepareDependencyUptake.proj /t:Build"; } || failwith "building dependency uptake files failed"
# restore dependencies
{ printeval "$_nugetexe restore '$dependencyUptakeDir/packages.config' -PackagesDirectory packages -ConfigFile '$dependencyUptakeDir/NuGet.config'"; } || failwith "restoring dependency uptake packages failed"
fi
build_status "Done with package restore, starting proto"
# Decide if Proto need building

Просмотреть файл

@ -0,0 +1,35 @@
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<DependencyUptakeDirectory>$(MSBuildThisFileDirectory)..\..\Tools\dependencyUptake</DependencyUptakeDirectory>
<PackageVersionsPropsFile>$(DependencyUptakeDirectory)\PackageVersions.props</PackageVersionsPropsFile>
<PackagesConfigFile>$(DependencyUptakeDirectory)\packages.config</PackagesConfigFile>
<NuGetConfigFile>$(DependencyUptakeDirectory)\NuGet.config</NuGetConfigFile>
</PropertyGroup>
<Import Project="$(PackageVersionsPropsFile)" />
<!-- Prepare a dummy packages.config -->
<ItemGroup>
<PackagesConfigLines Include="&lt;packages&gt;" />
<PackagesConfigLines Include=" &lt;package id=&quot;Microsoft.DiaSymReader&quot; version=&quot;$(MicrosoftDiaSymReaderPackageVersion)&quot; /&gt;" />
<PackagesConfigLines Include=" &lt;package id=&quot;Microsoft.DiaSymReader.PortablePdb&quot; version=&quot;$(MicrosoftDiaSymReaderPortablePdbPackageVersion)&quot; /&gt;" />
<PackagesConfigLines Include="&lt;/packages&gt;" />
</ItemGroup>
<!-- Prepare a dummy NuGet.config -->
<ItemGroup>
<NuGetConfigLines Include="&lt;configuration&gt;" />
<NuGetConfigLines Include=" &lt;packageSources&gt;" />
<NuGetConfigLines Include=" &lt;clear /&gt;" />
<NuGetConfigLines Include=" &lt;add key=&quot;dependency-uptake&quot; value=&quot;$(PB_RestoreSource)&quot; /&gt;" />
<NuGetConfigLines Include=" &lt;/packageSources&gt;" />
<NuGetConfigLines Include="&lt;/configuration&gt;" />
</ItemGroup>
<Target Name="Build">
<WriteLinesToFile File="$(PackagesConfigFile)" Lines="@(PackagesConfigLines)" Overwrite="true" />
<WriteLinesToFile File="$(NuGetConfigFile)" Lines="@(NuGetConfigLines)" Overwrite="true" />
</Target>
</Project>

Просмотреть файл

@ -82,6 +82,9 @@
<MicrosoftVisualStudioThreadingVersion>15.3.23</MicrosoftVisualStudioThreadingVersion>
<MicrosoftVisualStudioValidationVersion>15.3.15</MicrosoftVisualStudioValidationVersion>
<MicrosoftDiaSymReaderPackageVersion>1.1.0</MicrosoftDiaSymReaderPackageVersion>
<MicrosoftDiaSymReaderPortablePdbPackageVersion>1.2.0</MicrosoftDiaSymReaderPortablePdbPackageVersion>
<!-- Frozen FSharp.Core package being built with this build -->
<FSharpCore41TargetPackageVersion>4.1.19</FSharpCore41TargetPackageVersion>
<FSharpCore41TargetMajorVersion>4.1</FSharpCore41TargetMajorVersion>
@ -99,6 +102,7 @@
<NUnitLibDir>$(FSharpSourcesRoot)\..\packages\NUnit.$(NUnitVersion)\lib\net45</NUnitLibDir>
<NUnitToolsLibDir>$(FSharpSourcesRoot)\..\packages\NUnit.ConsoleRunner\$(NUnitVersion)\tools\</NUnitToolsLibDir>
<DependencyUptakePackageVersionPropsFile>$(MSBuildThisFileDirectory)..\Tools\dependencyUptake\PackageVersions.props</DependencyUptakePackageVersionPropsFile>
<!-- Localization -->
<UpdateXlfOnBuild Condition="'$(CI)' != '1'">true</UpdateXlfOnBuild>
@ -106,6 +110,8 @@
</PropertyGroup>
<Import Project="$(DependencyUptakePackageVersionPropsFile)" Condition="Exists('$(DependencyUptakePackageVersionPropsFile)')" />
<PropertyGroup Condition="'$(MicroBuildAssemblyFileLanguage)' == ''">
<MicroBuildAssemblyFileLanguage>fs</MicroBuildAssemblyFileLanguage>
</PropertyGroup>

Просмотреть файл

@ -671,10 +671,10 @@
<Reference Include="System.Numerics" />
<Reference Include="ISymWrapper, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.DiaSymReader.PortablePdb">
<HintPath>..\..\..\packages\Microsoft.DiaSymReader.PortablePdb.1.2.0\lib\portable-net45+win8\Microsoft.DiaSymReader.PortablePdb.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.DiaSymReader.PortablePdb.$(MicrosoftDiaSymReaderPortablePdbPackageVersion)\lib\netstandard1.1\Microsoft.DiaSymReader.PortablePdb.dll</HintPath>
</Reference>
<Reference Include="Microsoft.DiaSymReader">
<HintPath>..\..\..\packages\Microsoft.DiaSymReader.1.1.0\lib\portable-net45+win8\Microsoft.DiaSymReader.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.DiaSymReader.$(MicrosoftDiaSymReaderPackageVersion)\lib\netstandard1.1\Microsoft.DiaSymReader.dll</HintPath>
</Reference>
<Reference Include="System.Reflection.Metadata">
<HintPath>..\..\..\packages\System.Reflection.Metadata.1.4.2\lib\portable-net45+win8\System.Reflection.Metadata.dll</HintPath>