From 740fa747250eb780eb829e4003826177204d0c43 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 13 Jan 2021 12:54:16 +0100 Subject: [PATCH] Do not check for NET5_0_OR_GREATER Context: https://github.com/xamarin/java.interop/issues/777 Looks like this define will not be added, so check for `NET` instead. --- .../NamespaceMapping.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/NamespaceMapping.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/NamespaceMapping.cs index b0d62d41b..96026d0eb 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/NamespaceMapping.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/NamespaceMapping.cs @@ -35,7 +35,7 @@ public void Generate (CodeGenerationOptions opt, GenerationInfo gen_info) // [SupportedOSPlatform] only exists in .NET 5.0+, so we need to generate a // dummy one so earlier frameworks can compile. if (opt.CodeGenerationTarget == Xamarin.Android.Binder.CodeGenerationTarget.XAJavaInterop1) { - sw.WriteLine ("#if !NET5_0_OR_GREATER"); + sw.WriteLine ("#if !NET"); sw.WriteLine ("namespace System.Runtime.Versioning {"); sw.WriteLine (" [System.Diagnostics.Conditional(\"NEVER\")]"); sw.WriteLine (" [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Event | AttributeTargets.Method | AttributeTargets.Module | AttributeTargets.Property | AttributeTargets.Struct, AllowMultiple = true, Inherited = false)]");