Skip to content

Commit 2587b63

Browse files
committed
Modify CLI build file to always ignore NU5104
1 parent 27900dc commit 2587b63

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

repos/cli.proj

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,28 @@
117117
Overwrite="true" />
118118
</Target>
119119

120+
<!--
121+
Ignore this error in the CLI build, which doesn't seem to happen in ProdCon:
122+
123+
error NU5104: A stable release of a package should not have a prerelease dependency. Either
124+
modify the version spec of dependency "NuGet.Frameworks [4.7.0-rtm.5156, )" or update the
125+
version field in the nuspec.
126+
-->
127+
<Target Name="AddNoWarnNU5104ByDefault" BeforeTargets="Build">
128+
<PropertyGroup>
129+
<BuildDefaultsFile>$(ProjectDirectory)build\BuildDefaults.props</BuildDefaultsFile>
130+
<ReplacementEndMark>&lt;/NoWarn&gt;</ReplacementEndMark>
131+
<InsertItemLine>;NU5104$(ReplacementEndMark)</InsertItemLine>
132+
133+
<BuildDefaultsPropsContents>$([System.IO.File]::ReadAllText('$(BuildDefaultsFile)'))</BuildDefaultsPropsContents>
134+
</PropertyGroup>
135+
136+
<WriteLinesToFile File="$(BuildDefaultsFile)"
137+
Lines="$(BuildDefaultsPropsContents.Replace('$(ReplacementEndMark)', '$(InsertItemLine)'))"
138+
Condition="! $(BuildDefaultsPropsContents.Contains('$(InsertItemLine)'))"
139+
Overwrite="true" />
140+
</Target>
141+
120142
<Target Name="CopyTarBall" AfterTargets="CopyPackage">
121143
<ItemGroup>
122144
<CliTarBalls Include="$(TarBallOutput)*$(TarBallExtension)" />

0 commit comments

Comments
 (0)