Add targets and tools for ensuring consistent package versions between servicing builds
This commit is contained in:
parent
a3baf40c74
commit
59ed8df382
|
|
@ -34,5 +34,13 @@
|
|||
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<StandardTestTfms>netcoreapp2.1;net461</StandardTestTfms>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="eng\Dependencies.props" />
|
||||
<Import Project="eng\PatchConfig.props" />
|
||||
<Import Project="eng\ProjectReferences.props" />
|
||||
<Import Project="eng\targets\Wix.Common.props" Condition="'$(MSBuildProjectExtension)' == '.wixproj'" />
|
||||
<Import Project="eng\targets\CSharp.Common.props" Condition="'$(MSBuildProjectExtension)' == '.csproj'" />
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,39 @@
|
|||
<Project>
|
||||
<!-- Properties which should be set after the project has been evaluated -->
|
||||
<PropertyGroup Condition=" '$(MSBuildProjectExtension)' == '.csproj' ">
|
||||
<PackageId Condition=" '$(PackageId)' == '' ">$(AssemblyName)</PackageId>
|
||||
<IsPackable Condition="'$(IsPackable)' == '' AND ( '$(IsTestProject)' == 'true' OR '$(IsTestAssetProject)' == 'true' OR '$(IsBenchmarkProject)' == 'true' OR '$(IsSampleProject)' == 'true' ) ">false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="eng\Baseline.props" />
|
||||
|
||||
<PropertyGroup Condition=" '$(IsPackable)' != 'false' AND '$(AspNetCorePatchVersion)' != '0' ">
|
||||
<!-- Always include framework metapackages in patch updates. -->
|
||||
<IsPackageInThisPatch Condition="'$(IsFrameworkMetapackage)' == 'true'">true</IsPackageInThisPatch>
|
||||
<IsPackageInThisPatch Condition="'$(IsPackageInThisPatch)' == ''">$(PackagesInPatch.Contains(' $(PackageId);'))</IsPackageInThisPatch>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(IsPackable)' != 'false' AND '$(IsServicingBuild)' == 'true' ">
|
||||
<!-- Used to distinguish between packages building -->
|
||||
<IsPackableInNonServicingBuild>true</IsPackableInNonServicingBuild>
|
||||
<!-- Suppress creation of .nupkg for servicing builds. -->
|
||||
<IsPackable Condition=" '$(IsPackageInThisPatch)' != 'true' ">false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(IsPackageInThisPatch)' != 'true' AND '$(BaselinePackageVersion)' != '' ">
|
||||
<!-- This keeps assembly and package versions consistent across patches. If a package is not included in a patch, its version should stay at the baseline. -->
|
||||
<Version>$(BaselinePackageVersion).0</Version>
|
||||
<AssemblyVersion>$(BaselinePackageVersion).0</AssemblyVersion>
|
||||
<PackageVersion>$(BaselinePackageVersion)</PackageVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- Implementation projects are the projects which produce nuget packages or shipping assemblies. -->
|
||||
<IsImplementationProject Condition=" '$(IsImplementationProject)' == '' AND '$(IsTestAssetProject)' != 'true' AND '$(IsTestProject)' != 'true' AND '$(IsBenchmarkProject)' != 'true' AND '$(IsSampleProject)' != 'true' ">true</IsImplementationProject>
|
||||
|
||||
<!-- Suppress KoreBuild warnings about the mismatch of repo version and local project version. The versioning in this mega repo is sufficiently complicated that KoreBuild's validation isn't helpful. -->
|
||||
<VerifyVersion>false</VerifyVersion>
|
||||
|
||||
<EnableApiCheck Condition=" '$(EnableApiCheck)' != '' ">$(IsImplementationProject)</EnableApiCheck>
|
||||
<IsPackable Condition="'$(IsPackable)' == '' AND '$(IsImplementationProject)' == 'true' ">true</IsPackable>
|
||||
<IsPackable Condition="'$(IsPackable)' == '' ">false</IsPackable>
|
||||
|
|
@ -14,4 +44,5 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<Import Project="eng\targets\Wix.Common.targets" Condition="'$(MSBuildProjectExtension)' == '.wixproj'" />
|
||||
<Import Project="eng\targets\CSharp.Common.targets" Condition="'$(MSBuildProjectExtension)' == '.csproj'" />
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<Target Name="_BuildMetapackage" DependsOnTargets="ResolveRepoInfo">
|
||||
<Target Name="_BuildMetapackage" DependsOnTargets="GetProjectArtifactInfo;ResolveRepoInfo">
|
||||
<PropertyGroup>
|
||||
<MetapackageSource>$(_MetapackageSrcRoot)$(MetapackageName)\</MetapackageSource>
|
||||
<MetapackageWorkDirectory>$(_WorkRoot)pkg\$(MetapackageName)\</MetapackageWorkDirectory>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
</ItemDefinitionGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<RepositoryBuildOrder Include="JsonPatch" Order="1" />
|
||||
<RepositoryBuildOrder Include="DotNetTools" Order="1" />
|
||||
<RepositoryBuildOrder Include="HtmlAbstractions" Order="1" />
|
||||
<RepositoryBuildOrder Include="Razor" Order="6" />
|
||||
|
|
@ -30,7 +29,6 @@
|
|||
<RepositoryBuildOrder Include="ServerTests" Order="11" />
|
||||
<RepositoryBuildOrder Include="Diagnostics" Order="12" />
|
||||
<RepositoryBuildOrder Include="Localization" Order="12" />
|
||||
<RepositoryBuildOrder Include="WebSockets" Order="13" RootPath="$(RepositoryRoot)src\WebSockets\" />
|
||||
<RepositoryBuildOrder Include="Security" Order="13" />
|
||||
<RepositoryBuildOrder Include="MetaPackages" Order="13" />
|
||||
<RepositoryBuildOrder Include="Mvc" Order="14" />
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
<!-- Determined by build tools -->
|
||||
<InternalAspNetCoreSdkPackageVersion>$(KoreBuildVersion)</InternalAspNetCoreSdkPackageVersion>
|
||||
<InternalAspNetCoreSiteExtensionSdkPackageVersion>$(KoreBuildVersion)</InternalAspNetCoreSiteExtensionSdkPackageVersion>
|
||||
<InternalAspNetCoreSdkPackageVersion Condition=" '$(KoreBuildVersion)' == '' ">2.1.3-rtm-15842</InternalAspNetCoreSdkPackageVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- These are package versions that should not be overridden or updated by automation. -->
|
||||
|
|
|
|||
|
|
@ -2,9 +2,8 @@
|
|||
<PropertyGroup>
|
||||
<!-- This repo does not have solutions to build -->
|
||||
<DisableDefaultTargets>true</DisableDefaultTargets>
|
||||
<GenerateSignRequest>false</GenerateSignRequest>
|
||||
|
||||
<SignType Condition=" '$(SignType)' == '' ">public</SignType>
|
||||
<DisableDefaultItems>true</DisableDefaultItems>
|
||||
<BuildSolutions>false</BuildSolutions>
|
||||
|
||||
<SkipTests>false</SkipTests>
|
||||
<SkipTests Condition="'$(CompileOnly)' == 'true'">true</SkipTests>
|
||||
|
|
@ -42,6 +41,16 @@
|
|||
<SharedFrameworkName Include="Microsoft.AspNetCore.App" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectToExclude Include="$(RepositoryRoot)src\Middleware\WebSockets\samples\**\*.csproj" />
|
||||
|
||||
<ProjectToBuild Include="
|
||||
$(RepositoryRoot)src\Features\JsonPatch\**\*.*proj;
|
||||
$(RepositoryRoot)src\Middleware\**\*.*proj;
|
||||
"
|
||||
Exclude="@(ProjectToExclude)" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Properties for publishing -->
|
||||
<PropertyGroup>
|
||||
<!-- myget = non-orchestrated builds -->
|
||||
|
|
|
|||
|
|
@ -16,18 +16,52 @@
|
|||
|
||||
<PrepareDependsOn>SetTeamCityBuildNumberToVersion;$(PrepareDependsOn);VerifyPackageArtifactConfig;VerifyExternalDependencyConfig;PrepareOutputPaths</PrepareDependsOn>
|
||||
<CleanDependsOn>$(CleanDependsOn);CleanArtifacts;CleanRepoArtifacts</CleanDependsOn>
|
||||
<RestoreDependsOn>$(RestoreDependsOn);InstallDotNet</RestoreDependsOn>
|
||||
<CompileDependsOn>$(CompileDependsOn);BuildRepositories</CompileDependsOn>
|
||||
<RestoreDependsOn>$(RestoreDependsOn);InstallDotNet;RestoreProjects</RestoreDependsOn>
|
||||
<CompileDependsOn>$(CompileDependsOn);BuildProjects;PackProjects;BuildRepositories</CompileDependsOn>
|
||||
<PackageDependsOn Condition="'$(TestOnly)' != 'true'">$(PackageDependsOn);BuildMetapackages;CheckExpectedPackagesExist</PackageDependsOn>
|
||||
<TestDependsOn>$(TestDependsOn);_TestRepositories</TestDependsOn>
|
||||
<GetArtifactInfoDependsOn>$(GetArtifactInfoDependsOn);ResolveRepoInfo</GetArtifactInfoDependsOn>
|
||||
<TestDependsOn>$(TestDependsOn);TestProjects;_TestRepositories</TestDependsOn>
|
||||
<GetArtifactInfoDependsOn>$(GetArtifactInfoDependsOn);GetProjectArtifactInfo;ResolveRepoInfo</GetArtifactInfoDependsOn>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="PrepareOutputPaths">
|
||||
<MakeDir Directories="$(ArtifactsDir);$(BuildDir)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="ResolveRepoInfo" DependsOnTargets="_PrepareRepositories;GetMetapackageArtifactInfo;GetLineupPackageInfo">
|
||||
<Target Name="GenerateProjectList" DependsOnTargets="ResolveProjects">
|
||||
<MSBuild Projects="@(ProjectToBuild)"
|
||||
Targets="GetReferencesProvided"
|
||||
BuildInParallel="true"
|
||||
SkipNonexistentTargets="true"
|
||||
SkipNonexistentProjects="true" >
|
||||
|
||||
<Output TaskParameter="TargetOutputs" ItemName="_ProjectReferenceProvider"/>
|
||||
</MSBuild>
|
||||
|
||||
<PropertyGroup>
|
||||
<ProjectListFile>$(MSBuildThisFileDirectory)..\eng\ProjectReferences.props</ProjectListFile>
|
||||
<ProjectListContent>
|
||||
<![CDATA[
|
||||
<!-- This file is automatically generated. Run `build.cmd /t:GenerateProjectList` to update. -->
|
||||
<Project>
|
||||
<ItemGroup>
|
||||
@(_ProjectReferenceProvider->'<ProjectReferenceProvider Include="%(Identity)" ProjectPath="%24(RepositoryRoot)%(ProjectFileRelativePath)" />', '%0A ')
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
]]>
|
||||
</ProjectListContent>
|
||||
</PropertyGroup>
|
||||
|
||||
<WriteLinesToFile File="$(ProjectListFile)" Lines="$(ProjectListContent)" Overwrite="true" />
|
||||
</Target>
|
||||
|
||||
<Target Name="_ResolveProjectArtifactsInfoShipped" AfterTargets="GetProjectArtifactInfo">
|
||||
<ItemGroup>
|
||||
<ShippedArtifactInfo Include="@(ArtifactInfo)" Condition="'%(ArtifactInfo.IsShipped)' == 'true'" />
|
||||
<ArtifactInfo Remove="@(ShippedArtifactInfo)" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<Target Name="ResolveRepoInfo" DependsOnTargets="_ResolveProjectArtifactsInfoShipped;_PrepareRepositories;GetMetapackageArtifactInfo;GetLineupPackageInfo">
|
||||
<!-- We need to pass the NETCoreApp package versions to msbuild so that it doesn't complain about us using a different one than it was restored against. -->
|
||||
<PropertyGroup>
|
||||
<DesignTimeBuildProps>MicrosoftNETCoreAppPackageVersion=$(MicrosoftNETCoreAppPackageVersion);</DesignTimeBuildProps>
|
||||
|
|
|
|||
|
|
@ -77,6 +77,5 @@
|
|||
<ShippedRepository Include="Session" />
|
||||
<ShippedRepository Include="SignalR" />
|
||||
<ShippedRepository Include="StaticFiles" />
|
||||
<ShippedRepository Include="WebSockets" RootPath="$(RepositoryRoot)src\WebSockets\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Remove="Internal.AspNetCore.Sdk" />
|
||||
<PackageReference Include="Microsoft.DotNet.Archive" Version="$(MicrosoftDotNetArchivePackageVersion)" />
|
||||
<PackageReference Include="NuGet.Build.Tasks" Version="$(NuGetInMSBuildVersion)" PrivateAssets="All" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="$(DevDependency_MicrosoftExtensionsDependencyModelPackageVersion)" PrivateAssets="All" />
|
||||
|
|
|
|||
|
|
@ -10,11 +10,15 @@ In order to prepare this repo to build a new servicing update, the following cha
|
|||
+ <AspNetCorePatchVersion>8</AspNetCorePatchVersion>
|
||||
```
|
||||
|
||||
* Update the package archive baselines. This is used to make sure each build
|
||||
of the package archives we give to Azure only contains new files and does
|
||||
* Update the package archive baselines. This is used to make sure each build of the package archives we give to Azure only contains new files and does
|
||||
not require overwriting existing files. See [src/PackageArchive/ZipManifestGenerator/](/src/PackageArchive/ZipManifestGenerator/README.md) for instructions on how to run this tool.
|
||||
|
||||
* Update the list of repositories which will contain changes in [build/submodules.props](/build/submodules.props).
|
||||
* Update the package baselines. This is used to ensure packages keep a consistent set of dependencies between releases.
|
||||
See [eng/tools/BaselineGenerator/](/eng/tools/BaselineGenerator/README.md) for instructions on how to run this tool.
|
||||
|
||||
* **For packages with source code in this repo (not a submodule):** Update the list of packages in [eng/PatchConfig.props](/eng/PatchConfig.props) to list which packages should be patching in this release.
|
||||
|
||||
* **For packages still building from submodules:** Update the list of repositories which will contain changes in [build/submodules.props](/build/submodules.props).
|
||||
|
||||
* `<ShippedRepository>` items represent repos which were released in a previous patch, and will not contain servicing updates in the next patch.
|
||||
* `<Repository>` items represent repos which will produce new packages in this patch.
|
||||
|
|
@ -0,0 +1,100 @@
|
|||
<!-- Auto generated. Do not edit manually, use eng/tools/BaselineGenerator/ to recreate. -->
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
|
||||
<AspNetCoreBaselineVersion>2.1.6</AspNetCoreBaselineVersion>
|
||||
</PropertyGroup>
|
||||
<!-- Package: Microsoft.AspNetCore.Cryptography.Internal-->
|
||||
<PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Cryptography.Internal' ">
|
||||
<BaselinePackageVersion>2.1.1</BaselinePackageVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Cryptography.Internal' AND '$(TargetFramework)' == 'netstandard2.0' " />
|
||||
<!-- Package: Microsoft.AspNetCore.Cryptography.KeyDerivation-->
|
||||
<PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Cryptography.KeyDerivation' ">
|
||||
<BaselinePackageVersion>2.1.1</BaselinePackageVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Cryptography.KeyDerivation' AND '$(TargetFramework)' == 'netcoreapp2.0' ">
|
||||
<BaselinePackageReference Include="Microsoft.AspNetCore.Cryptography.Internal" Version="[2.1.1, )" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Cryptography.KeyDerivation' AND '$(TargetFramework)' == 'netstandard2.0' ">
|
||||
<BaselinePackageReference Include="Microsoft.AspNetCore.Cryptography.Internal" Version="[2.1.1, )" />
|
||||
</ItemGroup>
|
||||
<!-- Package: Microsoft.AspNetCore.DataProtection-->
|
||||
<PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.DataProtection' ">
|
||||
<BaselinePackageVersion>2.1.1</BaselinePackageVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.DataProtection' AND '$(TargetFramework)' == 'netstandard2.0' ">
|
||||
<BaselinePackageReference Include="Microsoft.AspNetCore.Cryptography.Internal" Version="[2.1.1, )" />
|
||||
<BaselinePackageReference Include="Microsoft.AspNetCore.DataProtection.Abstractions" Version="[2.1.1, )" />
|
||||
<BaselinePackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="[2.1.1, )" />
|
||||
<BaselinePackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="[2.1.1, )" />
|
||||
<BaselinePackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="[2.1.1, )" />
|
||||
<BaselinePackageReference Include="Microsoft.Extensions.Options" Version="[2.1.1, )" />
|
||||
<BaselinePackageReference Include="Microsoft.Win32.Registry" Version="[4.5.0, )" />
|
||||
<BaselinePackageReference Include="System.Security.Cryptography.Xml" Version="[4.5.0, )" />
|
||||
<BaselinePackageReference Include="System.Security.Principal.Windows" Version="[4.5.0, )" />
|
||||
</ItemGroup>
|
||||
<!-- Package: Microsoft.AspNetCore.DataProtection.Abstractions-->
|
||||
<PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.DataProtection.Abstractions' ">
|
||||
<BaselinePackageVersion>2.1.1</BaselinePackageVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.DataProtection.Abstractions' AND '$(TargetFramework)' == 'netstandard2.0' " />
|
||||
<!-- Package: Microsoft.AspNetCore.DataProtection.AzureKeyVault-->
|
||||
<PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.DataProtection.AzureKeyVault' ">
|
||||
<BaselinePackageVersion>2.1.1</BaselinePackageVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.DataProtection.AzureKeyVault' AND '$(TargetFramework)' == 'netstandard2.0' ">
|
||||
<BaselinePackageReference Include="Microsoft.AspNetCore.DataProtection" Version="[2.1.1, )" />
|
||||
<BaselinePackageReference Include="Microsoft.Azure.KeyVault" Version="[2.3.2, )" />
|
||||
<BaselinePackageReference Include="Microsoft.IdentityModel.Clients.ActiveDirectory" Version="[3.14.2, )" />
|
||||
</ItemGroup>
|
||||
<!-- Package: Microsoft.AspNetCore.DataProtection.AzureStorage-->
|
||||
<PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.DataProtection.AzureStorage' ">
|
||||
<BaselinePackageVersion>2.1.1</BaselinePackageVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.DataProtection.AzureStorage' AND '$(TargetFramework)' == 'netstandard2.0' ">
|
||||
<BaselinePackageReference Include="Microsoft.AspNetCore.DataProtection" Version="[2.1.1, )" />
|
||||
<BaselinePackageReference Include="WindowsAzure.Storage" Version="[8.1.4, )" />
|
||||
</ItemGroup>
|
||||
<!-- Package: Microsoft.AspNetCore.DataProtection.Extensions-->
|
||||
<PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.DataProtection.Extensions' ">
|
||||
<BaselinePackageVersion>2.1.1</BaselinePackageVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.DataProtection.Extensions' AND '$(TargetFramework)' == 'netstandard2.0' ">
|
||||
<BaselinePackageReference Include="Microsoft.AspNetCore.DataProtection" Version="[2.1.1, )" />
|
||||
<BaselinePackageReference Include="Microsoft.Extensions.DependencyInjection" Version="[2.1.1, )" />
|
||||
</ItemGroup>
|
||||
<!-- Package: Microsoft.AspNetCore.DataProtection.Redis-->
|
||||
<PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.DataProtection.Redis' ">
|
||||
<BaselinePackageVersion>0.4.1</BaselinePackageVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.DataProtection.Redis' AND '$(TargetFramework)' == 'netstandard2.0' ">
|
||||
<BaselinePackageReference Include="Microsoft.AspNetCore.DataProtection" Version="[2.1.1, )" />
|
||||
<BaselinePackageReference Include="StackExchange.Redis.StrongName" Version="[1.2.4, )" />
|
||||
</ItemGroup>
|
||||
<!-- Package: Microsoft.AspNetCore.DataProtection.SystemWeb-->
|
||||
<PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.DataProtection.SystemWeb' ">
|
||||
<BaselinePackageVersion>2.1.1</BaselinePackageVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.DataProtection.SystemWeb' AND '$(TargetFramework)' == 'net461' ">
|
||||
<BaselinePackageReference Include="Microsoft.AspNetCore.DataProtection" Version="[2.1.1, )" />
|
||||
<BaselinePackageReference Include="Microsoft.Extensions.DependencyInjection" Version="[2.1.1, )" />
|
||||
</ItemGroup>
|
||||
<!-- Package: Microsoft.AspNetCore.JsonPatch-->
|
||||
<PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.JsonPatch' ">
|
||||
<BaselinePackageVersion>2.1.1</BaselinePackageVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.JsonPatch' AND '$(TargetFramework)' == 'netstandard2.0' ">
|
||||
<BaselinePackageReference Include="Microsoft.CSharp" Version="[4.5.0, )" />
|
||||
<BaselinePackageReference Include="Newtonsoft.Json" Version="[11.0.2, )" />
|
||||
</ItemGroup>
|
||||
<!-- Package: Microsoft.AspNetCore.WebSockets-->
|
||||
<PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.WebSockets' ">
|
||||
<BaselinePackageVersion>2.1.1</BaselinePackageVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.WebSockets' AND '$(TargetFramework)' == 'netstandard2.0' ">
|
||||
<BaselinePackageReference Include="Microsoft.AspNetCore.Http.Extensions" Version="[2.1.1, )" />
|
||||
<BaselinePackageReference Include="Microsoft.Extensions.Options" Version="[2.1.1, )" />
|
||||
<BaselinePackageReference Include="System.Net.WebSockets.WebSocketProtocol" Version="[4.5.1, )" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
<!-- This file is a work in progress as we merge repos and move content here from build/dependencies.props. -->
|
||||
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup Label="ProdCon dependencies">
|
||||
<!-- These dependencies must use version variables because they may be overriden by ProdCon builds. -->
|
||||
<LatestPackageReference Include="Microsoft.AspNetCore.Testing" Version="$(MicrosoftAspNetCoreTestingPackageVersion)" />
|
||||
<LatestPackageReference Include="Microsoft.CSharp" Version="$(MicrosoftCSharpPackageVersion)" />
|
||||
<LatestPackageReference Include="Microsoft.Extensions.ClosedGenericMatcher.Sources" Version="$(MicrosoftExtensionsClosedGenericMatcherSourcesPackageVersion)" />
|
||||
<LatestPackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="$(MicrosoftExtensionsConfigurationCommandLinePackageVersion)" />
|
||||
<LatestPackageReference Include="Microsoft.Extensions.Options" Version="$(MicrosoftExtensionsOptionsPackageVersion)" />
|
||||
<LatestPackageReference Include="Microsoft.Extensions.Logging" Version="$(MicrosoftExtensionsLoggingPackageVersion)" />
|
||||
<LatestPackageReference Include="Microsoft.Extensions.Logging.Console" Version="$(MicrosoftExtensionsLoggingConsolePackageVersion)" />
|
||||
<LatestPackageReference Include="Microsoft.Extensions.Logging.Testing" Version="$(MicrosoftExtensionsLoggingTestingPackageVersion)" />
|
||||
<LatestPackageReference Include="System.Net.WebSockets.WebSocketProtocol" Version="$(SystemNetWebSocketsWebSocketProtocolPackageVersion)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Label="External dependencies">
|
||||
<LatestPackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
|
||||
<LatestPackageReference Include="Moq" Version="4.10.0" />
|
||||
<!-- This version is required by MSBuild tasks or Visual Studio extensions. -->
|
||||
<LatestPackageReference Include="Newtonsoft.Json" Version="9.0.1" Condition="'$(UseMSBuildJsonNet)' == 'true'" />
|
||||
<!-- This version should be used by runtime packages -->
|
||||
<LatestPackageReference Include="Newtonsoft.Json" Version="11.0.2" Condition="'$(UseMSBuildJsonNet)' != 'true'" />
|
||||
<LatestPackageReference Include="xunit.abstractions" Version="2.0.1" />
|
||||
<LatestPackageReference Include="xunit.analyzers" Version="0.10.0" />
|
||||
<LatestPackageReference Include="xunit.assert" Version="2.3.1" />
|
||||
<LatestPackageReference Include="xunit.extensibility.core" Version="2.3.1" />
|
||||
<LatestPackageReference Include="xunit.extensibility.execution" Version="2.3.1" />
|
||||
<LatestPackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
|
||||
<LatestPackageReference Include="xunit" Version="2.4.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(IsTestProject)' == 'true' ">
|
||||
<Reference Include="Microsoft.AspNetCore.Testing" />
|
||||
<Reference Include="Microsoft.NET.Test.Sdk" />
|
||||
<Reference Include="Moq" />
|
||||
<Reference Include="xunit" />
|
||||
<Reference Include="xunit.analyzers" />
|
||||
<Reference Include="xunit.runner.visualstudio" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(VersionPrefix)' == '2.1.7' ">
|
||||
<PackagesInPatch>
|
||||
Microsoft.AspNetCore;
|
||||
Microsoft.AspNetCore.Server.IISIntegration;
|
||||
</PackagesInPatch>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<!-- This file is automatically generated. Run `build.cmd /t:GenerateProjectList` to update. -->
|
||||
<Project>
|
||||
<ItemGroup>
|
||||
<ProjectReferenceProvider Include="Microsoft.AspNetCore.JsonPatch" ProjectPath="$(RepositoryRoot)src\Features\JsonPatch\src\Microsoft.AspNetCore.JsonPatch.csproj" />
|
||||
<ProjectReferenceProvider Include="Microsoft.AspNetCore.WebSockets" ProjectPath="$(RepositoryRoot)src\Middleware\WebSockets\src\Microsoft.AspNetCore.WebSockets.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
<Project>
|
||||
|
||||
<PropertyGroup>
|
||||
<LangVersion>7.2</LangVersion>
|
||||
|
||||
<!-- Instructs the compiler to use SHA256 instead of SHA1 when adding file hashes to PDBs. -->
|
||||
<ChecksumAlgorithm>SHA256</ChecksumAlgorithm>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Internal.AspNetCore.Sdk" PrivateAssets="All" Version="$(InternalAspNetCoreSdkPackageVersion)" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<Project>
|
||||
|
||||
<Import Project="Packaging.targets" />
|
||||
<Import Project="ResolveReferences.targets" />
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
<Project>
|
||||
|
||||
<Target Name="EnsureBaselineIsUpdated"
|
||||
Condition="'$(IsServicingBuild)' == 'true' AND '$(AspNetCoreBaselineVersion)' != '$(PreviousAspNetCoreReleaseVersion)'"
|
||||
BeforeTargets="BeforeBuild">
|
||||
<Error Text="The package baseline ($(AspNetCoreBaselineVersion)) is out of date with the latest release of this repo ($(PreviousAspNetCoreReleaseVersion)).
|
||||
See $(RepositoryRoot)eng\tools\BaselineGenerator\README.md for instructions on updating this baseline." />
|
||||
</Target>
|
||||
|
||||
<!-- Temporary: this target is used to gather version information to pass to submodule builds. This can be removed after we finish merging submodules. -->
|
||||
<Target Name="GetBaselineArtifactInfo"
|
||||
Condition="'$(IsPackableInNonServicingBuild)' == 'true'"
|
||||
Returns="@(ArtifactInfo)"
|
||||
BeforeTargets="GetArtifactInfo">
|
||||
|
||||
<PropertyGroup>
|
||||
<FullPackageOutputPath>$(PackageOutputPath)$(PackageId).$(PackageVersion).nupkg</FullPackageOutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ArtifactInfo Include="$(FullPackageOutputPath)">
|
||||
<ArtifactType>NuGetPackage</ArtifactType>
|
||||
<PackageId>$(PackageId)</PackageId>
|
||||
<Version>$(PackageVersion)</Version>
|
||||
<RepositoryRoot>$(RepositoryRoot)</RepositoryRoot>
|
||||
<IsShipped>true</IsShipped>
|
||||
</ArtifactInfo>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,135 @@
|
|||
<Project>
|
||||
|
||||
<PropertyGroup>
|
||||
<ResolveReferencesDependsOn>
|
||||
ResolveCustomReferences;
|
||||
$(ResolveReferencesDependsOn);
|
||||
</ResolveReferencesDependsOn>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<!--
|
||||
Projects should only use the latest package references when:
|
||||
* preparing a new major or minor release (i.e. a non-servicing builds)
|
||||
* when a project is a test or sample project
|
||||
* when a package is releasing a new patch (we like to update external dependencies in patches when possible)
|
||||
-->
|
||||
<UseLatestPackageReferences Condition=" '$(UseLatestPackageReferences)' == '' AND '$(IsServicingBuild)' != 'true' ">true</UseLatestPackageReferences>
|
||||
<UseLatestPackageReferences Condition=" '$(UseLatestPackageReferences)' == '' AND '$(IsImplementationProject)' != 'true' ">true</UseLatestPackageReferences>
|
||||
<UseLatestPackageReferences Condition=" '$(UseLatestPackageReferences)' == '' AND '$(IsImplementationProject)' == 'true' AND ( '$(IsServicingBuild)' != 'true' OR '$(IsPackable)' == 'true' ) ">true</UseLatestPackageReferences>
|
||||
<UseLatestPackageReferences Condition=" '$(UseLatestPackageReferences)' == '' ">false</UseLatestPackageReferences>
|
||||
|
||||
<!--
|
||||
Projects should only use the project references instead of baseline package references when:
|
||||
* preparing a new major or minor release (i.e. a non-servicing builds)
|
||||
* when a project is a test or sample project
|
||||
We don't use project references between components in servicing builds between compontents to preserve the baseline as much as possible.
|
||||
-->
|
||||
<UseProjectReferences Condition=" '$(UseProjectReferences)' == '' AND '$(IsServicingBuild)' != 'true' ">true</UseProjectReferences>
|
||||
<UseProjectReferences Condition=" '$(UseProjectReferences)' == '' AND '$(IsImplementationProject)' != 'true' ">true</UseProjectReferences>
|
||||
<UseProjectReferences Condition=" '$(UseProjectReferences)' == '' ">false</UseProjectReferences>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<_ImplicitPackageReference Include="@(PackageReference->WithMetadataValue('IsImplicitlyDefined', 'true'))" />
|
||||
<_ExplicitPackageReference Include="@(PackageReference)" Exclude="@(_ImplicitPackageReference)" />
|
||||
<_ExplicitPackageReference Remove="Internal.AspNetCore.Sdk" />
|
||||
|
||||
<UnusedProjectReferenceProvider Include="@(ProjectReferenceProvider)" Exclude="@(Reference)" />
|
||||
|
||||
<!-- Order matters. Projects should be used when possible instead of packages. -->
|
||||
<_ProjectReferenceByAssemblyName Condition="'$(UseProjectReferences)' == 'true'"
|
||||
Include="@(ProjectReferenceProvider)"
|
||||
Exclude="@(UnusedProjectReferenceProvider)" />
|
||||
|
||||
<ProjectReference Include="@(_ProjectReferenceByAssemblyName->'%(ProjectPath)')" />
|
||||
|
||||
<Reference Remove="@(_ProjectReferenceByAssemblyName)" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="ResolveCustomReferences" BeforeTargets="CollectPackageReferences;ResolveAssemblyReferencesDesignTime;ResolveAssemblyReferences" Condition=" '$(TargetFramework)' != '' ">
|
||||
<ItemGroup>
|
||||
<UnusedBaselinePackageReference Include="@(BaselinePackageReference)" Exclude="@(Reference);@(_ProjectReferenceByAssemblyName)" />
|
||||
|
||||
<!--
|
||||
MSBuild does not provide a way to join on matching identities in a Condition,
|
||||
but you can do a cartesian product of two item groups and filter out mismatched id's in a second pass.
|
||||
-->
|
||||
<_LatestPackageReferenceWithVersion Include="@(Reference)" Condition=" '$(UseLatestPackageReferences)' == 'true' ">
|
||||
<Id>%(LatestPackageReference.Identity)</Id>
|
||||
<Version>%(LatestPackageReference.Version)</Version>
|
||||
</_LatestPackageReferenceWithVersion>
|
||||
<_LatestPackageReferenceWithVersion Remove="@(_LatestPackageReferenceWithVersion)" Condition="'%(Id)' != '%(Identity)' " />
|
||||
|
||||
<!-- Remove reference items that have been resolved to a LatestPackageReference item. -->
|
||||
<Reference Remove="@(_LatestPackageReferenceWithVersion)" />
|
||||
<PackageReference Include="@(_LatestPackageReferenceWithVersion)" IsImplicitlyDefined="true" />
|
||||
|
||||
<!-- Resolve references from BaselinePackageReference for servicing builds. -->
|
||||
<_BaselinePackageReferenceWithVersion Include="@(Reference)" Condition=" '$(IsServicingBuild)' == 'true' OR '$(UseLatestPackageReferences)' != 'true' ">
|
||||
<Id>%(BaselinePackageReference.Identity)</Id>
|
||||
<Version>%(BaselinePackageReference.Version)</Version>
|
||||
</_BaselinePackageReferenceWithVersion>
|
||||
|
||||
<_BaselinePackageReferenceWithVersion Remove="@(_BaselinePackageReferenceWithVersion)" Condition="'%(Id)' != '%(Identity)' " />
|
||||
|
||||
<!-- Remove reference items that have been resolved to a BaselinePackageReference item. -->
|
||||
<PackageReference Include="@(_BaselinePackageReferenceWithVersion)" IsImplicitlyDefined="true" />
|
||||
<Reference Remove="@(_BaselinePackageReferenceWithVersion)" />
|
||||
|
||||
<!-- For PrivateAssets=All references, like .Sources packages, fallback to LatestPackageReferences. -->
|
||||
<_PrivatePackageReferenceWithVersion Include="@(Reference->WithMetadataValue('PrivateAssets', 'All'))">
|
||||
<Id>%(LatestPackageReference.Identity)</Id>
|
||||
<Version>%(LatestPackageReference.Version)</Version>
|
||||
</_PrivatePackageReferenceWithVersion>
|
||||
|
||||
<_PrivatePackageReferenceWithVersion Remove="@(_PrivatePackageReferenceWithVersion)" Condition="'%(Id)' != '%(Identity)' " />
|
||||
|
||||
<!-- Remove reference items that have been resolved to a LatestPackageReference item. -->
|
||||
<PackageReference Include="@(_PrivatePackageReferenceWithVersion)" IsImplicitlyDefined="true" />
|
||||
<Reference Remove="@(_PrivatePackageReferenceWithVersion)" />
|
||||
|
||||
<!-- Free up memory for unnecessary items -->
|
||||
<_LatestPackageReferenceWithVersion Remove="@(_LatestPackageReferenceWithVersion)" />
|
||||
<_BaselinePackageReferenceWithVersion Remove="@(_BaselinePackageReferenceWithVersion)" />
|
||||
<_PrivatePackageReferenceWithVersion Remove="@(_PrivatePackageReferenceWithVersion)" />
|
||||
<_ImplicitPackageReference Remove="@(_ImplicitPackageReference)" />
|
||||
</ItemGroup>
|
||||
<!--
|
||||
<Error Condition="@(_ExplicitPackageReference->Count()) != 0"
|
||||
Text="PackageReference items are not allowed. Use <Reference> instead. " /> -->
|
||||
|
||||
<ItemGroup>
|
||||
<_ExplicitPackageReference Remove="@(_ExplicitPackageReference)" />
|
||||
</ItemGroup>
|
||||
|
||||
<Warning Condition="@(UnusedBaselinePackageReference->Count()) != 0"
|
||||
Text="Package references changed since the last release. This could be a breaking change. References removed:%0A - @(UnusedBaselinePackageReference, '%0A -')" />
|
||||
|
||||
<Error Condition="'$(TargetFrameworkIdentifier)' != '.NETFramework' AND '%(Reference.Identity)' != '' AND ! Exists('%(Reference.Identity)')"
|
||||
Code="MSB3245"
|
||||
Text="Could not resolve this reference. Could not locate the package or project for "%(Reference.Identity)"" />
|
||||
</Target>
|
||||
|
||||
<Target Name="GetReferencesProvided" Returns="@(ProvidesReference)">
|
||||
<ItemGroup>
|
||||
<_TargetFramework Remove="@(_TargetFramework)" />
|
||||
<_TargetFramework Include="$(TargetFramework)" Condition="'$(TargetFramework)' != '' "/>
|
||||
<_TargetFramework Include="$(TargetFrameworks)" Condition="'$(TargetFramework)' == '' "/>
|
||||
</ItemGroup>
|
||||
|
||||
<MSBuild Projects="$(MSBuildProjectFullPath)"
|
||||
Targets="_GetReferencesProvided"
|
||||
Properties="TargetFramework=%(_TargetFramework.Identity)">
|
||||
<Output TaskParameter="TargetOutputs" ItemName="ProvidesReference" />
|
||||
</MSBuild>
|
||||
</Target>
|
||||
|
||||
<Target Name="_GetReferencesProvided" Returns="@(ProvidesReference)">
|
||||
<ItemGroup Condition=" '$(IsImplementationProject)' == 'true' OR '$(IsProjectReferenceProvider)' == 'true' ">
|
||||
<ProvidesReference Include="$(AssemblyName)">
|
||||
<ProjectFileRelativePath>$([MSBuild]::MakeRelative($(RepositoryRoot), $(MSBuildProjectFullPath)))</ProjectFileRelativePath>
|
||||
</ProvidesReference>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||
<StartArguments>-o "$(MSBuildThisFileDirectory)../../Baseline.props"</StartArguments>
|
||||
<StartWorkingDirectory>$(MSBuildProjectDirectory)</StartWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NuGet.Packaging" Version="4.8.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.CommandLineUtils" Version="1.1.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
using Microsoft.Extensions.CommandLineUtils;
|
||||
using NuGet.Packaging;
|
||||
using NuGet.Packaging.Core;
|
||||
|
||||
namespace PackageBaselineGenerator
|
||||
{
|
||||
/// <summary>
|
||||
/// This generates Baseline.props with information about the last RTM release.
|
||||
/// </summary>
|
||||
class Program : CommandLineApplication
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
new Program().Execute(args);
|
||||
}
|
||||
|
||||
private readonly CommandOption _source;
|
||||
private readonly CommandOption _output;
|
||||
|
||||
public Program()
|
||||
{
|
||||
_source = Option("-s|--source <SOURCE>", "The NuGet v2 source of the package to fetch", CommandOptionType.SingleValue);
|
||||
_output = Option("-o|--output <OUT>", "The generated file output path", CommandOptionType.SingleValue);
|
||||
|
||||
Invoke = () => Run().GetAwaiter().GetResult();
|
||||
}
|
||||
|
||||
private async Task<int> Run()
|
||||
{
|
||||
var source = _source.HasValue()
|
||||
? _source.Value()
|
||||
: "https://www.nuget.org/api/v2/package";
|
||||
|
||||
var packageCache = Environment.GetEnvironmentVariable("NUGET_PACKAGES") != null
|
||||
? Environment.GetEnvironmentVariable("NUGET_PACKAGES")
|
||||
: Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".nuget", "packages");
|
||||
|
||||
var tempDir = Path.Combine(Directory.GetCurrentDirectory(), "obj", "tmp");
|
||||
Directory.CreateDirectory(tempDir);
|
||||
|
||||
var input = XDocument.Load(Path.Combine(Directory.GetCurrentDirectory(), "baseline.xml"));
|
||||
|
||||
var output = _output.HasValue()
|
||||
? _output.Value()
|
||||
: Path.Combine(Directory.GetCurrentDirectory(), "Baseline.props");
|
||||
|
||||
var baselineVersion = input.Root.Attribute("Version").Value;
|
||||
|
||||
var doc = new XDocument(
|
||||
new XComment(" Auto generated. Do not edit manually, use eng/tools/BaselineGenerator/ to recreate. "),
|
||||
new XElement("Project",
|
||||
new XElement("PropertyGroup",
|
||||
new XElement("MSBuildAllProjects", "$(MSBuildAllProjects);$(MSBuildThisFileFullPath)"),
|
||||
new XElement("AspNetCoreBaselineVersion", baselineVersion))));
|
||||
|
||||
var client = new HttpClient();
|
||||
|
||||
foreach (var pkg in input.Root.Descendants("Package"))
|
||||
{
|
||||
var id = pkg.Attribute("Id").Value;
|
||||
var version = pkg.Attribute("Version").Value;
|
||||
var packageFileName = $"{id}.{version}.nupkg";
|
||||
var nupkgPath = Path.Combine(packageCache, id.ToLowerInvariant(), version, packageFileName);
|
||||
if (!File.Exists(nupkgPath))
|
||||
{
|
||||
nupkgPath = Path.Combine(tempDir, packageFileName);
|
||||
}
|
||||
|
||||
if (!File.Exists(nupkgPath))
|
||||
{
|
||||
var url = $"{source}/{id}/{version}";
|
||||
using (var file = File.Create(nupkgPath))
|
||||
{
|
||||
Console.WriteLine($"Downloading {url}");
|
||||
var response = await client.GetStreamAsync(url);
|
||||
await response.CopyToAsync(file);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
using (var reader = new PackageArchiveReader(nupkgPath))
|
||||
{
|
||||
var first = true;
|
||||
foreach (var group in reader.NuspecReader.GetDependencyGroups())
|
||||
{
|
||||
if (first)
|
||||
{
|
||||
first = false;
|
||||
doc.Root.Add(new XComment($" Package: {id}"));
|
||||
|
||||
var propertyGroup = new XElement("PropertyGroup",
|
||||
new XAttribute("Condition", $" '$(PackageId)' == '{id}' "),
|
||||
new XElement("BaselinePackageVersion", version));
|
||||
doc.Root.Add(propertyGroup);
|
||||
}
|
||||
|
||||
var itemGroup = new XElement("ItemGroup", new XAttribute("Condition", $" '$(PackageId)' == '{id}' AND '$(TargetFramework)' == '{group.TargetFramework.GetShortFolderName()}' "));
|
||||
doc.Root.Add(itemGroup);
|
||||
|
||||
foreach (var dependency in group.Packages)
|
||||
{
|
||||
itemGroup.Add(new XElement("BaselinePackageReference", new XAttribute("Include", dependency.Id), new XAttribute("Version", dependency.VersionRange.ToString())));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var settings = new XmlWriterSettings
|
||||
{
|
||||
OmitXmlDeclaration = true,
|
||||
Encoding = Encoding.UTF8,
|
||||
Indent = true,
|
||||
};
|
||||
using (var writer = XmlWriter.Create(output, settings))
|
||||
{
|
||||
doc.Save(writer);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
BaselineGenerator
|
||||
=================
|
||||
|
||||
This tool is used to generate an MSBuild file which sets the "baseline" against which servicing updates are built.
|
||||
|
||||
## Usage
|
||||
|
||||
1. Add to the [baseline.xml](./baseline.xml) a list of package ID's and their latest released versions. The source of this information can typically
|
||||
be found in the build.xml file generated during ProdCon builds. See https://github.com/dotnet/versions/blob/master/build-info/dotnet/product/cli/release/2.1.6/build.xml for example.
|
||||
2. Run `dotnet run` on this project.
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<Baseline Version="2.1.6">
|
||||
<Package Id="Microsoft.AspNetCore.Cryptography.Internal" Version="2.1.1" />
|
||||
<Package Id="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="2.1.1" />
|
||||
<Package Id="Microsoft.AspNetCore.DataProtection" Version="2.1.1" />
|
||||
<Package Id="Microsoft.AspNetCore.DataProtection.Abstractions" Version="2.1.1" />
|
||||
<Package Id="Microsoft.AspNetCore.DataProtection.AzureKeyVault" Version="2.1.1" />
|
||||
<Package Id="Microsoft.AspNetCore.DataProtection.AzureStorage" Version="2.1.1" />
|
||||
<Package Id="Microsoft.AspNetCore.DataProtection.Extensions" Version="2.1.1" />
|
||||
<Package Id="Microsoft.AspNetCore.DataProtection.Redis" Version="0.4.1" />
|
||||
<Package Id="Microsoft.AspNetCore.DataProtection.SystemWeb" Version="2.1.1" />
|
||||
<Package Id="Microsoft.AspNetCore.JsonPatch" Version="2.1.1" />
|
||||
<Package Id="Microsoft.AspNetCore.WebSockets" Version="2.1.1" />
|
||||
</Baseline>
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
<Project>
|
||||
<Import Project="..\..\build\sources.props" />
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
<Project>
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.26124.0
|
||||
MinimumVisualStudioVersion = 15.0.26124.0
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BaselineGenerator", "BaselineGenerator\BaselineGenerator.csproj", "{CF76A947-3A72-4824-87E6-BF029D84218B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{CF76A947-3A72-4824-87E6-BF029D84218B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CF76A947-3A72-4824-87E6-BF029D84218B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CF76A947-3A72-4824-87E6-BF029D84218B}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{CF76A947-3A72-4824-87E6-BF029D84218B}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{CF76A947-3A72-4824-87E6-BF029D84218B}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{CF76A947-3A72-4824-87E6-BF029D84218B}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{CF76A947-3A72-4824-87E6-BF029D84218B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CF76A947-3A72-4824-87E6-BF029D84218B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{CF76A947-3A72-4824-87E6-BF029D84218B}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{CF76A947-3A72-4824-87E6-BF029D84218B}.Release|x64.Build.0 = Release|Any CPU
|
||||
{CF76A947-3A72-4824-87E6-BF029D84218B}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{CF76A947-3A72-4824-87E6-BF029D84218B}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
@ -5,20 +5,4 @@
|
|||
<Import Project="version.props" />
|
||||
<Import Project="dependencies.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<VerifyVersion>false</VerifyVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Internal.AspNetCore.Sdk" PrivateAssets="All" Version="$(InternalAspNetCoreSdkPackageVersion)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(IsTestProject)' == 'true' ">
|
||||
<PackageReference Include="Microsoft.AspNetCore.Testing" Version="$(MicrosoftAspNetCoreTestingPackageVersion)" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPackageVersion)" />
|
||||
<PackageReference Include="Moq" Version="$(MoqPackageVersion)" />
|
||||
<PackageReference Include="xunit" Version="$(XunitPackageVersion)" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitRunnerVisualStudioPackageVersion)" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -3,9 +3,7 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<GenerateUserSecretsAttribute>false</GenerateUserSecretsAttribute>
|
||||
<IsFrameworkMetapackage>true</IsFrameworkMetapackage>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Internal.AspNetCore.Sdk" Version="$(InternalAspNetCoreSdkPackageVersion)" PrivateAssets="All" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@
|
|||
<VersionSuffix>$(PreReleaseLabel)-$(BuildNumber)</VersionSuffix>
|
||||
<BrandingVersionSuffix>$(PreReleaseBrandingLabel) Build $(BuildNumber)</BrandingVersionSuffix>
|
||||
|
||||
<!-- Servicing builds have different characteristics for the way dependencies, baselines, and versions are handled. -->
|
||||
<IsServicingBuild Condition=" '$(PreReleaseLabel)' == 'servicing' ">true</IsServicingBuild>
|
||||
<!-- Run the build with /p:IsFinalBuild=true to produce the product with 'final' branding and versioning -->
|
||||
<IsFinalBuild Condition=" '$(IsFinalBuild)' == '' ">false</IsFinalBuild>
|
||||
<IncludePreReleaseLabelInPackageVersion>true</IncludePreReleaseLabelInPackageVersion>
|
||||
|
|
@ -32,6 +34,9 @@
|
|||
<VersionSuffix Condition=" '$(VersionMetadata)' != '' ">$(VersionSuffix)+$(VersionMetadata)</VersionSuffix>
|
||||
|
||||
<SharedFxCliBlobChannel>release/$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion)</SharedFxCliBlobChannel>
|
||||
|
||||
<!-- This is used for error checking to ensure generated code and baselines are up to date when we increment the patch. -->
|
||||
<PreviousAspNetCoreReleaseVersion Condition=" '$(AspNetCorePatchVersion)' != '0' ">$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion).$([MSBuild]::Subtract($(AspNetCorePatchVersion), 1))</PreviousAspNetCoreReleaseVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Run 'dotnet msbuild version.props' to test changes to this file. -->
|
||||
|
|
|
|||
Loading…
Reference in New Issue