41 writes to Identity
Microsoft.NET.Sdk.BlazorWebAssembly.Tests (4)
StaticWebAssetsBaselineFactory.cs (4)
95asset.Identity = Path.Combine(Path.GetDirectoryName(identity), basePath, relativePath); 96asset.Identity = asset.Identity.Replace(Path.DirectorySeparatorChar, '\\'); 111asset.Identity = Path.Combine(Path.GetDirectoryName(identity), Path.GetFileName(originalItemSpec) + Path.GetExtension(identity)) 219asset.Identity = TemplatizeFilePath(
Microsoft.NET.Sdk.StaticWebAssets.Tasks (5)
Compression\ResolveCompressedAssets.cs (2)
309Identity = itemSpec, 318Identity = itemSpec,
Data\StaticWebAsset.cs (3)
708Identity = identity, 1326string ITaskItem2.EvaluatedIncludeEscaped { get => Identity; set => Identity = value; } 1327string ITaskItem.ItemSpec { get => Identity; set => Identity = value; }
Microsoft.NET.Sdk.StaticWebAssets.Tests (32)
ComputeStaticWebAssetsTargetPathsTest.cs (1)
113Identity = Path.GetFullPath(itemSpec),
StaticWebAssets\ApplyCompressionNegotiationTest.cs (1)
1453Identity = Path.GetFullPath(itemSpec),
StaticWebAssets\ComputeEndpointsForReferenceStaticWebAssetsTest.cs (1)
107Identity = Path.GetFullPath(itemSpec),
StaticWebAssets\ComputeReferenceStaticWebAssetItemsTest.cs (1)
349Identity = Path.GetFullPath(itemSpec),
StaticWebAssets\ComputeStaticWebAssetsForCurrentProjectTest.cs (1)
288Identity = Path.GetFullPath(itemSpec),
StaticWebAssets\DefineStaticWebAssetEndpointsTest.cs (1)
600Identity = Path.GetFullPath(itemSpec),
StaticWebAssets\DiscoverPrecompressedAssetsTest.cs (2)
37Identity = Path.Combine(Environment.CurrentDirectory, "wwwroot", "js", "site.js"), 62Identity = Path.Combine(Environment.CurrentDirectory, "wwwroot", "js", "site.js.gz"),
StaticWebAssets\DiscoverStaticWebAssetsTest.cs (4)
639var newAsset = new StaticWebAsset { Identity = newAssetItem.ItemSpec }; 668cache.CachedAssets["input2"] = new StaticWebAsset { Identity = cachedAsset.ItemSpec, RelativePath = "Input2.txt" }; 675cache.AppendAsset("input1", new StaticWebAsset { Identity = newAsset.ItemSpec, RelativePath = "Input1.txt" }, newAsset); 827cache.CachedAssets = cached.ToDictionary(c => c, c => new StaticWebAsset { Identity = c });
StaticWebAssets\FilterStaticWebAssetEndpointsTest.cs (1)
287Identity = Path.GetFullPath(itemSpec),
StaticWebAssets\GenerateStaticWebAssetEndpointsManifestTest.cs (1)
465Identity = Path.GetFullPath(itemSpec),
StaticWebAssets\GenerateStaticWebAssetEndpointsPropsFileTest.cs (1)
173Identity = Path.GetFullPath(itemSpec),
StaticWebAssets\GenerateStaticWebAssetsDevelopmentManifestTest.cs (1)
732Identity = Path.GetFullPath(identity),
StaticWebAssets\GenerateStaticWebAssetsManifestTest.cs (1)
407Identity = Path.GetFullPath(itemSpec),
StaticWebAssets\ResolveCompressedAssetsTest.cs (9)
42Identity = ItemSpec, 89Identity = Path.Combine(Environment.CurrentDirectory, "wwwroot", "js", "site.js"), 114Identity = Path.Combine(Environment.CurrentDirectory, "wwwroot", "js", "site.js.gz"), 162Identity = ItemSpec, 207Identity = ItemSpec, 264Identity = ItemSpec, 308Identity = ItemSpec, 357Identity = ItemSpec, 422Identity = ItemSpec,
StaticWebAssets\ResolveFingerprintedStaticWebAssetEndpointsForAssetsTest.cs (1)
240Identity = Path.GetFullPath(itemSpec),
StaticWebAssets\UpdateStaticWebAssetEndpointsTest.cs (1)
352Identity = Path.GetFullPath(itemSpec),
StaticWebAssetsBaselineFactory.cs (4)
95asset.Identity = Path.Combine(Path.GetDirectoryName(identity), basePath, relativePath); 96asset.Identity = asset.Identity.Replace(Path.DirectorySeparatorChar, '\\'); 111asset.Identity = Path.Combine(Path.GetDirectoryName(identity), Path.GetFileName(originalItemSpec) + Path.GetExtension(identity)) 219asset.Identity = TemplatizeFilePath(
218 references to Identity
Microsoft.NET.Sdk.BlazorWebAssembly.Tests (27)
AspNetSdkBaselineTest.cs (3)
129File.Exists(a.Identity) && 141.Concat(computedFiles.Select(a => a.Identity)) 238.Concat(computedFiles.Select(a => a.Identity))
StaticWebAssetsBaselineComparer.cs (14)
58{string.Join($"{Environment.NewLine} ", foundDuplicateAssetss.Select(a => @$"{a.Key.Identity} - {a.Value.Length}"))}{Environment.NewLine}"); 67var actualAssetsByIdentity = actual.Assets.GroupBy(a => a.Identity).ToDictionary(a => a.Key, a => a.Order().ToArray()); 150Array.Sort(manifestAssets, (a, b) => a.Identity.CompareTo(b.Identity)); 151Array.Sort(expectedAssets, (a, b) => a.Identity.CompareTo(b.Identity)); 179For {expectedAsset.Identity}: 232{string.Join($"{Environment.NewLine}\t", missingAssets.Select(a => a.Identity))}"); 238{string.Join($"{Environment.NewLine}\t", unexpectedAssets.Select(a => a.Identity))}"); 254if (manifestAsset.Identity != expectedAsset.Identity) 256assetDifferences.Add($"Expected manifest Identity of {expectedAsset.Identity} but found {manifestAsset.Identity}."); 318return Path.GetExtension(asset.Identity.TrimEnd(']'));
StaticWebAssetsBaselineFactory.cs (10)
78var assetsByIdentity = manifest.Assets.ToDictionary(a => a.Identity); 82var relatedEndpoints = endpointsByAssetFile.GetValueOrDefault(asset.Identity); 86endpoint.AssetFile = asset.Identity; 92var identity = asset.Identity.Replace('\\', Path.DirectorySeparatorChar); 96asset.Identity = asset.Identity.Replace(Path.DirectorySeparatorChar, '\\'); 99endpoint.AssetFile = asset.Identity; 104else if ((asset.Identity.EndsWith(".gz", StringComparison.OrdinalIgnoreCase) || asset.Identity.EndsWith(".br", StringComparison.OrdinalIgnoreCase)) 108var identity = asset.Identity.Replace('\\', Path.DirectorySeparatorChar); 220asset.Identity,
Microsoft.NET.Sdk.StaticWebAssets.Tasks (118)
ApplyCompressionNegotiation.cs (10)
44Log.LogMessage("Processing compressed asset: {0}", compressedAsset.Identity); 274AssetFile = compressedAsset.Identity, 327Log.LogWarning("Related asset not found for compressed asset: {0}", compressedAsset.Identity); 328throw new InvalidOperationException($"Related asset not found for compressed asset: {compressedAsset.Identity}"); 331if (!endpointsByAsset.TryGetValue(compressedAsset.Identity, out var compressedEndpoints)) 333Log.LogWarning("Endpoints not found for compressed asset: {0} {1}", compressedAsset.RelativePath, compressedAsset.Identity); 334throw new InvalidOperationException($"Endpoints not found for compressed asset: {compressedAsset.Identity}"); 337if (!endpointsByAsset.TryGetValue(relatedAsset.Identity, out var relatedAssetEndpoints)) 339Log.LogWarning("Endpoints not found for related asset: {0}", relatedAsset.Identity); 340throw new InvalidOperationException($"Endpoints not found for related asset: {relatedAsset.Identity}");
CollectStaticWebAssetsToCopy.cs (11)
33Log.LogMessage(MessageImportance.Low, "Skipping asset '{0}' since source type is '{1}'", asset.Identity, asset.SourceType); 39Log.LogMessage(MessageImportance.Low, "Skipping asset '{0}' since asset mode is '{1}'", asset.Identity, asset.AssetMode); 49if (asset.Identity.StartsWith(normalizedOutputPath, StringComparison.Ordinal)) 51Log.LogMessage(MessageImportance.Low, "Source for asset '{0}' is '{1}' since the identity points to the output path.", asset.Identity, asset.OriginalItemSpec); 54else if (File.Exists(asset.Identity)) 56Log.LogMessage(MessageImportance.Low, "Source for asset '{0}' is '{0}' since the asset exists.", asset.Identity); 57source = asset.Identity; 61Log.LogMessage(MessageImportance.Low, "Source for asset '{0}' is '{1}' since the asset does not exist.", asset.Identity, asset.OriginalItemSpec); 67source = asset.Identity; 72["OriginalItemSpec"] = asset.Identity, 79Log.LogMessage(MessageImportance.Low, "Skipping asset '{0}' since copy to output directory option is '{1}'", asset.Identity, asset.CopyToOutputDirectory);
Compression\DiscoverPrecompressedAssets.cs (9)
35var candidatesByIdentity = candidates.ToDictionary(asset => asset.Identity, OSPath.PathComparer); 48candidate.Identity); 55candidate.Identity, 62candidate.Identity, 63relatedAsset.Identity); 79var identityWithoutExtension = candidate.Identity.Substring(0, candidate.Identity.Length - 3); // We take advantage we know the extension is .br or .gz. 111asset.OriginalItemSpec = relatedAsset.Identity; 112asset.RelatedAsset = relatedAsset.Identity;
Compression\ResolveCompressedAssets.cs (11)
81asset.Identity, 95asset.Identity, 105asset.Identity, 130var itemSpec = asset.Identity; 207asset.Identity); 216asset.Identity); 240asset.Identity, 247asset.Identity, 294asset.Identity); 320OriginalItemSpec = asset.Identity, 321RelatedAsset = asset.Identity,
ComputeEndpointsForReferenceStaticWebAssets.cs (1)
40Log.LogMessage(MessageImportance.Low, "Skipping endpoint '{0}' because route '{1}' is already updated.", asset.Identity, oldRoute);
ComputeReferenceStaticWebAssetItems.cs (3)
52Environment.NewLine + string.Join(Environment.NewLine, all.Select(a => $"({a.Identity},{a.AssetKind})"))); 107candidate.Identity, 116candidate.Identity,
ComputeStaticWebAssetsForCurrentProject.cs (2)
42Environment.NewLine + string.Join(Environment.NewLine, all.Select(a => $"({a.Identity},{a.AssetKind})"))); 52Log.LogMessage(MessageImportance.Low, "Skipping asset '{0}' because it is for referenced projects only.", selected.Identity);
Data\StaticWebAsset.cs (34)
57_identity = asset.Identity; 509var file = ResolveFile(Identity, OriginalItemSpec); 595throw new InvalidOperationException($"Unknown source type '{SourceType}' for '{Identity}'."); 600throw new InvalidOperationException($"The '{nameof(SourceId)}' for the asset must be defined for '{Identity}'."); 605throw new InvalidOperationException($"The '{nameof(ContentRoot)}' for the asset must be defined for '{Identity}'."); 610throw new InvalidOperationException($"The '{nameof(BasePath)}' for the asset must be defined for '{Identity}'."); 615throw new InvalidOperationException($"The '{nameof(RelativePath)}' for the asset must be defined for '{Identity}'."); 620throw new InvalidOperationException($"The '{nameof(OriginalItemSpec)}' for the asset must be defined for '{Identity}'."); 630throw new InvalidOperationException($"Unknown Asset kind '{AssetKind}' for '{Identity}'."); 640throw new InvalidOperationException($"Unknown Asset mode '{AssetMode}' for '{Identity}'."); 650throw new InvalidOperationException($"Unknown Asset role '{AssetRole}' for '{Identity}'."); 655throw new InvalidOperationException($"Related asset for '{AssetRole}' asset '{Identity}' is not defined."); 660throw new InvalidOperationException($"Alternative asset '{Identity}' does not define an asset trait name or value."); 665throw new InvalidOperationException($"Fingerprint for '{Identity}' is not defined."); 670throw new InvalidOperationException($"Integrity for '{Identity}' is not defined."); 675throw new InvalidOperationException($"File length for '{Identity}' is not defined."); 680throw new InvalidOperationException($"Last write time for '{Identity}' is not defined."); 846var result = string.Compare(Identity, other.Identity, StringComparison.Ordinal); 973Identity == other.Identity && 1107var pattern = StaticWebAssetPathPattern.Parse(pathWithTokens, Identity); 1113var pattern = StaticWebAssetPathPattern.Parse(pathWithTokens, Identity); 1118$"Identity: {Identity}, " + 1144hash.Add(Identity); 1197var pattern = StaticWebAssetPathPattern.Parse(RelativePath, Identity); 1207var pattern = StaticWebAssetPathPattern.Parse(relativePath, Identity); 1213internal FileInfo ResolveFile() => ResolveFile(Identity, OriginalItemSpec); 1237dictionary.Add(candidateAsset.Identity, candidateAsset); 1326string ITaskItem2.EvaluatedIncludeEscaped { get => Identity; set => Identity = value; } 1327string ITaskItem.ItemSpec { get => Identity; set => Identity = value; } 1380"FullPath" => Identity ?? "", 1381nameof(Identity) => Identity ?? "",
DefineStaticWebAssetEndpoints.cs (4)
192AssetFile = asset.Identity, 197Log.LogMessage(MessageImportance.Low, $"Adding endpoint {endpoint.Route} for asset {asset.Identity}."); 236if (ExistingEndpointsByAssetFile != null && ExistingEndpointsByAssetFile.TryGetValue(asset.Identity, out var set)) 252Log.LogMessage(MessageImportance.Low, $"Skipping asset {asset.Identity} because an endpoint for it already exists at {route}.");
FilterStaticWebAssetEndpoints.cs (2)
51if (asset != null && !endpointFoundMatchingAsset.ContainsKey(asset.Identity)) 53endpointFoundMatchingAsset.Add(asset.Identity, asset);
GenerateStaticWebAssetEndpointsManifest.cs (2)
68.ToDictionary(a => a.ResolvedAsset.Identity, a => a, OSPath.PathComparer); 196asset.Identity,
GenerateStaticWebAssetsDevelopmentManifest.cs (4)
118asset.Identity, 311if (File.Exists(asset.Identity)) 313if (asset.Identity.StartsWith(asset.ContentRoot, OSPath.PathComparison)) 319return StaticWebAsset.Normalize(asset.Identity[asset.ContentRoot.Length..]);
GenerateStaticWebAssetsManifest.cs (3)
48Array.Sort(assets, (l, r) => string.CompareOrdinal(l.Identity, r.Identity)); 102var assetsByIdentity = assets.ToDictionary(a => a.Identity, a => a, OSPath.PathComparer);
MergeStaticWebAssets.cs (12)
31Array.Sort(assets, (a, b) => string.CompareOrdinal(a.Identity, b.Identity)); 84if (!ReferenceEquals(prototypeItem, item) && string.Equals(prototypeItem.Identity, item.Identity, OSPath.PathComparison)) 89Log.LogMessage(MessageImportance.Normal, $"Removing '{assetToRemove.Identity}' because merge behavior is {assetToRemove.AssetMergeBehavior}."); 100Log.LogMessage(MessageImportance.Normal, $"Removing '{assetToRemove.Identity}' because merge behavior is {assetToRemove.AssetMergeBehavior}."); 112Log.LogMessage(MessageImportance.Normal, $"Removing '{assetToRemove.Identity}' because merge behavior is {assetToRemove.AssetMergeBehavior}."); 124Log.LogMessage(MessageImportance.Normal, $"Removing '{assetToRemove.Identity}' because merge behavior is {assetToRemove.AssetMergeBehavior}."); 136Log.LogMessage(MessageImportance.Normal, $"Removing '{assetToRemove.Identity}' because merge behavior is {assetToRemove.AssetMergeBehavior}."); 154Log.LogMessage(MessageImportance.Normal, $"Skipping '{right.Identity}' because it is a duplicate of '{left.Identity}'."); 161Log.LogMessage(MessageImportance.Normal, $"Skipping '{sourceAsset.Identity}' because merge behavior '{sourceAsset.AssetMergeBehavior}' is different from '{targetAsset.AssetMergeBehavior}'.");
ResolveFingerprintedStaticWebAssetEndpointsForAssets.cs (7)
38if (!endpointsByAsset.TryGetValue(asset.Identity, out var endpoints)) 40Log.LogError($"No endpoint found for asset '{asset.Identity}'"); 60Log.LogError($"No endpoint found for asset '{asset.Identity}' with path '{assetPath}' whose route matches its path."); 74Log.LogMessage(MessageImportance.Low, $"Selected endpoint '{endpoint.Route}' for asset '{asset.Identity}' because it has a fingerprinted route '{route}'."); 87Log.LogMessage(MessageImportance.Low, $"Selected endpoint '{endpoints[0].Route}' for asset '{asset.Identity}' because no fingerprinted endpoint was found."); 118Log.LogMessage(MessageImportance.Low, $"Selected endpoint '{endpoint.Route}' for asset '{asset.Identity}' because '{assetPath}' matches resolved route '{route}'."); 123Log.LogMessage(MessageImportance.Low, $"Skipping endpoint '{endpoint.Route}' for asset '{asset.Identity}' because '{assetPath}' does not match resolved route '{route}'.");
UpdateExternallyDefinedStaticWebAssets.cs (3)
52if (!endpointByAsset.TryGetValue(asset.Identity, out var endpoint)) 54Log.LogMessage($"Asset {asset.Identity} does not have an associated endpoint defined."); 58Log.LogMessage($"Inferred fingerprint {fingerprint} for asset {asset.Identity}. Relative path updated to {newRelativePath}.");
Microsoft.NET.Sdk.StaticWebAssets.Tests (73)
AspNetSdkBaselineTest.cs (3)
129File.Exists(a.Identity) && 141.Concat(computedFiles.Select(a => a.Identity)) 238.Concat(computedFiles.Select(a => a.Identity))
StaticWebAssetEndpointsIntegrationTest.cs (5)
337var publishAsset = publishManifest.Assets.Where(a => a.Identity == unCompressedAssetEndpoint.Single().AssetFile); 345var publishGzAsset = publishManifest.Assets.Where(a => a.Identity == appGzAssetEndpoint.Single().AssetFile); 347publishGzAsset.Single().RelatedAsset.Should().Be(publishAsset.Single().Identity); 354var publishBrAsset = publishManifest.Assets.Where(a => a.Identity == appBrAssetEndpoint.Single().AssetFile); 356publishBrAsset.Single().RelatedAsset.Should().Be(publishAsset.Single().Identity);
StaticWebAssets\DiscoverPrecompressedAssetsTest.cs (3)
96asset.ItemSpec.Should().Be(compressedCandidate.Identity); 97asset.GetMetadata("RelatedAsset").Should().Be(uncompressedCandidate.Identity); 98asset.GetMetadata("OriginalItemSpec").Should().Be(uncompressedCandidate.Identity);
StaticWebAssets\DiscoverStaticWebAssetsTest.cs (4)
681Assert.Equal(cache.CachedAssets["input2"].Identity, otherManifest.CachedAssets["input2"].Identity); 683Assert.Equal(cache.CachedAssets["input1"].Identity, otherManifest.CachedAssets["input1"].Identity);
StaticWebAssets\FilterStaticWebAssetEndpointsTest.cs (12)
25Array.Sort(assets, (l, r) => string.Compare(l.Identity, r.Identity, StringComparison.Ordinal)); 69Array.Sort(assets, (l, r) => string.Compare(l.Identity, r.Identity, StringComparison.Ordinal)); 105Array.Sort(assets, (l, r) => string.Compare(l.Identity, r.Identity, StringComparison.Ordinal)); 138Array.Sort(assets, (l, r) => string.Compare(l.Identity, r.Identity, StringComparison.Ordinal)); 174Array.Sort(assets, (l, r) => string.Compare(l.Identity, r.Identity, StringComparison.Ordinal)); 212Array.Sort(assets, (l, r) => string.Compare(l.Identity, r.Identity, StringComparison.Ordinal));
StaticWebAssets\GenerateStaticWebAssetEndpointsManifestTest.cs (4)
181Array.Sort(assets, (l, r) => string.Compare(l.Identity, r.Identity, StringComparison.Ordinal)); 230Array.Sort(assets, (l, r) => string.Compare(l.Identity, r.Identity, StringComparison.Ordinal));
StaticWebAssets\GenerateStaticWebAssetsManifestTest.cs (1)
115AssetFile = asset.Identity,
StaticWebAssets\ReadStaticWebAssetsManifestFileTest.cs (1)
179asset.GetMetadata(nameof(StaticWebAsset.Identity)).Should().BeEquivalentTo($"{identity}");
StaticWebAssets\UpdateStaticWebAssetEndpointsTest.cs (12)
27Array.Sort(assets, (l, r) => string.Compare(l.Identity, r.Identity, StringComparison.Ordinal)); 72Array.Sort(assets, (l, r) => string.Compare(l.Identity, r.Identity, StringComparison.Ordinal)); 113Array.Sort(assets, (l, r) => string.Compare(l.Identity, r.Identity, StringComparison.Ordinal)); 158Array.Sort(assets, (l, r) => string.Compare(l.Identity, r.Identity, StringComparison.Ordinal)); 204Array.Sort(assets, (l, r) => string.Compare(l.Identity, r.Identity, StringComparison.Ordinal)); 245Array.Sort(assets, (l, r) => string.Compare(l.Identity, r.Identity, StringComparison.Ordinal));
StaticWebAssetsBaselineComparer.cs (14)
58{string.Join($"{Environment.NewLine} ", foundDuplicateAssetss.Select(a => @$"{a.Key.Identity} - {a.Value.Length}"))}{Environment.NewLine}"); 67var actualAssetsByIdentity = actual.Assets.GroupBy(a => a.Identity).ToDictionary(a => a.Key, a => a.Order().ToArray()); 150Array.Sort(manifestAssets, (a, b) => a.Identity.CompareTo(b.Identity)); 151Array.Sort(expectedAssets, (a, b) => a.Identity.CompareTo(b.Identity)); 179For {expectedAsset.Identity}: 232{string.Join($"{Environment.NewLine}\t", missingAssets.Select(a => a.Identity))}"); 238{string.Join($"{Environment.NewLine}\t", unexpectedAssets.Select(a => a.Identity))}"); 254if (manifestAsset.Identity != expectedAsset.Identity) 256assetDifferences.Add($"Expected manifest Identity of {expectedAsset.Identity} but found {manifestAsset.Identity}."); 318return Path.GetExtension(asset.Identity.TrimEnd(']'));
StaticWebAssetsBaselineFactory.cs (10)
78var assetsByIdentity = manifest.Assets.ToDictionary(a => a.Identity); 82var relatedEndpoints = endpointsByAssetFile.GetValueOrDefault(asset.Identity); 86endpoint.AssetFile = asset.Identity; 92var identity = asset.Identity.Replace('\\', Path.DirectorySeparatorChar); 96asset.Identity = asset.Identity.Replace(Path.DirectorySeparatorChar, '\\'); 99endpoint.AssetFile = asset.Identity; 104else if ((asset.Identity.EndsWith(".gz", StringComparison.OrdinalIgnoreCase) || asset.Identity.EndsWith(".br", StringComparison.OrdinalIgnoreCase)) 108var identity = asset.Identity.Replace('\\', Path.DirectorySeparatorChar); 220asset.Identity,
StaticWebAssetsCompressionIntegrationTest.cs (4)
64var gzipAsset = manifest2.Assets.Single(a => string.Equals(a.Identity, gzipFile, StringComparison.Ordinal)); 65var brotliAsset = manifest2.Assets.Single(a => string.Equals(a.Identity, brotliFile, StringComparison.Ordinal)); 176var gzipAsset = manifest2.Assets.Single(a => string.Equals(a.Identity, gzipFile, StringComparison.Ordinal)); 177var brotliAsset = manifest2.Assets.Single(a => string.Equals(a.Identity, brotliFile, StringComparison.Ordinal));