Skip to content

Commit d2c1c45

Browse files
committed
Fixes after rebase on main
1 parent c966e07 commit d2c1c45

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/FindTypeMapObjectsStep.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,14 @@ public void ProcessAssembly (AssemblyDefinition assembly, StepContext context)
3838

3939
var xml = new TypeMapObjectsXmlFile {
4040
AssemblyName = assembly.Name.Name,
41+
AssemblyMvid = assembly.MainModule.Mvid,
4142
};
4243

4344
if (Debug) {
44-
var (javaToManaged, managedToJava, foundJniNativeRegistration) = TypeMapCecilAdapter.GetDebugNativeEntries (types, Context);
45+
var (typeMapDebugSets, foundJniNativeRegistration) = TypeMapCecilAdapter.GetDebugNativeEntries (types, Context, needUniqueAssemblies: false);
4546

46-
xml.JavaToManagedDebugEntries.AddRange (javaToManaged);
47-
xml.ManagedToJavaDebugEntries.AddRange (managedToJava);
47+
xml.JavaToManagedDebugEntries.AddRange (typeMapDebugSets.JavaToManaged);
48+
xml.ManagedToJavaDebugEntries.AddRange (typeMapDebugSets.ManagedToJava);
4849
xml.FoundJniNativeRegistration = foundJniNativeRegistration;
4950
} else {
5051
var genState = TypeMapCecilAdapter.GetReleaseGenerationState (types, Context, out var foundJniNativeRegistration);

src/Xamarin.Android.Build.Tasks/Utilities/TypeMapObjectsXmlFile.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class TypeMapObjectsXmlFile
2626
static readonly TypeMapObjectsXmlFile unscanned = new TypeMapObjectsXmlFile { WasScanned = false };
2727

2828
public string? AssemblyName { get; set; }
29+
public Guid AssemblyMvid { get; set; } = Guid.Empty;
2930
public bool FoundJniNativeRegistration { get; set; }
3031
public List<TypeMapDebugEntry> JavaToManagedDebugEntries { get; } = [];
3132
public List<TypeMapDebugEntry> ManagedToJavaDebugEntries { get; } = [];
@@ -59,6 +60,10 @@ void Export (XmlWriter xml)
5960
xml.WriteStartElement ("api");
6061
xml.WriteAttributeString ("type", HasDebugEntries ? "debug" : "release");
6162
xml.WriteAttributeStringIfNotDefault ("assembly-name", AssemblyName);
63+
64+
if (AssemblyMvid != Guid.Empty) {
65+
xml.WriteAttributeString ("mvid", AssemblyMvid.ToString ("N"));
66+
}
6267
xml.WriteAttributeStringIfNotDefault ("found-jni-native-registration", FoundJniNativeRegistration);
6368

6469
if (HasDebugEntries)
@@ -174,11 +179,13 @@ public static TypeMapObjectsXmlFile Import (string filename)
174179

175180
var type = root.GetRequiredAttribute ("type");
176181
var assemblyName = root.GetAttributeOrDefault ("assembly-name", (string?)null);
182+
var mvid = Guid.Parse (root.GetAttributeOrDefault ("mvid", Guid.Empty.ToString ()));
177183
var foundJniNativeRegistration = root.GetAttributeOrDefault ("found-jni-native-registration", false);
178184

179185
var file = new TypeMapObjectsXmlFile {
180186
WasScanned = true,
181187
AssemblyName = assemblyName,
188+
AssemblyMvid = mvid,
182189
FoundJniNativeRegistration = foundJniNativeRegistration,
183190
};
184191

0 commit comments

Comments
 (0)