Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ public IList<string> Merge (TaskLoggingHelper log, TypeDefinitionCache cache, Li
if (PackageName == null)
PackageName = t.Namespace;

var name = JavaNativeTypeManager.ToJniName (t).Replace ('/', '.');
var name = JavaNativeTypeManager.ToJniName (t, cache).Replace ('/', '.');
var compatName = JavaNativeTypeManager.ToCompatJniName (t, cache).Replace ('/', '.');
if (((string) app.Attribute (attName)) == compatName) {
app.SetAttributeValue (attName, name);
Expand Down Expand Up @@ -927,7 +927,7 @@ void AddInstrumentations (XElement manifest, IList<TypeDefinition> subclasses, i

foreach (var type in subclasses)
if (type.IsSubclassOf ("Android.App.Instrumentation", cache)) {
var xe = InstrumentationFromTypeDefinition (type, JavaNativeTypeManager.ToJniName (type).Replace ('/', '.'), targetSdkVersion);
var xe = InstrumentationFromTypeDefinition (type, JavaNativeTypeManager.ToJniName (type, cache).Replace ('/', '.'), targetSdkVersion);
if (xe != null)
manifest.Add (xe);
}
Expand Down
14 changes: 7 additions & 7 deletions src/Xamarin.Android.Build.Tasks/Utilities/TypeMapGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public bool Generate (bool debugBuild, bool skipJniAddNativeMethodRegistrationAt
return GenerateDebug (skipJniAddNativeMethodRegistrationAttributeScan, javaTypes, cache, typemapsOutputDirectory, generateNativeAssembly, appConfState);
}

return GenerateRelease (skipJniAddNativeMethodRegistrationAttributeScan, javaTypes, typemapsOutputDirectory, appConfState);
return GenerateRelease (skipJniAddNativeMethodRegistrationAttributeScan, javaTypes, cache, typemapsOutputDirectory, appConfState);
}

bool GenerateDebug (bool skipJniAddNativeMethodRegistrationAttributeScan, List<TypeDefinition> javaTypes, TypeDefinitionCache cache, string outputDirectory, bool generateNativeAssembly, ApplicationConfigTaskState appConfState)
Expand Down Expand Up @@ -186,7 +186,7 @@ bool GenerateDebugFiles (bool skipJniAddNativeMethodRegistrationAttributeScan, L
modules.Add (moduleName, module);
}

TypeMapDebugEntry entry = GetDebugEntry (td);
TypeMapDebugEntry entry = GetDebugEntry (td, cache);
HandleDebugDuplicates (javaDuplicates, entry, td, cache);
if (entry.JavaName.Length > module.JavaNameWidth)
module.JavaNameWidth = (uint)entry.JavaName.Length + 1;
Expand Down Expand Up @@ -227,7 +227,7 @@ bool GenerateDebugNativeAssembly (bool skipJniAddNativeMethodRegistrationAttribu
foreach (TypeDefinition td in javaTypes) {
UpdateApplicationConfig (td, appConfState);

TypeMapDebugEntry entry = GetDebugEntry (td);
TypeMapDebugEntry entry = GetDebugEntry (td, cache);
HandleDebugDuplicates (javaDuplicates, entry, td, cache);

javaToManaged.Add (entry);
Expand Down Expand Up @@ -300,10 +300,10 @@ void PrepareDebugMaps (ModuleDebugData module)
}
}

TypeMapDebugEntry GetDebugEntry (TypeDefinition td)
TypeMapDebugEntry GetDebugEntry (TypeDefinition td, TypeDefinitionCache cache)
{
return new TypeMapDebugEntry {
JavaName = Java.Interop.Tools.TypeNameMappings.JavaNativeTypeManager.ToJniName (td),
JavaName = Java.Interop.Tools.TypeNameMappings.JavaNativeTypeManager.ToJniName (td, cache),
ManagedName = GetManagedTypeName (td),
TypeDefinition = td,
SkipInJavaToManaged = ShouldSkipInJavaToManaged (td),
Expand All @@ -330,7 +330,7 @@ string GetManagedTypeName (TypeDefinition td)
return $"{managedTypeName}, {td.Module.Assembly.Name.Name}";
}

bool GenerateRelease (bool skipJniAddNativeMethodRegistrationAttributeScan, List<TypeDefinition> javaTypes, string outputDirectory, ApplicationConfigTaskState appConfState)
bool GenerateRelease (bool skipJniAddNativeMethodRegistrationAttributeScan, List<TypeDefinition> javaTypes, TypeDefinitionCache cache, string outputDirectory, ApplicationConfigTaskState appConfState)
{
int assemblyId = 0;
var knownAssemblies = new Dictionary<string, int> (StringComparer.Ordinal);
Expand Down Expand Up @@ -373,7 +373,7 @@ bool GenerateRelease (bool skipJniAddNativeMethodRegistrationAttributeScan, List
tempModules.Add (moduleUUID, moduleData);
}

string javaName = Java.Interop.Tools.TypeNameMappings.JavaNativeTypeManager.ToJniName (td);
string javaName = Java.Interop.Tools.TypeNameMappings.JavaNativeTypeManager.ToJniName (td, cache);
// We will ignore generic types and interfaces when generating the Java to Managed map, but we must not
// omit them from the table we output - we need the same number of entries in both java-to-managed and
// managed-to-java tables. `SkipInJavaToManaged` set to `true` will cause the native assembly generator
Expand Down