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) {