summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-06-20 18:01:48 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-06-20 18:01:48 -0400
commitdab1ef6acc243726247cee57877c3b3100106522 (patch)
tree627610696a998621327fb019586f956b9360bb95 /build
parente0ef8a20a5e7ccf1de32ff1a06f1aa62e37eb1db (diff)
downloadSMAPI-dab1ef6acc243726247cee57877c3b3100106522.tar.gz
SMAPI-dab1ef6acc243726247cee57877c3b3100106522.tar.bz2
SMAPI-dab1ef6acc243726247cee57877c3b3100106522.zip
add flag to disable deprecated code
Diffstat (limited to 'build')
-rw-r--r--build/common.targets18
1 files changed, 11 insertions, 7 deletions
diff --git a/build/common.targets b/build/common.targets
index 8b17c45a..92fd9a9a 100644
--- a/build/common.targets
+++ b/build/common.targets
@@ -5,6 +5,7 @@
<Product>SMAPI</Product>
<LangVersion>latest</LangVersion>
<AssemblySearchPaths>$(AssemblySearchPaths);{GAC}</AssemblySearchPaths>
+ <DefineConstants>$(DefineConstants);SMAPI_DEPRECATED</DefineConstants>
<!--enable nullable annotations, except in .NET Standard 2.0 where they aren't supported-->
<Nullable Condition="'$(TargetFramework)' != 'netstandard2.0'">enable</Nullable>
@@ -20,14 +21,17 @@
<!--
suppress warnings that don't apply, so it's easier to spot actual issues.
- warning | builds | summary | rationale
- ┄┄┄┄┄┄┄ | ┄┄┄┄┄┄┄ | ┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄ | ┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
- CS0436 | all | local type conflicts with imported type | SMAPI needs to use certain low-level code during very early compatibility checks, before it's safe to load any other DLLs.
- CA1416 | all | platform code available on all platforms | Compiler doesn't recognize the #if constants used by SMAPI.
- CS0809 | all | obsolete overload for non-onsolete member | This is deliberate to signal to mods that certain APIs are only implemented for the game and shouldn't be called by mods.
- NU1701 | all | NuGet package targets older .NET version | All such packages are carefully tested to make sure they do work.
+ warning | builds | summary | rationale
+ ┄┄┄┄┄┄┄ | ┄┄┄┄┄┄┄┄┄┄ | ┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄ | ┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
+ CS0436 | all | local type conflicts with imported type | SMAPI needs to use certain low-level code during very early compatibility checks, before it's safe to load any other DLLs.
+ CS0612 | deprecated | member is obsolete | internal references to deprecated code when deprecated code is enabled.
+ CS0618 | deprecated | member is obsolete (with message) | internal references to deprecated code when deprecated code is enabled.
+ CA1416 | all | platform code available on all platforms | Compiler doesn't recognize the #if constants used by SMAPI.
+ CS0809 | all | obsolete overload for non-obsolete member | This is deliberate to signal to mods that certain APIs are only implemented for the game and shouldn't be called by mods.
+ NU1701 | all | NuGet package targets older .NET version | All such packages are carefully tested to make sure they do work.
-->
- <NoWarn>$(NoWarn);CS0436;CA1416;CS0809;NU1701</NoWarn>
+ <NoWarn Condition="$(DefineConstants.Contains(SMAPI_DEPRECATED))">$(NoWarn);CS0612;CS0618</NoWarn>
+ <NoWarn>$(NoWarn);CS0436;CA1416;CS0809;NU1701</NoWarn>
</PropertyGroup>
<!--find game folder-->