Skip to content

Commit d41793a

Browse files
authored
[generator] Remove support for --codegen-target=XamarinAndroid (#1121)
Context: 29f9707 Context: be2acbc Context: dotnet/android@835c59b .NET Android does not support `generator --codegen-target=XamarinAndroid`, because we wanted .NET Android to support binding Java Interface Default Methods by default, which in turn requires using `JniPeerMembers` and C# support static fields within `interface`s. Now that we have removed support for Classic Xamarin.Android (be2acbc), we can begin to remove Classic-only features. The changes to `generator` aren't very interesting, however some changes were required in our test suites: * Remove `XamarinAndroid` tests * Update `Integration-Tests` to move shared test inputs like `Adapters.xml` from `expected` to `expected-ji` TODO: turn XA4232 into an error, not a warning.
1 parent 738de61 commit d41793a

File tree

241 files changed

+158
-14437
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

241 files changed

+158
-14437
lines changed

src/Java.Interop.Localization/Resources.Designer.cs

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Java.Interop.Localization/Resources.resx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,6 @@ In this message, the term "constants" refers to class or interface members that
146146
<value>Unexpected 'global::' specification. This error happens if 'global::' is specified in the Metadata.xml transform file, for example.</value>
147147
<comment>The following are literal names and should not be translated: global::, Metadata.xml.</comment>
148148
</data>
149-
<data name="Generator_BG4500" xml:space="preserve">
150-
<value>'lang-features=default-interface-methods' is not compatible with 'codegen-target=xamarinandroid'.</value>
151-
<comment>The following are literal command line arguments and should not be translated: 'lang-features=default-interface-methods', 'codegen-target=xamarinandroid'.</comment>
152-
</data>
153149
<data name="Generator_BG8101" xml:space="preserve">
154150
<value>Unexpected class child {0}.</value>
155151
<comment>{0} - The unexpected child class.</comment>

src/Java.Interop.Tools.Generator/Utilities/Report.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ public LocalizedMessage (int code, string value)
3333
public static LocalizedMessage ErrorRemoveAttrInvalidXPath => new LocalizedMessage (0x4306, Localization.Resources.Generator_BG4300);
3434
public static LocalizedMessage ErrorMissingAttrName => new LocalizedMessage (0x4307, Localization.Resources.Generator_BG4307);
3535
public static LocalizedMessage ErrorUnexpectedGlobal => new LocalizedMessage (0x4400, Localization.Resources.Generator_BG4400);
36-
public static LocalizedMessage ErrorInvalidDIMArgument => new LocalizedMessage (0x4500, Localization.Resources.Generator_BG4500);
3736

3837
public static LocalizedMessage WarningUnexpectedChild => new LocalizedMessage (0x8101, Localization.Resources.Generator_BG8101);
3938
public static LocalizedMessage WarningUnknownBaseType => new LocalizedMessage (0x8102, Localization.Resources.Generator_BG8102);

tests/generator-Tests/Integration-Tests/AccessModifiers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public void GeneratedOK ()
1111
{
1212
RunAllTargets (
1313
outputRelativePath: "AccessModifiers",
14-
apiDescriptionFile: "expected/AccessModifiers/AccessModifiers.xml",
14+
apiDescriptionFile: "expected.ji/AccessModifiers/AccessModifiers.xml",
1515
expectedRelativePath: "AccessModifiers",
1616
additionalSupportPaths: null);
1717
}

tests/generator-Tests/Integration-Tests/Adapters.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using NUnit.Framework;
33

44
namespace generatortests
@@ -13,9 +13,9 @@ public void GeneratedOK ()
1313
{
1414
RunAllTargets (
1515
outputRelativePath: "Adapters",
16-
apiDescriptionFile: "expected/Adapters/Adapters.xml",
16+
apiDescriptionFile: "expected.ji/Adapters/Adapters.xml",
1717
expectedRelativePath: "Adapters",
18-
additionalSupportPaths: new[]{ "expected/Adapters/SupportFiles" });
18+
additionalSupportPaths: new[]{ "expected.ji/Adapters/SupportFiles" });
1919
}
2020
}
2121
}

tests/generator-Tests/Integration-Tests/Android_Graphics_Color.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using NUnit.Framework;
33

44
namespace generatortests
@@ -11,7 +11,7 @@ public void GeneratedOK ()
1111
{
1212
RunAllTargets (
1313
outputRelativePath: "Android.Graphics.Color",
14-
apiDescriptionFile: "expected/Android.Graphics.Color/Android.Graphics.Color.xml",
14+
apiDescriptionFile: "expected.ji/Android.Graphics.Color/Android.Graphics.Color.xml",
1515
expectedRelativePath: "Android.Graphics.Color");
1616
}
1717
}

tests/generator-Tests/Integration-Tests/Arrays.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using NUnit.Framework;
33

44
namespace generatortests
@@ -11,7 +11,7 @@ public void GeneratedOK ()
1111
{
1212
RunAllTargets (
1313
outputRelativePath: "Arrays",
14-
apiDescriptionFile: "expected/Arrays/Arrays.xml",
14+
apiDescriptionFile: "expected.ji/Arrays/Arrays.xml",
1515
expectedRelativePath: "Arrays");
1616
}
1717
}

tests/generator-Tests/Integration-Tests/BaseGeneratorTest.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ private byte[] ReadAllBytesIgnoringLineEndings (string path)
123123

124124
protected void RunAllTargets (string outputRelativePath, string apiDescriptionFile, string expectedRelativePath, string[] additionalSupportPaths = null, string enumFieldsMapFile = null, string enumMethodMapFile = null, string metadataFile = null)
125125
{
126-
Run (CodeGenerationTarget.XamarinAndroid, Path.Combine ("out", outputRelativePath), apiDescriptionFile, Path.Combine ("expected", expectedRelativePath), additionalSupportPaths, enumFieldsMapFile, enumMethodMapFile, metadataFile);
127126
Run (CodeGenerationTarget.XAJavaInterop1, Path.Combine ("out.xaji", outputRelativePath), apiDescriptionFile, Path.Combine ("expected.xaji", expectedRelativePath), additionalSupportPaths, enumFieldsMapFile, enumMethodMapFile, metadataFile);
128127
#if NET
129128
if (TryJavaInterop1) {

tests/generator-Tests/Integration-Tests/CSharpKeywords.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public void GeneratedOK ()
1111
{
1212
RunAllTargets (
1313
outputRelativePath: "CSharpKeywords",
14-
apiDescriptionFile: "expected/CSharpKeywords/CSharpKeywords.xml",
14+
apiDescriptionFile: "expected.ji/CSharpKeywords/CSharpKeywords.xml",
1515
expectedRelativePath: "CSharpKeywords");
1616
}
1717
}

tests/generator-Tests/Integration-Tests/Constructors.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using NUnit.Framework;
33

44
namespace generatortests
@@ -11,7 +11,7 @@ public void GeneratedOK ()
1111
{
1212
RunAllTargets (
1313
outputRelativePath: "Constructors",
14-
apiDescriptionFile: "expected/Constructors/Constructors.xml",
14+
apiDescriptionFile: "expected.ji/Constructors/Constructors.xml",
1515
expectedRelativePath: "Constructors");
1616
}
1717
}

0 commit comments

Comments
 (0)