Skip to content

Commit b25e99d

Browse files
[One .NET] support for multiple $(RuntimeIdentifiers)
To mirror what we have for `$(AndroidSupportedAbis)` in the existing Xamarin.Android world, we need a way for .NET 6 apps to support multiple architectures. A `HelloAndroid.csproj` targeting all architectures might look like: <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>net5.0-android</TargetFramework> <RuntimeIdentifiers>android.21-x86;android.21-x64;android.21-arm;android.21-arm64</RuntimeIdentifiers> <OutputType>Exe</OutputType> </PropertyGroup> </Project> To achieve this, we can do a nested `<MSBuild/>` call: <ItemGroup> <_RIDs Include="$(RuntimeIdentifiers)" /> </ItemGroup> <MSBuild Projects="$(MSBuildProjectFile)" Targets="_ComputeFilesToPublishForRuntimeIdentifiers" Properties="RuntimeIdentifier=%(_RIDs.Identity)"> <Output TaskParameter="TargetOutputs" ItemName="ResolvedFileToPublish" /> </MSBuild> For a new target: <Target Name="_ComputeFilesToPublishForRuntimeIdentifiers" DependsOnTargets="ResolveReferences;ComputeFilesToPublish" Returns="@(ResolvedFileToPublish)"> </Target> This is equivalent to what would happen in the legacy `_ResolveAssemblies` target. The linker then outputs files to: obj\Release\net5.0\$(RuntimeIdentifier)\linked\ One problem with this, is you receive multiple BCL assemblies for each architecture: obj\Release\net5.0\android.21-arm\linked\System.Linq.dll obj\Release\net5.0\android.21-arm64\linked\System.Linq.dll obj\Release\net5.0\android.21-x86\linked\System.Linq.dll obj\Release\net5.0\android.21-x64\linked\System.Linq.dll I created a `<ProcessAssemblies/>` MSBuild task that checks the mvid of each assembly to detect duplicates. Non-duplicates will be placed in a sub-directory within the `.apk` file, such as: * `assemblies\HelloAndroid.dll` * `assemblies\System.Linq.dll` * `assemblies\arm64-v8a\System.Private.CoreLib.dll` * `assemblies\armeabi-v7a\System.Private.CoreLib.dll` * `assemblies\x86\System.Private.CoreLib.dll` * `assemblies\x86_64\System.Private.CoreLib.dll` I had to make a few build & runtime changes for these ABI sub-directories to work. Other notes: * We must pass `@(IntermediateAssembly)` from the outer build to the nested `<MSBuild/>` calls. Otherwise, the inner calls look for `obj\Release\net5.0\android.21-arm\HelloAndroid.dll` instead of `obj\Release\net5.0\HelloAndroid.dll` that actually exists. * `_ComputeFilesToPublishForRuntimeIdentifiers` was running some extra targets causing `<ResolveSdks/>` to run 5 times for 4 ABIs. I had to make changes in `BuildOrder.targets` to fix this. * `<ResolveAssemblies/>` now sets `%(IntermediateLinkerOutput)` on each assembly item. This allows .NET 6 builds to support multiple linker directories.
1 parent 06a4152 commit b25e99d

20 files changed

+440
-192
lines changed

src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets

Lines changed: 71 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,42 +10,55 @@ _ResolveAssemblies MSBuild target.
1010

1111
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1212

13-
<Target Name="_ResolveAssemblies" DependsOnTargets="ComputeFilesToPublish">
13+
<UsingTask TaskName="Xamarin.Android.Tasks.ProcessAssemblies" AssemblyFile="$(_XamarinAndroidBuildTasksAssembly)" />
1414

15-
<!--
16-
TODO: not yet complete.
17-
18-
Two things here are placeholders for later:
19-
20-
* %(HasMonoAndroidReference) is always True to disable
21-
performance improvements around $(TargetFrameworkVersion)
22-
detection.
15+
<!--This target runs as a nested <MSBuild/> call-->
16+
<Target Name="_ComputeFilesToPublishForRuntimeIdentifiers"
17+
DependsOnTargets="_FixupIntermediateAssembly;ResolveReferences;ComputeFilesToPublish"
18+
Returns="@(ResolvedFileToPublish)">
19+
</Target>
2320

