Skip to content

Commit

Permalink
Update scripts (#1239)
Browse files Browse the repository at this point in the history
  • Loading branch information
josefpihrt authored Nov 9, 2023
1 parent e886083 commit 324071a
Show file tree
Hide file tree
Showing 20 changed files with 64 additions and 57 deletions.
4 changes: 2 additions & 2 deletions tools/build_cli_debug.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dotnet clean "../src/CommandLine.sln" ` -c Debug
dotnet clean "$PSScriptRoot/../src/CommandLine.sln" ` -c Debug

dotnet build "../src/CommandLine.sln" -c Debug -v minimal /p:RoslynatorDotNetCli=true /m
dotnet build "$PSScriptRoot/../src/CommandLine.sln" -c Debug -v minimal /p:RoslynatorDotNetCli=true /m

Write-Host "DONE"
4 changes: 2 additions & 2 deletions tools/cli_add_file_banner.ps1
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#dotnet tool install -g roslynator.dotnet.cli

dotnet build "../src/CommandLine.sln" /p:Configuration=Debug /v:m /m
dotnet build "$PSScriptRoot/../src/CommandLine.sln" /p:Configuration=Debug /v:m /m

roslynator fix "../src/Roslynator.sln" `
roslynator fix "$PSScriptRoot/../src/Roslynator.sln" `
--verbosity d `
--file-log "roslynator.log" `
--file-log-verbosity diag `
Expand Down
10 changes: 5 additions & 5 deletions tools/cli_analyze.ps1
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#dotnet tool install -g roslynator.dotnet.cli

dotnet build "../src/CommandLine.sln" /p:Configuration=Debug /v:m /m
dotnet build "$PSScriptRoot/../src/CommandLine.sln" /p:Configuration=Debug /v:m /m

roslynator analyze "../src/Roslynator.sln" `
roslynator analyze "$PSScriptRoot/../src/Roslynator.sln" `
--analyzer-assemblies `
"../src/Analyzers.CodeFixes/bin/Debug/netstandard2.0/Roslynator.CSharp.Analyzers.dll" `
"../src/CodeAnalysis.Analyzers.CodeFixes/bin/Debug/netstandard2.0/Roslynator.CodeAnalysis.Analyzers.dll" `
"../src/Formatting.Analyzers.CodeFixes/bin/Debug/netstandard2.0/Roslynator.Formatting.Analyzers.dll" `
"$PSScriptRoot/../src/Analyzers.CodeFixes/bin/Debug/netstandard2.0/Roslynator.CSharp.Analyzers.dll" `
"$PSScriptRoot/../src/CodeAnalysis.Analyzers.CodeFixes/bin/Debug/netstandard2.0/Roslynator.CodeAnalysis.Analyzers.dll" `
"$PSScriptRoot/../src/Formatting.Analyzers.CodeFixes/bin/Debug/netstandard2.0/Roslynator.Formatting.Analyzers.dll" `
--ignore-analyzer-references `
--ignored-diagnostics CS1591 `
--severity-level info `
Expand Down
16 changes: 8 additions & 8 deletions tools/cli_fix.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@

$visualStudioPath = Get-VSSetupInstance -All | Select-VSSetupInstance -Require 'Microsoft.VisualStudio.Workload.ManagedDesktop' -Latest | Select-Object -ExpandProperty "InstallationPath"

dotnet build "../src/CommandLine.sln" /p:Configuration=Debug /v:m /m
dotnet build "$PSScriptRoot/../src/CommandLine.sln" /p:Configuration=Debug /v:m /m

roslynator fix "../src/Roslynator.sln" `
roslynator fix "$PSScriptRoot/../src/Roslynator.sln" `
--analyzer-assemblies `
"../src/Analyzers.CodeFixes/bin/Debug/netstandard2.0/Roslynator.CSharp.Analyzers.dll" `
"../src/Analyzers.CodeFixes/bin/Debug/netstandard2.0/Roslynator.CSharp.Analyzers.CodeFixes.dll" `
"../src/CodeAnalysis.Analyzers.CodeFixes/bin/Debug/netstandard2.0/Roslynator.CodeAnalysis.Analyzers.dll" `
"../src/CodeAnalysis.Analyzers.CodeFixes/bin/Debug/netstandard2.0/Roslynator.CodeAnalysis.Analyzers.CodeFixes.dll" `
"../src/Formatting.Analyzers.CodeFixes/bin/Debug/netstandard2.0/Roslynator.Formatting.Analyzers.dll" `
"../src/Formatting.Analyzers.CodeFixes/bin/Debug/netstandard2.0/Roslynator.Formatting.Analyzers.CodeFixes.dll" `
"$PSScriptRoot/../src/Analyzers.CodeFixes/bin/Debug/netstandard2.0/Roslynator.CSharp.Analyzers.dll" `
"$PSScriptRoot/../src/Analyzers.CodeFixes/bin/Debug/netstandard2.0/Roslynator.CSharp.Analyzers.CodeFixes.dll" `
"$PSScriptRoot/../src/CodeAnalysis.Analyzers.CodeFixes/bin/Debug/netstandard2.0/Roslynator.CodeAnalysis.Analyzers.dll" `
"$PSScriptRoot/../src/CodeAnalysis.Analyzers.CodeFixes/bin/Debug/netstandard2.0/Roslynator.CodeAnalysis.Analyzers.CodeFixes.dll" `
"$PSScriptRoot/../src/Formatting.Analyzers.CodeFixes/bin/Debug/netstandard2.0/Roslynator.Formatting.Analyzers.dll" `
"$PSScriptRoot/../src/Formatting.Analyzers.CodeFixes/bin/Debug/netstandard2.0/Roslynator.Formatting.Analyzers.CodeFixes.dll" `
"$visualStudioPath/Common7/IDE/CommonExtensions/Microsoft/VBCSharp/LanguageServices/Microsoft.CodeAnalysis.CSharp.EditorFeatures.dll" `
"$visualStudioPath/Common7/IDE/CommonExtensions/Microsoft/VBCSharp/LanguageServices/Microsoft.CodeAnalysis.CSharp.Features.dll" `
"$visualStudioPath/Common7/IDE/CommonExtensions/Microsoft/VBCSharp/LanguageServices/Microsoft.CodeAnalysis.EditorFeatures.dll" `
Expand Down
4 changes: 2 additions & 2 deletions tools/cli_format.ps1
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#dotnet tool install -g roslynator.dotnet.cli

dotnet build "../src/CommandLine.sln" /p:Configuration=Debug /v:m /m
dotnet build "$PSScriptRoot/../src/CommandLine.sln" /p:Configuration=Debug /v:m /m

roslynator format "../src/Roslynator.sln" `
roslynator format "$PSScriptRoot/../src/Roslynator.sln" `
--verbosity d `
--file-log "roslynator.log" `
--file-log-verbosity diag `
Expand Down
4 changes: 2 additions & 2 deletions tools/cli_lloc.ps1
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#dotnet tool install -g roslynator.dotnet.cli

dotnet build "../src/CommandLine.sln" /p:Configuration=Debug /v:m /m
dotnet build "$PSScriptRoot/../src/CommandLine.sln" /p:Configuration=Debug /v:m /m

roslynator lloc "../src/Roslynator.sln" `
roslynator lloc "$PSScriptRoot/../src/Roslynator.sln" `
--verbosity d `
--file-log "roslynator.log" `
--file-log-verbosity diag
4 changes: 2 additions & 2 deletions tools/cli_loc.ps1
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#dotnet tool install -g roslynator.dotnet.cli

dotnet build "../src/CommandLine.sln" /p:Configuration=Debug /v:m /m
dotnet build "$PSScriptRoot/../src/CommandLine.sln" /p:Configuration=Debug /v:m /m

roslynator loc "../src/Roslynator.sln" `
roslynator loc "$PSScriptRoot/../src/Roslynator.sln" `
--ignore-block-boundary `
--verbosity d `
--file-log "roslynator.log" `
Expand Down
2 changes: 1 addition & 1 deletion tools/copy_spelling_from_orang.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$spellingPath="../src/Workspaces.Core/Spelling/Core"
$spellingPath="$PSScriptRoot/../src/Workspaces.Core/Spelling/Core"

orang delete $spellingPath -e cs -n "Spellchecker.Identifier.cs" ne

Expand Down
2 changes: 2 additions & 0 deletions tools/generate_api_list.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#dotnet tool install -g roslynator.dotnet.cli

roslynator list-symbols generate_ref_docs.sln `
--properties Configuration=Release `
--visibility public `
Expand Down
8 changes: 4 additions & 4 deletions tools/generate_cli_docs.ps1
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
dotnet restore "../src/CommandLine.DocumentationGenerator/CommandLine.DocumentationGenerator.csproj"
dotnet restore "$PSScriptRoot/../src/CommandLine.DocumentationGenerator/CommandLine.DocumentationGenerator.csproj"

dotnet build "../src/CommandLine.DocumentationGenerator/CommandLine.DocumentationGenerator.csproj" -c Release -v minimal `
dotnet build "$PSScriptRoot/../src/CommandLine.DocumentationGenerator/CommandLine.DocumentationGenerator.csproj" -c Release -v minimal `
/p:Deterministic=true,TreatWarningsAsErrors=true,WarningsNotAsErrors="1591,RS1024,RS1025,RS1026" `

if(!$?) { Read-Host; Exit }

& "../src/CommandLine.DocumentationGenerator/bin/Release/net7.0/Roslynator.CommandLine.DocumentationGenerator.exe" `
& "$PSScriptRoot/../src/CommandLine.DocumentationGenerator/bin/Release/net7.0/Roslynator.CommandLine.DocumentationGenerator.exe" `
build `
"../src/CommandLine.DocumentationGenerator/data" `
"$PSScriptRoot/../src/CommandLine.DocumentationGenerator/data" `
"help,migrate"
6 changes: 3 additions & 3 deletions tools/generate_code.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dotnet restore "../src/Tools/Tools.sln" --force
dotnet build "../src/Tools/Tools.sln" --no-restore /p:Configuration=Release,Deterministic=true,TreatWarningsAsErrors=true,WarningsNotAsErrors="1591,RS1024,RS1025,RS1026" /m
dotnet restore "$PSScriptRoot/../src/Tools/Tools.sln" --force
dotnet build "$PSScriptRoot/../src/Tools/Tools.sln" --no-restore /p:Configuration=Release,Deterministic=true,TreatWarningsAsErrors=true,WarningsNotAsErrors="1591,RS1024,RS1025,RS1026" /m

if(!$?) { Read-Host; Exit }

dotnet "../src/Tools/CodeGenerator/bin/Release/net7.0/Roslynator.CodeGenerator.dll" "../src"
dotnet "$PSScriptRoot/../src/Tools/CodeGenerator/bin/Release/net7.0/Roslynator.CodeGenerator.dll" "../src"
8 changes: 4 additions & 4 deletions tools/generate_configuration_file.ps1
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
dotnet restore "../src/Tools/ConfigurationFileGenerator/ConfigurationFileGenerator.csproj" --force
dotnet build "../src/Tools/ConfigurationFileGenerator/ConfigurationFileGenerator.csproj" --no-restore /p:Configuration=Release,Deterministic=true,TreatWarningsAsErrors=true,WarningsNotAsErrors="1591,RS1024,RS1025,RS1026"
dotnet restore "$PSScriptRoot/../src/Tools/ConfigurationFileGenerator/ConfigurationFileGenerator.csproj" --force
dotnet build "$PSScriptRoot/../src/Tools/ConfigurationFileGenerator/ConfigurationFileGenerator.csproj" --no-restore /p:Configuration=Release,Deterministic=true,TreatWarningsAsErrors=true,WarningsNotAsErrors="1591,RS1024,RS1025,RS1026"

if(!$?) { Read-Host; Exit }

dotnet "../src/Tools/ConfigurationFileGenerator/bin/Release/net7.0/Roslynator.ConfigurationFileGenerator.dll" `
dotnet "$PSScriptRoot/../src/Tools/ConfigurationFileGenerator/bin/Release/net7.0/Roslynator.ConfigurationFileGenerator.dll" `
"../src" `
"../src/Tools/ConfigurationFileGenerator/configuration.md" `
"$PSScriptRoot/../src/Tools/ConfigurationFileGenerator/configuration.md" `
"build/configuration.md"
6 changes: 3 additions & 3 deletions tools/generate_metadata.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dotnet restore "../src/Tools/Tools.sln" --force
dotnet build "../src/Tools/Tools.sln" --no-restore /p:"Configuration=Release,Deterministic=true,TreatWarningsAsErrors=true,WarningsNotAsErrors=`"1591,RS1025,RS1026`"" /m
dotnet restore "$PSScriptRoot/../src/Tools/Tools.sln" --force
dotnet build "$PSScriptRoot/../src/Tools/Tools.sln" --no-restore /p:"Configuration=Release,Deterministic=true,TreatWarningsAsErrors=true,WarningsNotAsErrors=`"1591,RS1025,RS1026`"" /m

if(!$?) { Read-Host; Exit }

& "../src/Tools/MetadataGenerator/bin/Release/net7.0/Roslynator.MetadataGenerator" "../src" "build"
& "$PSScriptRoot/../src/Tools/MetadataGenerator/bin/Release/net7.0/Roslynator.MetadataGenerator" "../src" "build"
6 changes: 3 additions & 3 deletions tools/generate_ref_docs.ps1
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
dotnet restore generate_ref_docs.sln -v minimal /m
dotnet build generate_ref_docs.sln --no-restore -c Release -v minimal /m

dotnet restore "../src/CommandLine.sln" -v minimal /m
dotnet build "../src/CommandLine.sln" --no-restore -c Release -v minimal /m
dotnet restore "$PSScriptRoot/../src/CommandLine.sln" -v minimal /m
dotnet build "$PSScriptRoot/../src/CommandLine.sln" --no-restore -c Release -v minimal /m

& "../src/CommandLine/bin/Release/net7.0/Roslynator" generate-doc generate_ref_docs.sln `
& "$PSScriptRoot/../src/CommandLine/bin/Release/net7.0/Roslynator" generate-doc generate_ref_docs.sln `
--properties Configuration=Release `
-o "build/ref" `
--host docusaurus `
Expand Down
6 changes: 4 additions & 2 deletions tools/list_syntax_node_hierarchy.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
dotnet build "../src/CommandLine.sln" -c Debug -v minimal /m
#dotnet tool install -g roslynator.dotnet.cli

roslynator list-symbols "../src/CommandLine/CommandLine.csproj" `
dotnet build "$PSScriptRoot/../src/CommandLine.sln" -c Debug -v minimal /m

roslynator list-symbols "$PSScriptRoot/../src/CommandLine/CommandLine.csproj" `
--depth type `
--visibility public `
--external-assemblies Microsoft.CodeAnalysis.dll Microsoft.CodeAnalysis.CSharp.dll `
Expand Down
7 changes: 7 additions & 0 deletions tools/reinstall_cli.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Remove-Item -Path "$PSScriptRoot/../src/CommandLine/bin/Release/net7.0" -Recurse
Remove-Item -Path "$PSScriptRoot/../src/CommandLine/bin/Release/Roslynator.DotNet.Cli.*.nupkg"

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

dotnet tool uninstall roslynator.dotnet.cli -g
dotnet tool install roslynator.dotnet.cli -g --add-source "$PSScriptRoot/../src/CommandLine/bin/Release" --version 1.0.0
12 changes: 4 additions & 8 deletions tools/reinstall_cli_debug.ps1
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
Remove-Item -Path "../src/CommandLine/bin/Debug/net7.0" -Recurse
Remove-Item -Path "../src/CommandLine/bin/Debug/Roslynator.DotNet.Cli.*.nupkg"
Remove-Item -Path "$PSScriptRoot/../src/CommandLine/bin/Debug/net7.0" -Recurse
Remove-Item -Path "$PSScriptRoot/../src/CommandLine/bin/Debug/Roslynator.DotNet.Cli.*.nupkg"

dotnet pack "../src/CommandLine/CommandLine.csproj" -c Debug -v minimal `
/p:RoslynatorDotNetCli=true,Deterministic=true,TreatWarningsAsErrors=true,WarningsNotAsErrors="1591"
dotnet pack "$PSScriptRoot/../src/CommandLine/CommandLine.csproj" -c Debug -v minimal /p:RoslynatorDotNetCli=true,Deterministic=true

dotnet tool uninstall roslynator.dotnet.cli -g

dotnet tool install roslynator.dotnet.cli -g --add-source "../src/CommandLine/bin/Debug" --version 1.0.0

Write-Host DONE
dotnet tool install roslynator.dotnet.cli -g --add-source "$PSScriptRoot/../src/CommandLine/bin/Debug" --version 1.0.0
6 changes: 3 additions & 3 deletions tools/report_analyzers_execution_time.ps1
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
dotnet build "../src/Roslynator.sln" -c Release `
dotnet build "$PSScriptRoot/../src/Roslynator.sln" -c Release `
/p:ReportAnalyzer=True `
/fl `
/flp:Verbosity=diagnostic `
/m

if(!$?) { Read-Host; Exit }

dotnet build "../src/Tools/LogParser/LogParser.csproj" -c Release -v minimal /m
dotnet build "$PSScriptRoot/../src/Tools/LogParser/LogParser.csproj" -c Release -v minimal /m

dotnet "../src/Tools/LogParser/bin/Release/netcoreapp3.1/LogParser.dll" "msbuild.log"
dotnet "$PSScriptRoot/../src/Tools/LogParser/bin/Release/netcoreapp3.1/LogParser.dll" "msbuild.log"

Write-Host DONE
2 changes: 1 addition & 1 deletion tools/sn.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# https://docs.microsoft.com/cs-cz/dotnet/framework/tools/sn-exe-strong-name-tool

sn -Tp "../src/Core/bin/Debug/netstandard2.0/roslynator.core.dll"
sn -Tp "$PSScriptRoot/../src/Core/bin/Debug/netstandard2.0/roslynator.core.dll"
4 changes: 2 additions & 2 deletions tools/vsix_publish.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ $personalAccessToken = Read-Host -Prompt "Enter Personal Access Token"
Clear-Host

& $"$env:ProgramFiles/Microsoft Visual Studio/2022/Community/VSSDK/VisualStudioIntegration/Tools/Bin/VsixPublisher.exe" publish `
-payload "../src/VisualStudio/bin/Release/Roslynator.VisualStudio.$version.vsix" `
-publishManifest "../src/VisualStudio/manifest.json" `
-payload "$PSScriptRoot/../src/VisualStudio/bin/Release/Roslynator.VisualStudio.$version.vsix" `
-publishManifest "$PSScriptRoot/../src/VisualStudio/manifest.json" `
-personalAccessToken $personalAccessToken

Write-Host DONE

0 comments on commit 324071a

Please sign in to comment.