Skip to content

Commit

Permalink
Added clean before building for "make check"
Browse files Browse the repository at this point in the history
Copied over the cleaning part of OpenRA PR 20726. This is because `make check` only reports issues when doing a fresh build.
  • Loading branch information
penev92 authored and abcdefg30 committed Jun 11, 2023
1 parent 50ccec2 commit 2451b48
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,10 @@ ifneq ("$(MOD_SOLUTION_FILES)","")
@echo "Compiling in Debug mode..."
ifeq ($(RUNTIME), mono)
# Enabling EnforceCodeStyleInBuild and GenerateDocumentationFile as a workaround for some code style rules (in particular IDE0005) being bugged and not reporting warnings/errors otherwise.
@$(MSBUILD) -t:build -restore -p:Configuration=Debug -warnaserror -p:TargetPlatform=$(TARGETPLATFORM) -p:Mono=true -p:EnforceCodeStyleInBuild=true -p:GenerateDocumentationFile=true
@$(MSBUILD) -t:clean\;build -restore -p:Configuration=Debug -warnaserror -p:TargetPlatform=$(TARGETPLATFORM) -p:Mono=true -p:EnforceCodeStyleInBuild=true -p:GenerateDocumentationFile=true
else
# Enabling EnforceCodeStyleInBuild and GenerateDocumentationFile as a workaround for some code style rules (in particular IDE0005) being bugged and not reporting warnings/errors otherwise.
@$(DOTNET) clean -c Debug --nologo --verbosity minimal
@$(DOTNET) build -c Debug -nologo -warnaserror -p:TargetPlatform=$(TARGETPLATFORM) -p:EnforceCodeStyleInBuild=true -p:GenerateDocumentationFile=true
endif
endif
Expand Down
1 change: 1 addition & 0 deletions make.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ function Check-Command
Write-Host "Compiling $modID in Debug configuration..." -ForegroundColor Cyan

# Enabling EnforceCodeStyleInBuild and GenerateDocumentationFile as a workaround for some code style rules (in particular IDE0005) being bugged and not reporting warnings/errors otherwise.
dotnet clean -c Debug --nologo --verbosity minimal
dotnet build -c Debug --nologo -warnaserror -p:TargetPlatform=win-x64 -p:EnforceCodeStyleInBuild=true -p:GenerateDocumentationFile=true
if ($lastexitcode -ne 0)
{
Expand Down

0 comments on commit 2451b48

Please sign in to comment.