[Identity] Add warnings when using Bootstrap3 and errors when using an unknown framework version (#12988)
* [Identity] Add warnings when using Bootstrap3 and errors when using an unknown framework version
This commit is contained in:
parent
e4b4476b37
commit
5c71742e4a
|
|
@ -30,6 +30,8 @@
|
|||
<Content Remove="@(Content)" />
|
||||
<Content Include="wwwroot\**\*" Pack="true" />
|
||||
<None Include="build\*" Pack="true" PackagePath="build\" />
|
||||
<None Include="buildMultiTargeting\*" Pack="true" PackagePath="buildMultiTargeting\" />
|
||||
<None Include="buildTransitive\*" Pack="true" PackagePath="buildTransitive\" />
|
||||
<None Include="THIRD-PARTY-NOTICES.txt" Pack="true" PackagePath="/THIRD-PARTY-NOTICES.txt" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
<Project>
|
||||
|
||||
<Target Name="ValidateIdentityUIFrameworkVersion" BeforeTargets="Build">
|
||||
|
||||
<PropertyGroup>
|
||||
<_IdentityUIBootstrap3WarningMessage>'Bootstrap3' is obsolete. It is recommended that the application is updated to use a supported Bootstrap version by removing the 'IdentityUIFrameworkVersion' property from '$(MSBuildProjectFile)' or setting 'IdentityUIFrameworkVersion' explicitly to 'Bootstrap4'.
|
||||
</_IdentityUIBootstrap3WarningMessage>
|
||||
<_IdentityUIUnknownVersionErrorMessage>The 'IdentityUIFrameworkVersion' '$(IdentityUIFrameworkVersion)' in '$(MSBuildProjectFile)' is not valid. Valid versions are 'Bootstrap3' and 'Bootstrap4'.
|
||||
</_IdentityUIUnknownVersionErrorMessage>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<_IdentityUIActiveWarnings Include="IdentityUI001;IdentityUI002" Exclude="$(NoWarn)" />
|
||||
</ItemGroup>
|
||||
|
||||
<Warning Code="IdentityUI001"
|
||||
Text="$(_IdentityUIBootstrap3WarningMessage)"
|
||||
File="@(MSBuildThisProjectFile)"
|
||||
Condition="'$(IdentityUIFrameworkVersion)' == 'Bootstrap3' and '%(_IdentityUIActiveWarnings.Identity)' == 'IdentityUI001' and '$(WarningsAsErrors)' != 'true'" />
|
||||
|
||||
<Error Code="IdentityUI001"
|
||||
Text="$(_IdentityUIBootstrap3WarningMessage)"
|
||||
File="@(MSBuildThisProjectFile)"
|
||||
Condition="'$(IdentityUIFrameworkVersion)' == 'Bootstrap3' and '%(_IdentityUIActiveWarnings.Identity)' == 'IdentityUI001' and '$(WarningsAsErrors)' == 'true'" />
|
||||
|
||||
<Error
|
||||
Code="IdentityUI002"
|
||||
Text="$(_IdentityUIUnknownVersionErrorMessage)"
|
||||
File="@(MSBuildThisProjectFile)"
|
||||
Condition="'$(IdentityUIFrameworkVersion)' != 'Bootstrap3' and $(IdentityUIFrameworkVersion) != 'Bootstrap4' and '%(_IdentityUIActiveWarnings.Identity)' == 'IdentityUI002'" />
|
||||
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<Project>
|
||||
|
||||
<Import Project="..\build\Microsoft.AspnetCore.Identity.UI.targets" />
|
||||
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<Project>
|
||||
|
||||
<Import Project="..\buildMultiTargeting\Microsoft.AspnetCore.Identity.UI.targets" />
|
||||
|
||||
</Project>
|
||||
Loading…
Reference in New Issue