Skip to content

Commit

Permalink
Extract Analyzer and Authorization package version and use it in Comp…
Browse files Browse the repository at this point in the history
…onents nuspec.

#8825
  • Loading branch information
NTaylorMullen committed Jul 17, 2019
1 parent d0be8a8 commit 5a50dcb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,25 @@
<Reference Include="System.ComponentModel.Annotations" />
</ItemGroup>

<Target Name="_GetNuspecDependencyPackageVersions">
<MSBuild Targets="_GetPackageVersionInfo"
BuildInParallel="$(BuildInParallel)"
Projects="../../Analyzers/src/Microsoft.AspNetCore.Components.Analyzers.csproj;../../../Security/Authorization/Core/src/Microsoft.AspNetCore.Authorization.csproj">
<Output TaskParameter="TargetOutputs" ItemName="_ProjectPathWithVersion" />
</MSBuild>
<ItemGroup>
<NuspecProperty Include="@(_ProjectPathWithVersion->WithMetadataValue('PackageId', 'Microsoft.AspnetCore.Components.Analyzers')->'componentAnalyzerPackageVersion=%(PackageVersion)')" />
<NuspecProperty Include="@(_ProjectPathWithVersion->WithMetadataValue('PackageId', 'Microsoft.AspnetCore.Authorization')->'authorizationPackageVersion=%(PackageVersion)')" />
</ItemGroup>
</Target>

<!-- Pack settings -->
<PropertyGroup>
<NuspecFile>Microsoft.AspNetCore.Components.nuspec</NuspecFile>
<GenerateNuspecDependsOn>$(GenerateNuspecDependsOn);_GetNuspecDependencyPackageVersions</GenerateNuspecDependsOn>
</PropertyGroup>

<ItemGroup>
<NuspecProperty Include="coherentPackageVersion=$(PackageVersion)" />
<NuspecProperty Include="jsInteropPackageVersion=$(MicrosoftJSInteropPackageVersion)" />
<NuspecProperty Include="systemComponentModelAnnotationsPackageVersion=$(SystemComponentModelAnnotationsPackageVersion)" />
<NuspecProperty Include="outputPath=$(OutputPath)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
$CommonMetadataElements$
<dependencies>
<group targetFramework=".NETStandard2.0">
<dependency id="Microsoft.AspNetCore.Components.Analyzers" version="$coherentPackageVersion$" />
<dependency id="Microsoft.AspNetCore.Authorization" version="$coherentPackageVersion$" exclude="Build,Analyzers" />
<dependency id="Microsoft.AspNetCore.Components.Analyzers" version="$componentAnalyzerPackageVersion$" />
<dependency id="Microsoft.AspNetCore.Authorization" version="$authorizationPackageVersion$" exclude="Build,Analyzers" />
<dependency id="Microsoft.JSInterop" version="$jsInteropPackageVersion$" exclude="Build,Analyzers" />
<dependency id="System.ComponentModel.Annotations" version="$systemComponentModelAnnotationsPackageVersion$" exclude="Build,Analyzers" />
</group>
Expand Down

0 comments on commit 5a50dcb

Please sign in to comment.