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
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements. // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license. // The .NET Foundation licenses this file to you under the MIT license.


using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using Microsoft.Build.Framework; using Microsoft.Build.Framework;
Expand Down Expand Up @@ -59,6 +60,24 @@ public override bool Execute()
continue; continue;
} }


try
{
TaskItem webcilItem = ConvertDll(tmpDir, candidate);
webCilCandidates.Add(webcilItem);
}
catch (Exception ex)
{
Log.LogError($"Failed to convert '{candidate.ItemSpec}' to webcil: {ex.Message}");
return false;
}
}

WebCilCandidates = webCilCandidates.ToArray();
return true;
}

private TaskItem ConvertDll(string tmpDir, ITaskItem candidate)
{
var dllFilePath = candidate.ItemSpec; var dllFilePath = candidate.ItemSpec;
var webcilFileName = Path.GetFileNameWithoutExtension(dllFilePath) + Utils.WebcilInWasmExtension; var webcilFileName = Path.GetFileNameWithoutExtension(dllFilePath) + Utils.WebcilInWasmExtension;
string candidatePath = candidate.GetMetadata("AssetTraitName") == "Culture" string candidatePath = candidate.GetMetadata("AssetTraitName") == "Culture"
Expand Down Expand Up @@ -101,10 +120,6 @@ public override bool Execute()
Log.LogMessage(MessageImportance.Low, $"Changing related asset of {webcilItem} to {relatedAsset}."); Log.LogMessage(MessageImportance.Low, $"Changing related asset of {webcilItem} to {relatedAsset}.");
} }


webCilCandidates.Add(webcilItem); return webcilItem;
}

WebCilCandidates = webCilCandidates.ToArray();
return true;
} }
} }