24-
* Is there better metadata to use other than %(NuGetPackageId)
25-
to determine which runtime components are coming from our
26-
known @(FrameworkReference)s?
27-
-->
21+
<Target Name="_FixupIntermediateAssembly" Condition=" '$(_OuterIntermediateAssembly)' != '' ">
22+
<ItemGroup>
23+
<IntermediateAssembly Remove="@(IntermediateAssembly)" />
24+
<IntermediateAssembly Include="$(_OuterIntermediateAssembly)" />
25+
</ItemGroup>
26+
</Target>
2827

28+
<Target Name="_ResolveAssemblies">
29+
<ItemGroup>
30+
<_RIDs Include="$(RuntimeIdentifier)" Condition=" '$(RuntimeIdentifiers)' == '' " />
31+
<_RIDs Include="$(RuntimeIdentifiers)" Condition=" '$(RuntimeIdentifiers)' != '' " />
32+
</ItemGroup>
33+
<PropertyGroup>
34+
<_AdditionalProperties>_ComputeFilesToPublishForRuntimeIdentifiers=true;_OuterIntermediateAssembly=@(IntermediateAssembly)</_AdditionalProperties>
35+
</PropertyGroup>
36+
<MSBuild
37+
Projects="$(MSBuildProjectFile)"
38+
Targets="_ComputeFilesToPublishForRuntimeIdentifiers"
39+
Properties="RuntimeIdentifier=%(_RIDs.Identity);$(_AdditionalProperties)">
40+
<Output TaskParameter="TargetOutputs" ItemName="ResolvedFileToPublish" />
41+
</MSBuild>
42+
<ItemGroup>
43+
<_ResolvedAssemblyFiles Include="@(ResolvedFileToPublish)" Condition=" '%(ResolvedFileToPublish.Extension)' == '.dll' " />
44+
</ItemGroup>
45+
<ProcessAssemblies
46+
InputAssemblies="@(_ResolvedAssemblyFiles)"
47+
IntermediateAssemblyDirectory="$(MonoAndroidIntermediateAssemblyDir)"
48+
LinkMode="$(AndroidLinkMode)">
49+
<Output TaskParameter="OutputAssemblies" ItemName="ResolvedAssemblies" />
50+
<Output TaskParameter="ShrunkAssemblies" ItemName="_ShrunkAssemblies" />
51+
</ProcessAssemblies>
2952
<ItemGroup>
3053
<ResolvedFrameworkAssemblies
31-
Include="@(ResolvedFileToPublish)"
32-
Condition=" '%(ResolvedFileToPublish.Extension)' == '.dll' and '%(ResolvedFileToPublish.NuGetPackageId)' == 'Microsoft.Android.Runtime.$(RuntimeIdentifier)' "
33-
HasMonoAndroidReference="True"
34-
/>
35-
<ResolvedFrameworkAssemblies
36-
Include="@(ResolvedFileToPublish)"
37-
Condition=" '%(ResolvedFileToPublish.Extension)' == '.dll' and '%(ResolvedFileToPublish.NuGetPackageId)' == 'Microsoft.NETCore.App.Runtime.$(RuntimeIdentifier)' "
38-
HasMonoAndroidReference="True"
54+
Include="@(ResolvedAssemblies)"
55+
Condition=" '%(ResolvedAssemblies.FrameworkAssembly)' == 'true' "
3956
/>
4057
<ResolvedUserAssemblies
41-
Include="@(ResolvedFileToPublish)"
42-
Exclude="@(ResolvedFrameworkAssemblies)"
43-
Condition=" '%(ResolvedFileToPublish.Extension)' == '.dll' "
44-
HasMonoAndroidReference="True"
58+
Include="@(ResolvedAssemblies)"
59+
Condition=" '%(ResolvedAssemblies.FrameworkAssembly)' != 'true' "
4560
/>
46-
<ResolvedAssemblies Include="@(ResolvedFrameworkAssemblies);@(ResolvedUserAssemblies)" />
4761
</ItemGroup>
48-
4962
<Hash ItemsToHash="@(ResolvedAssemblies)">
5063
<Output TaskParameter="HashResult" PropertyName="_ResolvedUserAssembliesHash" />
5164
</Hash>
@@ -60,4 +73,35 @@ _ResolveAssemblies MSBuild target.
6073
</ItemGroup>
6174
</Target>
6275

