Skip to content

Commit

Permalink
[Xamarin.Android.Build.Tasks] Fix the inclusion of .config files in t…
Browse files Browse the repository at this point in the history
…he Apk. (#16)

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=40804

There was an issue with including config files in the final apk when
using release builds. Firstly they were not even being picked up
because the CopyConfigFiles task was expecting a list of config files
not a list of assemblies which is what it was receiving.

Secondly the BuildApk task was not placing them in the assemblies
directory.

This commit fixes both of those issues.
  • Loading branch information
dellis1972 authored and jonpryor committed May 4, 2016
1 parent ff1993a commit 9836bef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ private void AddAssemblies (ZipFile apk)
apk.AddFile (assembly.ItemSpec, "assemblies").CompressionLevel = CompressionLevel.None;
var config = Path.ChangeExtension (assembly.ItemSpec, "dll.config");
if (File.Exists (config))
apk.AddFile (config).CompressionLevel = CompressionLevel.None;
apk.AddFile (config, "assemblies").CompressionLevel = CompressionLevel.None;
// Try to add symbols if Debug
if (debug) {
var symbols = Path.ChangeExtension (assembly.ItemSpec, "dll.mdb");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2075,8 +2075,8 @@ because xbuild doesn't support framework reference assemblies.
SkipUnchangedFiles="true" />

<CopyConfigFiles
SourceFiles="@(_ResolvedFrameworkAssemblies)"
DestinationFiles="@(_ShrunkFrameworkAssemblies)" />
SourceFiles="@(_ResolvedFrameworkAssemblies->'%(Identity).config')"
DestinationFiles="@(_ShrunkFrameworkAssemblies->'%(Identity).config')" />

<!-- Shrink Mono.Android.dll by removing attribute only needed for GenerateJavaStubs -->
<RemoveRegisterAttribute
Expand Down

0 comments on commit 9836bef

Please sign in to comment.