Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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 Diff line number Diff line change
Expand Up @@ -32,7 +32,21 @@ public override bool Execute()
var candidates = StaticWebAsset.FromTaskItemGroup(CandidateAssets);
var assetsToUpdate = new List<ITaskItem>();

var candidatesByIdentity = candidates.ToDictionary(asset => asset.Identity, OSPath.PathComparer);
var candidatesByIdentity = new Dictionary<string, StaticWebAsset>(OSPath.PathComparer);
foreach (var asset in candidates)
{
if (!candidatesByIdentity.ContainsKey(asset.Identity))
{
candidatesByIdentity[asset.Identity] = asset;
}
else
{
Log.LogMessage(
MessageImportance.Low,
"Skipping duplicate candidate asset '{0}'. The asset was already added from a different source.",
asset.Identity);
}
}

foreach (var candidate in candidates)
{
Expand Down
7 changes: 5 additions & 2 deletions src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1230,11 +1230,14 @@

internal static Dictionary<string, StaticWebAsset> ToAssetDictionary(ITaskItem[] candidateAssets, bool validate = false)
{
var dictionary = new Dictionary<string, StaticWebAsset>(candidateAssets.Length);
var dictionary = new Dictionary<string, StaticWebAsset>(candidateAssets.Length, OSPath.PathComparer);

Check failure on line 1233 in src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs

View check run for this annotation

Azure Pipelines / dotnet-sdk-public-ci (Build TestBuild: linux (x64))

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs#L1233

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs(1233,89): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'OSPath' does not exist in the current context

Check failure on line 1233 in src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs

View check run for this annotation

Azure Pipelines / dotnet-sdk-public-ci (Build TestBuild: linux (x64))

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs#L1233

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs(1233,89): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'OSPath' does not exist in the current context

Check failure on line 1233 in src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs

View check run for this annotation

Azure Pipelines / dotnet-sdk-public-ci (Build TestBuild: linux (x64))

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs#L1233

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs(1233,65): error CS1503: (NETCORE_ENGINEERING_TELEMETRY=Build) Argument 1: cannot convert from 'int' to 'System.Collections.Generic.IDictionary<string, Microsoft.AspNetCore.StaticWebAssets.Tasks.StaticWebAsset>'

Check failure on line 1233 in src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs

View check run for this annotation

Azure Pipelines / dotnet-sdk-public-ci (Build TemplateEngine: linux (x64))

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs#L1233

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs(1233,89): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'OSPath' does not exist in the current context

Check failure on line 1233 in src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs

View check run for this annotation

Azure Pipelines / dotnet-sdk-public-ci (Build TemplateEngine: linux (x64))

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs#L1233

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs(1233,65): error CS1503: (NETCORE_ENGINEERING_TELEMETRY=Build) Argument 1: cannot convert from 'int' to 'System.Collections.Generic.IDictionary<string, Microsoft.AspNetCore.StaticWebAssets.Tasks.StaticWebAsset>'

Check failure on line 1233 in src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs

View check run for this annotation

Azure Pipelines / dotnet-sdk-public-ci (Build TemplateEngine: linux (x64))

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs#L1233

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs(1233,89): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'OSPath' does not exist in the current context

Check failure on line 1233 in src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs

View check run for this annotation

Azure Pipelines / dotnet-sdk-public-ci (Build TestBuild: linux (arm64))

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs#L1233

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs(1233,89): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'OSPath' does not exist in the current context

Check failure on line 1233 in src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs

View check run for this annotation

Azure Pipelines / dotnet-sdk-public-ci (Build TestBuild: linux (arm64))

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs#L1233

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs(1233,89): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'OSPath' does not exist in the current context

Check failure on line 1233 in src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs

View check run for this annotation

Azure Pipelines / dotnet-sdk-public-ci (Build TestBuild: linux (arm64))

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs#L1233

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs(1233,65): error CS1503: (NETCORE_ENGINEERING_TELEMETRY=Build) Argument 1: cannot convert from 'int' to 'System.Collections.Generic.IDictionary<string, Microsoft.AspNetCore.StaticWebAssets.Tasks.StaticWebAsset>'

Check failure on line 1233 in src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs

View check run for this annotation

Azure Pipelines / dotnet-sdk-public-ci (Build TestBuild: macOS (arm64))

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs#L1233

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs(1233,89): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'OSPath' does not exist in the current context

Check failure on line 1233 in src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs

View check run for this annotation

Azure Pipelines / dotnet-sdk-public-ci (Build TestBuild: macOS (arm64))

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs#L1233

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs(1233,89): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'OSPath' does not exist in the current context

Check failure on line 1233 in src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs

View check run for this annotation

Azure Pipelines / dotnet-sdk-public-ci (Build TestBuild: macOS (arm64))

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs#L1233

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs(1233,65): error CS1503: (NETCORE_ENGINEERING_TELEMETRY=Build) Argument 1: cannot convert from 'int' to 'System.Collections.Generic.IDictionary<string, Microsoft.AspNetCore.StaticWebAssets.Tasks.StaticWebAsset>'

Check failure on line 1233 in src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs

View check run for this annotation

Azure Pipelines / dotnet-sdk-public-ci (Build AoT: macOS (x64))

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs#L1233

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs(1233,89): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'OSPath' does not exist in the current context

Check failure on line 1233 in src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs

View check run for this annotation

Azure Pipelines / dotnet-sdk-public-ci (Build AoT: macOS (x64))

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs#L1233

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs(1233,89): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'OSPath' does not exist in the current context

Check failure on line 1233 in src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs

View check run for this annotation

Azure Pipelines / dotnet-sdk-public-ci (Build AoT: macOS (x64))

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs#L1233

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs(1233,65): error CS1503: (NETCORE_ENGINEERING_TELEMETRY=Build) Argument 1: cannot convert from 'int' to 'System.Collections.Generic.IDictionary<string, Microsoft.AspNetCore.StaticWebAssets.Tasks.StaticWebAsset>'

Check failure on line 1233 in src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs

View check run for this annotation

Azure Pipelines / dotnet-sdk-public-ci (Build TestBuild: macOS (x64))

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs#L1233

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs(1233,89): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'OSPath' does not exist in the current context

Check failure on line 1233 in src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs

View check run for this annotation

Azure Pipelines / dotnet-sdk-public-ci (Build TestBuild: macOS (x64))

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs#L1233

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs(1233,89): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'OSPath' does not exist in the current context

Check failure on line 1233 in src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs

View check run for this annotation

Azure Pipelines / dotnet-sdk-public-ci (Build TestBuild: macOS (x64))

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs#L1233

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs(1233,65): error CS1503: (NETCORE_ENGINEERING_TELEMETRY=Build) Argument 1: cannot convert from 'int' to 'System.Collections.Generic.IDictionary<string, Microsoft.AspNetCore.StaticWebAssets.Tasks.StaticWebAsset>'

Check failure on line 1233 in src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs

View check run for this annotation

Azure Pipelines / dotnet-sdk-public-ci

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs#L1233

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs(1233,89): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'OSPath' does not exist in the current context

Check failure on line 1233 in src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs

View check run for this annotation

Azure Pipelines / dotnet-sdk-public-ci

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs#L1233

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs(1233,89): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'OSPath' does not exist in the current context

Check failure on line 1233 in src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs

View check run for this annotation

Azure Pipelines / dotnet-sdk-public-ci

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs#L1233

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs(1233,65): error CS1503: (NETCORE_ENGINEERING_TELEMETRY=Build) Argument 1: cannot convert from 'int' to 'System.Collections.Generic.IDictionary<string, Microsoft.AspNetCore.StaticWebAssets.Tasks.StaticWebAsset>'

Check failure on line 1233 in src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs

View check run for this annotation

Azure Pipelines / dotnet-sdk-public-ci

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs#L1233

src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs(1233,89): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'OSPath' does not exist in the current context
for (var i = 0; i < candidateAssets.Length; i++)
{
var candidateAsset = FromTaskItem(candidateAssets[i], validate);
dictionary.Add(candidateAsset.Identity, candidateAsset);
if (!dictionary.ContainsKey(candidateAsset.Identity))
Comment thread
ilonatommy marked this conversation as resolved.
Outdated
{
dictionary.Add(candidateAsset.Identity, candidateAsset);
}
}

return dictionary;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,15 @@ public override bool Execute()

// Get the list of the asset that need to be part of the manifest (this is similar to GenerateStaticWebAssetsDevelopmentManifest)
var assets = StaticWebAsset.FromTaskItemGroup(Assets);
var manifestAssets = ComputeManifestAssets(assets, ManifestType)
.ToDictionary(a => a.ResolvedAsset.Identity, a => a, OSPath.PathComparer);
var manifestAssetsList = ComputeManifestAssets(assets, ManifestType);
var manifestAssets = new Dictionary<string, TargetPathAssetPair>(OSPath.PathComparer);
foreach (var a in manifestAssetsList)
{
if (!manifestAssets.ContainsKey(a.ResolvedAsset.Identity))
{
manifestAssets[a.ResolvedAsset.Identity] = a;
}
Comment thread
ilonatommy marked this conversation as resolved.
}

// Build exclusion matcher if patterns are provided
StaticWebAssetGlobMatcher exclusionMatcher = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,14 @@ private StaticWebAssetEndpoint[] FilterPublishEndpointsIfNeeded(StaticWebAsset[]
// inside the manifest because its cumbersome to do it in MSBuild directly.
if (StaticWebAssetsManifest.ManifestTypes.IsPublish(ManifestType))
{
var assetsByIdentity = assets.ToDictionary(a => a.Identity, a => a, OSPath.PathComparer);
var assetsByIdentity = new Dictionary<string, StaticWebAsset>(OSPath.PathComparer);
foreach (var a in assets)
{
if (!assetsByIdentity.ContainsKey(a.Identity))
{
assetsByIdentity[a.Identity] = a;
}
Comment thread
ilonatommy marked this conversation as resolved.
}
var filteredEndpoints = new List<StaticWebAssetEndpoint>();

foreach (var endpoint in Endpoints.Select(StaticWebAssetEndpoint.FromTaskItem))
Expand Down
Loading