76+
<Target Name="_PrepareAssemblies"
77+
DependsOnTargets="$(_PrepareAssembliesDependsOnTargets)">
78+
<ItemGroup Condition=" '$(AndroidLinkMode)' == 'None' ">
79+
<_ResolvedAssemblies Include="@(ResolvedAssemblies->'%(IntermediateLinkerOutput)')" />
80+
<_ResolvedUserAssemblies Include="@(ResolvedUserAssemblies->'%(IntermediateLinkerOutput)')" />
81+
<_ResolvedFrameworkAssemblies Include="@(ResolvedFrameworkAssemblies->'%(IntermediateLinkerOutput)')" />
82+
<_ShrunkAssemblies Include="@(_ResolvedAssemblies)" />
83+
<_ShrunkUserAssemblies Include="@(_ResolvedUserAssemblies)" />
84+
<_ShrunkFrameworkAssemblies Include="@(_ResolvedFrameworkAssemblies)" />
85+
</ItemGroup>
86+
<ItemGroup Condition=" '$(AndroidLinkMode)' != 'None' ">
87+
<_ResolvedAssemblies Include="@(ResolvedAssemblies)" />
88+
<_ResolvedUserAssemblies Include="@(ResolvedUserAssemblies)" />
89+
<_ResolvedFrameworkAssemblies Include="@(ResolvedFrameworkAssemblies)" />
90+
<_ShrunkFrameworkAssemblies
91+
Include="@(_ShrunkAssemblies)"
92+
Condition=" '%(_ShrunkAssemblies.FrameworkAssembly)' == 'true' "
93+
/>
94+
<_ShrunkUserAssemblies
95+
Include="@(_ShrunkAssemblies)"
96+
Condition=" '%(_ShrunkAssemblies.FrameworkAssembly)' != 'true' "
97+
/>
98+
</ItemGroup>
99+
<ItemGroup>
100+
<_ResolvedUserMonoAndroidAssemblies
101+
Include="@(_ResolvedUserAssemblies)"
102+
Condition=" '%(_ResolvedUserAssemblies.TargetFrameworkIdentifier)' == 'MonoAndroid' Or '%(_ResolvedUserAssemblies.HasMonoAndroidReference)' == 'True' "
103+
/>
104+
</ItemGroup>
105+
</Target>
106+
63107
</Project>

src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.BuildOrder.targets

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,8 @@ projects, these properties are set in Xamarin.Android.Legacy.targets.
4545
</BuildDependsOn>
4646
</PropertyGroup>
4747

48-
<PropertyGroup>
49-
<CompileDependsOn>
50-
_SetupDesignTimeBuildForCompile;
51-
_AddAndroidDefines;
52-
_IncludeLayoutBindingSources;
53-
AddLibraryJarsToBind;
54-
$(CompileDependsOn);
55-
</CompileDependsOn>
56-
<CoreCompileDependsOn>
57-
UpdateGeneratedFiles;
58-
$(CoreCompileDependsOn)
59-
</CoreCompileDependsOn>
48+
<!-- Targets that run unless we are running _ComputeFilesToPublishForRuntimeIdentifiers -->
49+
<PropertyGroup Condition=" '$(_ComputeFilesToPublishForRuntimeIdentifiers)' != 'true' ">
6050
<CoreResolveReferencesDependsOn>
6151
_SeparateAppExtensionReferences;
6252
_PrepareWearApplication;
@@ -71,6 +61,20 @@ projects, these properties are set in Xamarin.Android.Legacy.targets.
7161
AddEmbeddedJarsAsResources;
7262
AddEmbeddedReferenceJarsAsResources;
7363
</ResolveReferencesDependsOn>
64+
</PropertyGroup>
65+
66+
<PropertyGroup>
67+
<CompileDependsOn>
68+
_SetupDesignTimeBuildForCompile;
69+
_AddAndroidDefines;
70+
_IncludeLayoutBindingSources;
71+
AddLibraryJarsToBind;
72+
$(CompileDependsOn);
73+
</CompileDependsOn>
74+
<CoreCompileDependsOn>
75+
UpdateGeneratedFiles;
76+
$(CoreCompileDependsOn)
77+
</CoreCompileDependsOn>
7478
<DeferredBuildDependsOn>
7579
$(DeferredBuildDependsOn);
7680
UpdateAndroidResources;

