From 2b759bdac845be3e2ebc9a484525564f62b814ec Mon Sep 17 00:00:00 2001 From: AliveDevil Date: Thu, 25 Jul 2024 13:23:11 +0200 Subject: [PATCH 1/2] Handle MSBuild properties NoWarn, TreatWarningsAsErrors, WarningsAsErrors --- src/IKVM.NET.Sdk/targets/IKVM.Java.Core.NoTasks.targets | 3 +++ src/IKVM.NET.Sdk/targets/IKVM.Java.Core.Tasks.targets | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/IKVM.NET.Sdk/targets/IKVM.Java.Core.NoTasks.targets b/src/IKVM.NET.Sdk/targets/IKVM.Java.Core.NoTasks.targets index f937f4ab5..f6e455458 100644 --- a/src/IKVM.NET.Sdk/targets/IKVM.Java.Core.NoTasks.targets +++ b/src/IKVM.NET.Sdk/targets/IKVM.Java.Core.NoTasks.targets @@ -277,6 +277,9 @@ Value = b.ToString(); <_IkvmCompilerArgs Include="-nologo" /> <_IkvmCompilerArgs Include="-bootstrap" Condition=" '$(Bootstrap)' == 'true' " /> <_IkvmCompilerArgs Include="-debug:$(DebugType)" Condition=" '$(DebugType)' != 'none' " /> + <_IkvmCompilerArgs Include="-nowarn:$(NoWarn)" Condition=" '$(NoWarn)' != '' " /> + <_IkvmCompilerArgs Include="-warnaserror" Condition=" '$(TreatWarningsAsErrors)' == 'true' " /> + <_IkvmCompilerArgs Include="-warnaserror:$(WarningsAsErrors)" Condition=" '$(TreatWarningsAsErrors)' != 'true' And '$(WarningsAsErrors)' != '' " /> <_IkvmCompilerArgs Include="-assembly:$(AssemblyName)" /> <_IkvmCompilerArgs Include="-version:$(AssemblyVersion)" /> <_IkvmCompilerArgs Include="-runtime:$(IkvmRuntimeAssembly)" /> diff --git a/src/IKVM.NET.Sdk/targets/IKVM.Java.Core.Tasks.targets b/src/IKVM.NET.Sdk/targets/IKVM.Java.Core.Tasks.targets index f0106ab7b..49b6f507f 100644 --- a/src/IKVM.NET.Sdk/targets/IKVM.Java.Core.Tasks.targets +++ b/src/IKVM.NET.Sdk/targets/IKVM.Java.Core.Tasks.targets @@ -126,6 +126,9 @@ Platform="$(PlatformTarget.ToLowerInvariant())" Main="$(StartupObject)" Debug="$(DebugType)" + NoWarn="$(NoWarn)" + WarnAsError="$(TreatWarningsAsErrors)" + WarnAsErrorWarnings="$(WarningsAsErrors)" KeyFile="$(KeyOriginatorFile)" CompressResources="$(CompressResources)" ClassLoader="$(ClassLoader)" From 5edd1d2e57d004a0a1ea7881837a44f03cd96ee8 Mon Sep 17 00:00:00 2001 From: AliveDevil Date: Thu, 25 Jul 2024 13:49:21 +0200 Subject: [PATCH 2/2] Fix args --- src/IKVM.NET.Sdk/targets/IKVM.Java.Core.NoTasks.targets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/IKVM.NET.Sdk/targets/IKVM.Java.Core.NoTasks.targets b/src/IKVM.NET.Sdk/targets/IKVM.Java.Core.NoTasks.targets index f6e455458..6125691e4 100644 --- a/src/IKVM.NET.Sdk/targets/IKVM.Java.Core.NoTasks.targets +++ b/src/IKVM.NET.Sdk/targets/IKVM.Java.Core.NoTasks.targets @@ -277,9 +277,9 @@ Value = b.ToString(); <_IkvmCompilerArgs Include="-nologo" /> <_IkvmCompilerArgs Include="-bootstrap" Condition=" '$(Bootstrap)' == 'true' " /> <_IkvmCompilerArgs Include="-debug:$(DebugType)" Condition=" '$(DebugType)' != 'none' " /> - <_IkvmCompilerArgs Include="-nowarn:$(NoWarn)" Condition=" '$(NoWarn)' != '' " /> + <_IkvmCompilerArgs Include="-nowarn:"$(NoWarn)"" Condition=" '$(NoWarn)' != '' " /> <_IkvmCompilerArgs Include="-warnaserror" Condition=" '$(TreatWarningsAsErrors)' == 'true' " /> - <_IkvmCompilerArgs Include="-warnaserror:$(WarningsAsErrors)" Condition=" '$(TreatWarningsAsErrors)' != 'true' And '$(WarningsAsErrors)' != '' " /> + <_IkvmCompilerArgs Include="-warnaserror:"$(WarningsAsErrors)"" Condition=" '$(TreatWarningsAsErrors)' != 'true' And '$(WarningsAsErrors)' != '' " /> <_IkvmCompilerArgs Include="-assembly:$(AssemblyName)" /> <_IkvmCompilerArgs Include="-version:$(AssemblyVersion)" /> <_IkvmCompilerArgs Include="-runtime:$(IkvmRuntimeAssembly)" />