From 2451b489a660786c5eacacb108d532a7131d8832 Mon Sep 17 00:00:00 2001 From: penev92 Date: Fri, 14 Apr 2023 13:16:33 +0300 Subject: [PATCH] Added clean before building for "make check" Copied over the cleaning part of OpenRA PR 20726. This is because `make check` only reports issues when doing a fresh build. --- Makefile | 3 ++- make.ps1 | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7dbd192e6..91097d1ae 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/make.ps1 b/make.ps1 index 4bf144a91..2fb4ed848 100644 --- a/make.ps1 +++ b/make.ps1 @@ -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) {