src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.Linker.targets

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ This file contains the .NET 5-specific targets to customize ILLink
1010
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1111

1212
<Target Name="_PrepareLinking"
13+
Condition=" '$(PublishTrimmed)' == 'true' "
1314
AfterTargets="ComputeResolvedFilesToPublishList"
1415
DependsOnTargets="GetReferenceAssemblyPaths">
1516
<ItemGroup>
@@ -22,9 +23,7 @@ This file contains the .NET 5-specific targets to customize ILLink
2223
</ItemGroup>
2324
<PropertyGroup>
2425
<!-- make the output verbose to see what the linker is doing. FIXME: make dependent upon verbosity level -->
25-
<_ExtraTrimmerArgs>$(_ExtraTrimmerArgs) --verbose --custom-data XATargetFrameworkDirectories="$(_XATargetFrameworkDirectories)"</_ExtraTrimmerArgs>
26-
27-
<IntermediateLinkDir>$(MonoAndroidIntermediateAssemblyDir)</IntermediateLinkDir>
26+
<_ExtraTrimmerArgs>$(_ExtraTrimmerArgs) --verbose --deterministic --custom-data XATargetFrameworkDirectories="$(_XATargetFrameworkDirectories)"</_ExtraTrimmerArgs>
2827

2928
<!-- we don't want to ignore stuff we can't find -->
3029
<_ExtraTrimmerArgs>$(_ExtraTrimmerArgs) --skip-unresolved false</_ExtraTrimmerArgs>
@@ -43,4 +42,9 @@ This file contains the .NET 5-specific targets to customize ILLink
4342
</_TrimmerCustomSteps>
4443
</ItemGroup>
4544
</Target>
45+
46+
<Target Name="_LinkAssemblies"
47+
DependsOnTargets="_ResolveAssemblies;_CreatePackageWorkspace;$(_BeforeLinkAssemblies);_GenerateJniMarshalMethods;_LinkAssembliesNoShrink"
48+
/>
49+
4650
</Project>

src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.Tooling.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ called for "legacy" projects in Xamarin.Android.Legacy.targets.
5858
<RuntimeIdentifierToAbi
5959
Condition=" '$(AndroidApplication)' == 'true' "
6060
RuntimeIdentifier="$(RuntimeIdentifier)"
61+
RuntimeIdentifiers="$(RuntimeIdentifiers)"
6162
SupportedAbis="$(AndroidSupportedAbis)">
6263
<Output TaskParameter="SupportedAbis" PropertyName="AndroidSupportedAbis" />
6364
</RuntimeIdentifierToAbi>

src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.targets

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
<AndroidApplication Condition=" '$(AndroidApplication)' == '' And '$(OutputType)' == 'Exe' ">true</AndroidApplication>
1010
<AndroidApplication Condition=" '$(AndroidApplication)' == '' ">false</AndroidApplication>
1111
<SelfContained Condition=" '$(SelfContained)' == '' And '$(AndroidApplication)' == 'true' ">true</SelfContained>
12-
<RuntimeIdentifier Condition=" '$(RuntimeIdentifier)' == '' And '$(AndroidApplication)' == 'true' ">android.21-x86</RuntimeIdentifier>
12+
<!-- Prefer $(RuntimeIdentifiers) plural -->
13+
<RuntimeIdentifiers Condition=" '$(RuntimeIdentifier)' == '' And '$(RuntimeIdentifiers)' == '' And '$(AndroidApplication)' == 'true' ">android.21-arm;android.21-arm64</RuntimeIdentifiers>
14+
<RuntimeIdentifier Condition=" '$(RuntimeIdentifiers)' != '' And '$(RuntimeIdentifier)' != '' " />
1315
<AndroidManifest Condition=" '$(AndroidManifest)' == '' And '$(AndroidApplication)' == 'true' ">Properties\AndroidManifest.xml</AndroidManifest>
1416
<!-- We don't ever need a `static void Main` method, so switch to Library here-->
1517
<OutputType Condition=" '$(OutputType)' == 'Exe' ">Library</OutputType>

