Skip to content
Merged
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
24 changes: 20 additions & 4 deletions msbuild/Xamarin.MacDev.Tasks.Core/Tasks/ACToolTaskBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,10 @@ public override bool Execute ()
for (int i = 0; i < ImageAssets.Length; i++) {
var vpath = BundleResource.GetVirtualProjectPath (ProjectDir, ImageAssets[i], !string.IsNullOrEmpty (SessionId));

// Ignore MacOS .DS_Store files...
if (Path.GetFileName (vpath).Equals (".DS_Store", StringComparison.OrdinalIgnoreCase))
continue;

// get the parent (which will typically be .appiconset, .launchimage, .imageset, .iconset, etc)
var catalog = Path.GetDirectoryName (vpath);

Expand Down Expand Up @@ -336,6 +340,10 @@ public override bool Execute ()
var clone = false;
ITaskItem item;

// Ignore MacOS .DS_Store files...
if (Path.GetFileName (vpath).Equals (".DS_Store", StringComparison.OrdinalIgnoreCase))
continue;

foreach (var catalog in clones) {
if (vpath.Length > catalog.Length && vpath[catalog.Length] == '/' && vpath.StartsWith (catalog, StringComparison.Ordinal)) {
clone = true;
Expand All @@ -344,17 +352,25 @@ public override bool Execute ()
}

if (clone) {
var path = Path.Combine (intermediateCloneDir, vpath);
var dir = Path.GetDirectoryName (path);
var src = ImageAssets[i].GetMetadata ("FullPath");

if (!File.Exists (src)) {
Log.LogError (null, null, null, src, 0, 0, 0, 0, "File not found: {0}", src);
return false;
}

var dest = Path.Combine (intermediateCloneDir, vpath);
var dir = Path.GetDirectoryName (dest);

Directory.CreateDirectory (dir);
File.Copy (ImageAssets[i].GetMetadata ("FullPath"), path, true);

File.Copy (src, dest, true);

// filter out everything except paths containing a Contents.json file since our main processing loop only cares about these
if (Path.GetFileName (vpath) != "Contents.json")
continue;

item = new TaskItem (path);
item = new TaskItem (dest);
ImageAssets[i].CopyMetadataTo (item);
item.SetMetadata ("Link", vpath);
} else {
Expand Down