@@ -32,21 +32,20 @@ public void Generate (CodeGenerationOptions opt, GenerationInfo gen_info)
3232 foreach ( var jni in opt . GetJniMarshalDelegates ( ) )
3333 sw . WriteLine ( $ "delegate { FromJniType ( jni [ jni . Length - 1 ] ) } { jni } (IntPtr jnienv, IntPtr klass{ GetDelegateParameters ( jni ) } );") ;
3434
35- // Disabled until we can properly build .NET 5/6 assemblies in our XA tree.
3635 // [SupportedOSPlatform] only exists in .NET 5.0+, so we need to generate a
3736 // dummy one so earlier frameworks can compile.
38- // if (opt.CodeGenerationTarget == Xamarin.Android.Binder.CodeGenerationTarget.XAJavaInterop1) {
39- // sw.WriteLine ("#if !NET");
40- // sw.WriteLine ("namespace System.Runtime.Versioning {");
41- // sw.WriteLine (" [System.Diagnostics.Conditional(\"NEVER\")]");
42- // sw.WriteLine (" [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Event | AttributeTargets.Method | AttributeTargets.Module | AttributeTargets.Property | AttributeTargets.Struct, AllowMultiple = true, Inherited = false)]");
43- // sw.WriteLine (" internal sealed class SupportedOSPlatformAttribute : Attribute {");
44- // sw.WriteLine (" public SupportedOSPlatformAttribute (string platformName) { }");
45- // sw.WriteLine (" }");
46- // sw.WriteLine ("}");
47- // sw.WriteLine ("#endif");
48- // sw.WriteLine ("");
49- // }
37+ if ( opt . CodeGenerationTarget == Xamarin . Android . Binder . CodeGenerationTarget . XAJavaInterop1 ) {
38+ sw . WriteLine ( "#if !NET" ) ;
39+ sw . WriteLine ( "namespace System.Runtime.Versioning {" ) ;
40+ sw . WriteLine ( " [System.Diagnostics.Conditional(\" NEVER\" )]" ) ;
41+ sw . WriteLine ( " [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Event | AttributeTargets.Method | AttributeTargets.Module | AttributeTargets.Property | AttributeTargets.Struct, AllowMultiple = true, Inherited = false)]" ) ;
42+ sw . WriteLine ( " internal sealed class SupportedOSPlatformAttribute : Attribute {" ) ;
43+ sw . WriteLine ( " public SupportedOSPlatformAttribute (string platformName) { }" ) ;
44+ sw . WriteLine ( " }" ) ;
45+ sw . WriteLine ( "}" ) ;
46+ sw . WriteLine ( "#endif" ) ;
47+ sw . WriteLine ( "" ) ;
48+ }
5049 }
5150 }
5251
0 commit comments