src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -322,23 +322,24 @@ private void AddAssemblies (ZipArchiveEx apk)
322322
sourcePath = CompressAssembly (assembly);
323323

324324
// Add assembly
325-
AddFileToArchiveIfNewer (apk, sourcePath, GetTargetDirectory (assembly.ItemSpec) + "/" + Path.GetFileName (assembly.ItemSpec), compressionMethod: UncompressedMethod);
325+
var assemblyPath = GetAssemblyPath (assembly, frameworkAssembly: false);
326+
AddFileToArchiveIfNewer (apk, sourcePath, assemblyPath + Path.GetFileName (assembly.ItemSpec), compressionMethod: UncompressedMethod);
326327

327328
// Try to add config if exists
328329
var config = Path.ChangeExtension (assembly.ItemSpec, "dll.config");
329-
AddAssemblyConfigEntry (apk, config);
330+
AddAssemblyConfigEntry (apk, assemblyPath, config);
330331

331332
// Try to add symbols if Debug
332333
if (debug) {
333334
var symbols = Path.ChangeExtension (assembly.ItemSpec, "dll.mdb");
334335

335336
if (File.Exists (symbols))
336-
AddFileToArchiveIfNewer (apk, symbols, AssembliesPath + Path.GetFileName (symbols), compressionMethod: UncompressedMethod);
337+
AddFileToArchiveIfNewer (apk, symbols, assemblyPath + Path.GetFileName (symbols), compressionMethod: UncompressedMethod);
337338

338339
symbols = Path.ChangeExtension (assembly.ItemSpec, "pdb");
339340

340341
if (File.Exists (symbols))
341-
AddFileToArchiveIfNewer (apk, symbols, AssembliesPath + Path.GetFileName (symbols), compressionMethod: UncompressedMethod);
342+
AddFileToArchiveIfNewer (apk, symbols, assemblyPath + Path.GetFileName (symbols), compressionMethod: UncompressedMethod);
342343
}
343344
count++;
344345
if (count == ZipArchiveEx.ZipFlushLimit) {
@@ -363,20 +364,21 @@ private void AddAssemblies (ZipArchiveEx apk)
363364
}
364365

365366
sourcePath = CompressAssembly (assembly);
366-
AddFileToArchiveIfNewer (apk, sourcePath, AssembliesPath + Path.GetFileName (assembly.ItemSpec), compressionMethod: UncompressedMethod);
367+
var assemblyPath = GetAssemblyPath (assembly, frameworkAssembly: true);
368+
AddFileToArchiveIfNewer (apk, sourcePath, assemblyPath + Path.GetFileName (assembly.ItemSpec), compressionMethod: UncompressedMethod);
367369
var config = Path.ChangeExtension (assembly.ItemSpec, "dll.config");
368-
AddAssemblyConfigEntry (apk, config);
370+
AddAssemblyConfigEntry (apk, assemblyPath, config);
369371
// Try to add symbols if Debug
370372
if (debug) {
371373
var symbols = Path.ChangeExtension (assembly.ItemSpec, "dll.mdb");
372374

373375
if (File.Exists (symbols))
374-
AddFileToArchiveIfNewer (apk, symbols, AssembliesPath + Path.GetFileName (symbols), compressionMethod: UncompressedMethod);
376+
AddFileToArchiveIfNewer (apk, symbols, assemblyPath + Path.GetFileName (symbols), compressionMethod: UncompressedMethod);
375377

376378
symbols = Path.ChangeExtension (assembly.ItemSpec, "pdb");
377379

378380
if (File.Exists (symbols))
379-
AddFileToArchiveIfNewer (apk, symbols, AssembliesPath + Path.GetFileName (symbols), compressionMethod: UncompressedMethod);
381+
AddFileToArchiveIfNewer (apk, symbols, assemblyPath + Path.GetFileName (symbols), compressionMethod: UncompressedMethod);
380382
}
381383
count++;
382384
if (count == ZipArchiveEx.ZipFlushLimit) {
@@ -404,7 +406,8 @@ string CompressAssembly (ITaskItem assembly)
404406
return assembly.ItemSpec;
405407
}
406408

