diff --git a/Directory.Build.props b/Directory.Build.props index 38044c099..fbd99082a 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -91,6 +91,20 @@ <_RunJNIEnvGen Condition=" '$(JIBuildingForNetCoreApp)' != 'True' ">$(Runtime) "$(_JNIEnvGenPath)" + + + $(NoWarn);CS8032 + + AllEnabledByDefault diff --git a/src/Java.Base/Java.Base.csproj b/src/Java.Base/Java.Base.csproj index b9728073b..5be4deceb 100644 --- a/src/Java.Base/Java.Base.csproj +++ b/src/Java.Base/Java.Base.csproj @@ -4,7 +4,7 @@ net6.0 true enable - 8764 + $(NoWarn);8764 diff --git a/src/Java.Base/Java.Base.targets b/src/Java.Base/Java.Base.targets index 2bb3d9ccd..bf23f6dde 100644 --- a/src/Java.Base/Java.Base.targets +++ b/src/Java.Base/Java.Base.targets @@ -1,7 +1,7 @@  - $(ToolOutputFullPath)generator.dll + $(UtilityOutputFullPath)generator.dll @@ -17,7 +17,7 @@ Outputs="$(IntermediateOutputPath)\mcw\api.xml"> - <_ClassParse>"$(ToolOutputFullPath)class-parse.dll" + <_ClassParse>"$(UtilityOutputFullPath)class-parse.dll" <_Input>"$(_JavaBaseJmod)" <_Output>"-o=$(IntermediateOutputPath)/mcw/api.xml" diff --git a/src/Java.Interop/Java.Interop-MonoAndroid.csproj b/src/Java.Interop/Java.Interop-MonoAndroid.csproj index 4aaf58ba6..ef9875bb1 100644 --- a/src/Java.Interop/Java.Interop-MonoAndroid.csproj +++ b/src/Java.Interop/Java.Interop-MonoAndroid.csproj @@ -11,7 +11,7 @@ Java.Interop Java.Interop v4.5 - 1591 + $(NoWarn);1591 true ..\..\product.snk 8.0 diff --git a/src/Java.Interop/Java.Interop.csproj b/src/Java.Interop/Java.Interop.csproj index ee91dd585..1ee9e3c10 100644 --- a/src/Java.Interop/Java.Interop.csproj +++ b/src/Java.Interop/Java.Interop.csproj @@ -17,7 +17,7 @@ netstandard2.0;net6.0 - 1591 + $(NoWarn);1591 true ..\..\product.snk INTEROP;FEATURE_JNIENVIRONMENT_JI_PINVOKES;FEATURE_JNIOBJECTREFERENCE_INTPTRS;INTERNAL_NULLABLE_ATTRIBUTES;$(JavaInteropDefineConstants) diff --git a/src/Java.Interop/Java.Interop/JavaTypeParametersAttribute.cs b/src/Java.Interop/Java.Interop/JavaTypeParametersAttribute.cs index a482636b1..735a19251 100644 --- a/src/Java.Interop/Java.Interop/JavaTypeParametersAttribute.cs +++ b/src/Java.Interop/Java.Interop/JavaTypeParametersAttribute.cs @@ -1,5 +1,7 @@ using System; +#if NET + namespace Java.Interop { [AttributeUsage (AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.Method, @@ -14,3 +16,5 @@ public JavaTypeParametersAttribute (string [] typeParameters) public string [] TypeParameters { get; } } } + +#endif // NET diff --git a/tests/generator-Tests/Integration-Tests/Compiler.cs b/tests/generator-Tests/Integration-Tests/Compiler.cs index b49f94e3e..b0386cf9a 100644 --- a/tests/generator-Tests/Integration-Tests/Compiler.cs +++ b/tests/generator-Tests/Integration-Tests/Compiler.cs @@ -40,6 +40,9 @@ public static Assembly Compile (Xamarin.Android.Binder.CodeGeneratorOptions opti if (options.CodeGenerationTarget == CodeGenerationTarget.JavaInterop1) { preprocessorSymbols.Add ("JAVA_INTEROP1"); } +#if NET + preprocessorSymbols.Add ("NET"); +#endif // NET var parseOptions = new CSharpParseOptions (preprocessorSymbols:preprocessorSymbols); diff --git a/tests/generator-Tests/SupportFiles/JavaTypeParametersAttribute.cs b/tests/generator-Tests/SupportFiles/JavaTypeParametersAttribute.cs new file mode 100644 index 000000000..3f25e0b93 --- /dev/null +++ b/tests/generator-Tests/SupportFiles/JavaTypeParametersAttribute.cs @@ -0,0 +1,18 @@ +#if !NET + +using System; + +namespace Java.Interop +{ + public class JavaTypeParametersAttribute : Attribute + { + public JavaTypeParametersAttribute (string [] typeParameters) + { + TypeParameters = typeParameters; + } + + public string [] TypeParameters { get; set; } + } +} + +#endif // !NET