Skip to content

Commit

Permalink
[browser] Fix computing destination sub path and publish extension ta…
Browse files Browse the repository at this point in the history
…rget path in Wasm SDK (#105458)
  • Loading branch information
maraf authored Jul 26, 2024
1 parent 81976ed commit efebf20
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ public static string GetCandidateRelativePath(ITaskItem candidate, bool fingerpr
{
fileName = Path.GetFileNameWithoutExtension(destinationSubPath);
extension = Path.GetExtension(destinationSubPath);
subPath = destinationSubPath.Substring(fileName.Length + extension.Length);
subPath = Path.GetDirectoryName(destinationSubPath);
if (!string.IsNullOrEmpty(subPath))
subPath += "/";
}

string relativePath;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ public void WriteBootJson(Stream output, string entryAssemblyName)
resourceList = new();
resourceData.extensions[extensionName] = resourceList;
}
var targetPath = resource.GetMetadata("TargetPath");
var targetPath = endpointByAsset[resource.ItemSpec].ItemSpec;
Debug.Assert(!string.IsNullOrEmpty(targetPath), "Target path for '{0}' must exist.", resource.ItemSpec);
AddResourceToList(resource, resourceList, targetPath);
continue;
Expand Down Expand Up @@ -431,7 +431,7 @@ void AddResourceToList(ITaskItem resource, ResourceHashesByNameDictionary resour
{
if (!resourceList.ContainsKey(resourceKey))
{
Log.LogMessage(MessageImportance.Low, "Added resource '{0}' to the manifest.", resource.ItemSpec);
Log.LogMessage(MessageImportance.Low, "Added resource '{0}' with key '{1}' to the manifest.", resource.ItemSpec, resourceKey);
resourceList.Add(resourceKey, $"sha256-{resource.GetMetadata("Integrity")}");
}
}
Expand Down

0 comments on commit efebf20

Please sign in to comment.