diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1-NRT/WriteInterface.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1-NRT/WriteInterface.txt index bf2f261cd..b5db9ed4f 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1-NRT/WriteInterface.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1-NRT/WriteInterface.txt @@ -1,4 +1,4 @@ -[Register ("java/code/IMyInterface", DoNotGenerateAcw=true)] +[Register ("mono/internal/java/code/IMyInterface", DoNotGenerateAcw=true)] public abstract class MyInterface : Java.Lang.Object { internal MyInterface () { @@ -19,7 +19,7 @@ public abstract class MyInterface : Java.Lang.Object { } -[Register ("java/code/IMyInterface", DoNotGenerateAcw=true)] +[Register ("mono/internal/java/code/IMyInterface", DoNotGenerateAcw=true)] [global::System.Obsolete (@"Use the 'MyInterface' type. This type will be removed in a future release.", error: true)] public abstract class MyInterfaceConsts : MyInterface { private MyInterfaceConsts () diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/ObsoleteInterfaceAlternativeClass.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/ObsoleteInterfaceAlternativeClass.txt index e14a7db52..e33507b67 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/ObsoleteInterfaceAlternativeClass.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/ObsoleteInterfaceAlternativeClass.txt @@ -1,4 +1,4 @@ -[Register ("com/xamarin/android/Parent", DoNotGenerateAcw=true)] +[Register ("mono/internal/com/xamarin/android/Parent", DoNotGenerateAcw=true)] [global::System.Obsolete (@"Use the 'Com.Xamarin.Android.IParent' type. This class will be removed in a future release.")] public abstract class Parent : Java.Lang.Object { internal Parent () diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteConstSugarInterfaceFields.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteConstSugarInterfaceFields.txt index 25e31bc37..b488f9a2f 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteConstSugarInterfaceFields.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteConstSugarInterfaceFields.txt @@ -1,4 +1,4 @@ -[Register ("java/code/IMyInterface", DoNotGenerateAcw=true)] +[Register ("mono/internal/java/code/IMyInterface", DoNotGenerateAcw=true)] public abstract class MyInterface : Java.Lang.Object { internal MyInterface () { diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterface.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterface.txt index 593da8196..9a0540855 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterface.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterface.txt @@ -1,4 +1,4 @@ -[Register ("java/code/IMyInterface", DoNotGenerateAcw=true)] +[Register ("mono/internal/java/code/IMyInterface", DoNotGenerateAcw=true)] public abstract class MyInterface : Java.Lang.Object { internal MyInterface () { @@ -19,7 +19,7 @@ public abstract class MyInterface : Java.Lang.Object { } -[Register ("java/code/IMyInterface", DoNotGenerateAcw=true)] +[Register ("mono/internal/java/code/IMyInterface", DoNotGenerateAcw=true)] [global::System.Obsolete (@"Use the 'MyInterface' type. This type will be removed in a future release.", error: true)] public abstract class MyInterfaceConsts : MyInterface { private MyInterfaceConsts () diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceFieldAsDimProperty.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceFieldAsDimProperty.txt index 399abba9d..f19f65d0f 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceFieldAsDimProperty.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceFieldAsDimProperty.txt @@ -1,4 +1,4 @@ -[Register ("com/xamarin/android/MyInterface", DoNotGenerateAcw=true)] +[Register ("mono/internal/com/xamarin/android/MyInterface", DoNotGenerateAcw=true)] public abstract class MyInterface : Java.Lang.Object { internal MyInterface () { @@ -32,7 +32,7 @@ public abstract class MyInterface : Java.Lang.Object { } -[Register ("com/xamarin/android/MyInterface", DoNotGenerateAcw=true)] +[Register ("mono/internal/com/xamarin/android/MyInterface", DoNotGenerateAcw=true)] [global::System.Obsolete (@"Use the 'MyInterface' type. This type will be removed in a future release.", error: true)] public abstract class MyInterfaceConsts : MyInterface { private MyInterfaceConsts () diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteStaticInterfaceMethod.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteStaticInterfaceMethod.txt index c0e0aab82..7a37f828b 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteStaticInterfaceMethod.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteStaticInterfaceMethod.txt @@ -1,4 +1,4 @@ -[Register ("java/code/IMyInterface", DoNotGenerateAcw=true)] +[Register ("mono/internal/java/code/IMyInterface", DoNotGenerateAcw=true)] public abstract class MyInterface : Java.Lang.Object { internal MyInterface () { @@ -19,7 +19,7 @@ public abstract class MyInterface : Java.Lang.Object { } -[Register ("java/code/IMyInterface", DoNotGenerateAcw=true)] +[Register ("mono/internal/java/code/IMyInterface", DoNotGenerateAcw=true)] [global::System.Obsolete (@"Use the 'MyInterface' type. This type will be removed in a future release.", error: true)] public abstract class MyInterfaceConsts : MyInterface { private MyInterfaceConsts () diff --git a/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.ITestInterface.cs b/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.ITestInterface.cs index 8f2af06b3..e82e59ef6 100644 --- a/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.ITestInterface.cs +++ b/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.ITestInterface.cs @@ -5,7 +5,7 @@ namespace Test.ME { - [Register ("test/me/TestInterface", DoNotGenerateAcw=true)] + [Register ("mono/internal/test/me/TestInterface", DoNotGenerateAcw=true)] public abstract class TestInterface : Java.Lang.Object { internal TestInterface () { @@ -31,7 +31,7 @@ internal TestInterface () } - [Register ("test/me/TestInterface", DoNotGenerateAcw=true)] + [Register ("mono/internal/test/me/TestInterface", DoNotGenerateAcw=true)] [global::System.Obsolete (@"Use the 'TestInterface' type. This type will be removed in a future release.", error: true)] public abstract class TestInterfaceConsts : TestInterface { private TestInterfaceConsts () diff --git a/tools/generator/SourceWriters/InterfaceMemberAlternativeClass.cs b/tools/generator/SourceWriters/InterfaceMemberAlternativeClass.cs index 8d99cb8e9..c247fceb7 100644 --- a/tools/generator/SourceWriters/InterfaceMemberAlternativeClass.cs +++ b/tools/generator/SourceWriters/InterfaceMemberAlternativeClass.cs @@ -39,7 +39,8 @@ public InterfaceMemberAlternativeClass (InterfaceGen iface, CodeGenerationOption SourceWriterExtensions.AddSupportedOSPlatform (Attributes, iface, opt); - Attributes.Add (new RegisterAttr (iface.RawJniName, noAcw: true, additionalProperties: iface.AdditionalAttributeString ()) { AcwLast = true }); + // Place this class in a dummy package that won't conflict the actual interface + Attributes.Add (new RegisterAttr ("mono/internal/" + iface.RawJniName, noAcw: true, additionalProperties: iface.AdditionalAttributeString ()) { AcwLast = true }); if (should_obsolete) SourceWriterExtensions.AddObsolete (Attributes, $"Use the '{iface.FullName}' type. This class will be removed in a future release.", opt); @@ -179,7 +180,9 @@ public InterfaceConstsForwardClass (InterfaceGen iface, CodeGenerationOptions op IsPublic = true; IsAbstract = true; - Attributes.Add (new RegisterAttr (iface.RawJniName, noAcw: true, additionalProperties: iface.AdditionalAttributeString ())); + // Place this class in a dummy package that won't conflict the actual interface + Attributes.Add (new RegisterAttr ("mono/internal/" + iface.RawJniName, noAcw: true, additionalProperties: iface.AdditionalAttributeString ())); + SourceWriterExtensions.AddObsolete (Attributes, $"Use the '{iface.Name.Substring (1)}' type. This type will be removed in a future release.", opt, isError: true); Constructors.Add (new ConstructorWriter {