407-
if (compressedAssembliesInfo.TryGetValue (Path.GetFileName (assembly.ItemSpec), out CompressedAssemblyInfo info) && info != null) {
409+
var key = CompressedAssemblyInfo.GetDictionaryKey (assembly);
410+
if (compressedAssembliesInfo.TryGetValue (key, out CompressedAssemblyInfo info) && info != null) {
408411
EnsureCompressedAssemblyData (assembly.ItemSpec, info.DescriptorIndex);
409412
AssemblyCompression.CompressionResult result = AssemblyCompression.Compress (compressedAssembly);
410413
if (result != AssemblyCompression.CompressionResult.Success) {
@@ -424,6 +427,8 @@ string CompressAssembly (ITaskItem assembly)
424427
return assembly.ItemSpec;
425428
}
426429
return compressedAssembly.DestinationPath;
430+
} else {
431+
Log.LogDebugMessage ($"Assembly missing from {CompressedAssemblyInfo.CompressedAssembliesInfoKey}: {key}");
427432
}
428433

429434
return assembly.ItemSpec;
@@ -442,9 +447,9 @@ bool AddFileToArchiveIfNewer (ZipArchiveEx apk, string file, string inArchivePat
442447
return true;
443448
}
444449

445-
void AddAssemblyConfigEntry (ZipArchiveEx apk, string configFile)
450+
void AddAssemblyConfigEntry (ZipArchiveEx apk, string assemblyPath, string configFile)
446451
{
447-
string inArchivePath = AssembliesPath + Path.GetFileName (configFile);
452+
string inArchivePath = assemblyPath + Path.GetFileName (configFile);
448453
existingEntries.Remove (inArchivePath);
449454

450455
if (!File.Exists (configFile))
@@ -465,13 +470,20 @@ void AddAssemblyConfigEntry (ZipArchiveEx apk, string configFile)
465470
}
466471
}
467472

468-
string GetTargetDirectory (string path)
473+
/// <summary>
474+
/// Returns the in-archive path for an assembly
475+
/// </summary>
476+
string GetAssemblyPath (ITaskItem assembly, bool frameworkAssembly)
469477
{
470-
string culture, file;
471-
if (SatelliteAssembly.TryGetSatelliteCultureAndFileName (path, out culture, out file)) {
472-
return AssembliesPath + culture;
478+
var assembliesPath = AssembliesPath;
479+
var abiDirectory = assembly.GetMetadata ("AbiDirectory");
480+
if (!string.IsNullOrEmpty (abiDirectory)) {
481+
assembliesPath += abiDirectory + "/";
473482
}
474-
return AssembliesPath.TrimEnd ('/');
483+
if (!frameworkAssembly && SatelliteAssembly.TryGetSatelliteCultureAndFileName (assembly.ItemSpec, out var culture, out _)) {
484+
assembliesPath += culture + "/";
485+
}
486+
return assembliesPath;
475487
}
476488

477489
class LibInfo

src/Xamarin.Android.Build.Tasks/Tasks/FilterAssemblies.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ string GetTargetFrameworkIdentifier (AssemblyDefinition assembly, MetadataReader
104104
return targetFrameworkIdentifier;
105105
}
106106

107-
bool HasReference (MetadataReader reader)
107+
protected bool HasReference (MetadataReader reader)
108108
{
109109
foreach (var handle in reader.AssemblyReferences) {
110110
var reference = reader.GetAssemblyReference (handle);

src/Xamarin.Android.Build.Tasks/Tasks/GenerateCompressedAssembliesNativeSourceFiles.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ void GenerateCompressedAssemblySources ()
5353
continue;
5454
}
5555

56-
assemblies.Add (Path.GetFileName (assembly.ItemSpec), new CompressedAssemblyInfo (checked((uint)fi.Length)));
56+
var key = CompressedAssemblyInfo.GetDictionaryKey (assembly);
57+
assemblies.Add (key, new CompressedAssemblyInfo (checked((uint)fi.Length)));
5758
}
5859

5960
uint index = 0;

0 commit comments

Comments
 (0)