Skip to content

Commit 270fedd

Browse files
committed
try something
1 parent b6caf4e commit 270fedd

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ public override bool RunTask ()
107107
}
108108
var fileTaskItem = new TaskItem (file, new Dictionary<string, string> () {
109109
{ "ResourceDirectory", directory.ItemSpec },
110-
{ ResolveLibraryProjectImports.ResourceDirectoryArchive, Path.Combine (directory.ItemSpec, "..", "res.zip") },
111110
{ "StampFile", generateArchive ? stampFile : file },
112111
{ "FilesCache", filesCache},
113112
{ "Hash", stampFile },

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ public class ResolveLibraryProjectImports : AndroidTask
6565
internal const string ResourceDirectoryArchive = "ResourceDirectoryArchive";
6666
static readonly string [] knownMetadata = new [] {
6767
OriginalFile,
68-
AndroidSkipResourceProcessing
68+
AndroidSkipResourceProcessing,
69+
ResourceDirectoryArchive
6970
};
7071

7172
AssemblyIdentityMap assemblyMap = new AssemblyIdentityMap();
@@ -179,6 +180,7 @@ void Extract (
179180
string importsDir = Path.Combine (outDirForDll, ImportsDirectory);
180181
string nativeimportsDir = Path.Combine (outDirForDll, NativeImportsDirectory);
181182
string resDir = Path.Combine (importsDir, "res");
183+
string resDirArchive = Path.Combine (resDir, "..", "res.zip");
182184
string assetsDir = Path.Combine (importsDir, "assets");
183185

184186
// Skip already-extracted resources.
@@ -196,6 +198,7 @@ void Extract (
196198
if (Directory.Exists (resDir)) {
197199
var taskItem = new TaskItem (Path.GetFullPath (resDir), new Dictionary<string, string> {
198200
{ OriginalFile, assemblyPath },
201+
{ ResourceDirectoryArchive, Path.GetFullPath (resDirArchive)},
199202
});
200203
if (bool.TryParse (assemblyItem.GetMetadata (AndroidSkipResourceProcessing), out skip) && skip)
201204
taskItem.SetMetadata (AndroidSkipResourceProcessing, "True");
@@ -292,9 +295,11 @@ void Extract (
292295
// which resulted in missing resource issue.
293296
// Here we replaced copy with use of '-S' option and made it to work.
294297
if (Directory.Exists (resDir)) {
295-
CreateResourceArchive (resDir, assemblyItem.GetMetadata (ResourceDirectoryArchive));
298+
CreateResourceArchive (resDir, resDirArchive);
296299
var taskItem = new TaskItem (Path.GetFullPath (resDir), new Dictionary<string, string> {
297-
{ OriginalFile, assemblyPath }
300+
{ OriginalFile, assemblyPath },
301+
{ ResourceDirectoryArchive, Path.GetFullPath (resDirArchive)},
302+
298303
});
299304
if (bool.TryParse (assemblyItem.GetMetadata (AndroidSkipResourceProcessing), out skip) && skip)
300305
taskItem.SetMetadata (AndroidSkipResourceProcessing, "True");
@@ -360,6 +365,7 @@ void Extract (
360365
resolvedResourceDirectories.Add (new TaskItem (Path.GetFullPath (resDir), new Dictionary<string, string> {
361366
{ OriginalFile, Path.GetFullPath (aarFile.ItemSpec) },
362367
{ AndroidSkipResourceProcessing, skipProcessing },
368+
{ ResourceDirectoryArchive, Path.GetFullPath (aarFile.ItemSpec)},
363369
}));
364370
}
365371
if (Directory.Exists (assetsDir))
@@ -409,14 +415,14 @@ void Extract (
409415
}
410416
}
411417
if (Directory.Exists (resDir)) {
412-
CreateResourceArchive (resDir, aarFile.GetMetadata (ResourceDirectoryArchive));
413418
var skipProcessing = aarFile.GetMetadata (AndroidSkipResourceProcessing);
414419
if (string.IsNullOrEmpty (skipProcessing)) {
415420
skipProcessing = "True";
416421
}
417422
resolvedResourceDirectories.Add (new TaskItem (Path.GetFullPath (resDir), new Dictionary<string, string> {
418423
{ OriginalFile, aarFullPath },
419424
{ AndroidSkipResourceProcessing, skipProcessing },
425+
{ ResourceDirectoryArchive, aarFullPath},
420426
}));
421427
}
422428
if (Directory.Exists (assetsDir))

0 commit comments

Comments
 (0)