Skip to content

Commit

Permalink
Improve release build of command-line tool (dotnet#912)
Browse files Browse the repository at this point in the history
  • Loading branch information
josefpihrt authored and JochemHarmes committed Oct 30, 2023
1 parent bc47c52 commit e5da43f
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tools/build_cli.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# dotnet tool install -g orang.dotnet.cli

$outDir = "../out/Release"

New-Item -Path $outDir -ItemType directory
Remove-Item "$outDir/Roslynator.CommandLine.*.nupkg"
Remove-Item "$outDir/Roslynator.DotNet.Cli.*.nupkg"
Remove-Item -Path "../src/CommandLine/bin/Release" -Recurse

orang delete "../src" -a d -n "bin,obj" l li e -i "packages,node_modules" l li e ne -t n --content-only -y su s
dotnet clean "../src/CommandLine.sln" `

dotnet publish "../src/CommandLine.sln" `
/p:Configuration=Release,RoslynatorCommandLine=true,Deterministic=true,TreatWarningsAsErrors=true,WarningsNotAsErrors="1591" `
/v:normal `
/m

dotnet pack -c Release --no-build -v normal /p:RoslynatorCommandLine=true "../src/CommandLine/CommandLine.csproj"

Copy-Item -Path "../src/CommandLine/bin/Release/Roslynator.CommandLine.*.nupkg" -Destination "$outDir"

orang delete "../src" -a d -n "bin,obj" l li e -i "packages,node_modules" l li e ne -t n --content-only -y su s
dotnet clean "../src/CommandLine.sln" `

dotnet pack "../src/CommandLine/CommandLine.csproj" -c Release -v normal `
/p:RoslynatorDotNetCli=true,Deterministic=true,TreatWarningsAsErrors=true,WarningsNotAsErrors="1591"

Copy-Item -Path "../src/CommandLine/bin/Release/Roslynator.DotNet.Cli.*.nupkg" -Destination "$outDir"

Write-Host OK

0 comments on commit e5da43f

Please sign in to comment.