67 writes to AssetFile
Microsoft.NET.Sdk.BlazorWebAssembly.Tests (3)
StaticWebAssetsBaselineFactory.cs (3)
86
endpoint.
AssetFile
= asset.Identity;
99
endpoint.
AssetFile
= asset.Identity;
180
endpoint.
AssetFile
= TemplatizeFilePath(
Microsoft.NET.Sdk.StaticWebAssets.Tasks (4)
ApplyCompressionNegotiation.cs (1)
274
AssetFile
= compressedAsset.Identity,
Data\StaticWebAssetEndpoint.cs (1)
470
AssetFile
= metadataValue;
DefineStaticWebAssetEndpoints.cs (1)
192
AssetFile
= asset.Identity,
GenerateStaticWebAssetEndpointsManifest.cs (1)
116
endpoint.
AssetFile
= asset.ResolvedAsset.ComputeTargetPath("", '/', StaticWebAssetTokenResolver.Instance);
Microsoft.NET.Sdk.StaticWebAssets.Tests (60)
StaticWebAssets\ApplyCompressionNegotiationTest.cs (47)
80
AssetFile
= Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")),
94
AssetFile
= Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")),
107
AssetFile
= Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")),
192
AssetFile
= Path.Combine(AppContext.BaseDirectory, $"{expectedName}.br"),
258
AssetFile
= Path.Combine(AppContext.BaseDirectory, $"{expectedName}.gz"),
324
AssetFile
= Path.Combine(AppContext.BaseDirectory, "wwwroot", "candidate.js"),
377
AssetFile
= Path.Combine(AppContext.BaseDirectory, $"{expectedName}.br"),
435
AssetFile
= Path.Combine(AppContext.BaseDirectory, $"{expectedName}.gz"),
493
AssetFile
= Path.Combine(AppContext.BaseDirectory, $"{expectedName}.br"),
549
AssetFile
= Path.Combine(AppContext.BaseDirectory, $"{expectedName}.gz"),
605
AssetFile
= Path.Combine(AppContext.BaseDirectory, "wwwroot", "candidate.js"),
648
AssetFile
= Path.Combine(AppContext.BaseDirectory, $"{expectedName}.br"),
696
AssetFile
= Path.Combine(AppContext.BaseDirectory, $"{expectedName}.gz"),
806
AssetFile
= Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")),
819
AssetFile
= Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")),
831
AssetFile
= Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")),
844
AssetFile
= Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")),
856
AssetFile
= Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")),
911
AssetFile
= Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")),
924
AssetFile
= Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")),
935
AssetFile
= Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")),
948
AssetFile
= Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")),
959
AssetFile
= Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")),
982
AssetFile
= Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")),
995
AssetFile
= Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")),
1007
AssetFile
= Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")),
1020
AssetFile
= Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")),
1032
AssetFile
= Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")),
1103
AssetFile
= Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")),
1116
AssetFile
= Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")),
1127
AssetFile
= Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")),
1140
AssetFile
= Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")),
1151
AssetFile
= Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")),
1164
AssetFile
= Path.GetFullPath(Path.Combine("compressed", "candidate.js.br")),
1185
AssetFile
= Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")),
1198
AssetFile
= Path.GetFullPath(Path.Combine("compressed", "candidate.js.br")),
1211
AssetFile
= Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")),
1223
AssetFile
= Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")),
1236
AssetFile
= Path.GetFullPath(Path.Combine("compressed", "candidate.js.br")),
1249
AssetFile
= Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")),
1261
AssetFile
= Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")),
1274
AssetFile
= Path.GetFullPath(Path.Combine("compressed", "candidate.js.br")),
1369
AssetFile
= Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")),
1383
AssetFile
= Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")),
1396
AssetFile
= Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")),
1410
AssetFile
= Path.GetFullPath(Path.Combine("publish", "candidate.js")),
1491
AssetFile
= Path.GetFullPath(assetFile),
StaticWebAssets\ComputeEndpointsForReferenceStaticWebAssetsTest.cs (1)
140
AssetFile
= Path.GetFullPath(assetFile),
StaticWebAssets\DefineStaticWebAssetEndpointsTest.cs (1)
647
AssetFile
= Path.GetFullPath(assetFile),
StaticWebAssets\GenerateStaticWebAssetEndpointsManifestTest.cs (4)
23
AssetFile
= "index.html",
66
AssetFile
= "index.fingerprint.js",
109
AssetFile
= "index.html",
142
AssetFile
= "index.fingerprint.js",
StaticWebAssets\GenerateStaticWebAssetEndpointsPropsFileTest.cs (1)
211
AssetFile
= Path.GetFullPath(assetFile),
StaticWebAssets\GenerateStaticWebAssetsManifestTest.cs (1)
115
AssetFile
= asset.Identity,
StaticWebAssets\ResolveFingerprintedStaticWebAssetEndpointsForAssetsTest.cs (1)
210
endpoints[0].
AssetFile
= Path.GetFullPath("other.js");
StaticWebAssets\UpdateStaticWebAssetEndpointsTest.cs (1)
253
AssetFile
= fingerprintedEndpoints[0].AssetFile + ".gz",
StaticWebAssetsBaselineFactory.cs (3)
86
endpoint.
AssetFile
= asset.Identity;
99
endpoint.
AssetFile
= asset.Identity;
180
endpoint.
AssetFile
= TemplatizeFilePath(
108 references to AssetFile
Microsoft.NET.Sdk.BlazorWebAssembly.Tests (16)
StaticWebAssetsBaselineComparer.cs (14)
84
.ThenBy(a => a.
AssetFile
)
97
{string.Join($"{Environment.NewLine} ", foundDuplicateEndpoints.Select(a => @$"{a.Key.Route} - {a.Key.
AssetFile
} - {a.Key.Selectors.Length} - {a.Value.Length}"))}{Environment.NewLine}");
101
actualAssetsByIdentity.Should().ContainKey(endpoint.
AssetFile
);
106
.ThenBy(a => a.
AssetFile
)
353
For {expectedAsset.
AssetFile
}:
405
string.Join($"{Environment.NewLine}\t", expectedEndpoints.Select(a => $"{a.Route} - {a.Selectors.Length} - {a.
AssetFile
}")),
407
string.Join($"{Environment.NewLine}\t", manifestEndpoints.Select(a => $"{a.Route} - {a.Selectors.Length} - {a.
AssetFile
}"))
413
{string.Join($"{Environment.NewLine}\t", missingEndpoints.Select(a => $"{a.Route} - {a.
AssetFile
}"))}");
419
{string.Join($"{Environment.NewLine}\t", unexpectedEndpoints.Select(a => $"{a.Route} - {a.
AssetFile
}"))}");
439
if (manifestAsset.
AssetFile
!= expectedAsset.
AssetFile
)
441
assetDifferences.Add($"Expected manifest SourceType of {expectedAsset.
AssetFile
} but found {manifestAsset.
AssetFile
}.");
506
return Path.GetExtension(asset.
AssetFile
.TrimEnd(']'));
StaticWebAssetsBaselineFactory.cs (2)
79
var endpointsByAssetFile = manifest.Endpoints.GroupBy(e => e.
AssetFile
).ToDictionary(g => g.Key, g => g.ToArray());
181
endpoint.
AssetFile
,
Microsoft.NET.Sdk.StaticWebAssets.Tasks (49)
ApplyCompressionNegotiation.cs (3)
115
if (endpointsByAsset.TryGetValue(endpoint.
AssetFile
, out var endpointsToSkip))
122
endpointsByAsset.Remove(endpoint.
AssetFile
);
139
Log.LogMessage(MessageImportance.Low, " Adding endpoint '{0}'", endpoint.
AssetFile
);
ComputeEndpointsForReferenceStaticWebAssets.cs (3)
30
if (assets.TryGetValue(candidateEndpoint.
AssetFile
, out var asset))
59
Log.LogMessage(MessageImportance.Low, "Adding endpoint {0} for asset {1} with updated route {2}.", candidateEndpoint.Route, candidateEndpoint.
AssetFile
, candidateEndpoint.Route);
66
Log.LogMessage(MessageImportance.Low, "Skipping endpoint {0} because the asset {1} was not found.", candidateEndpoint.Route, candidateEndpoint.
AssetFile
);
Data\StaticWebAssetEndpoint.cs (21)
52
_assetFile ??= _originalItem?.GetMetadata(nameof(
AssetFile
));
157
var assetFile = endpoint.
AssetFile
;
184
0 => string.Compare(a.
AssetFile
, b.
AssetFile
, StringComparison.Ordinal),
233
AssetFile
== other.
AssetFile
&&
260
hashCode.Add(
AssetFile
);
278
$"{nameof(StaticWebAssetEndpoint)}: Route = {Route}, AssetFile = {
AssetFile
}, Selectors = {StaticWebAssetEndpointSelector.ToMetadataValue(Selectors ?? [])}, ResponseHeaders = {ResponseHeaders?.Length}, EndpointProperties = {StaticWebAssetEndpointProperty.ToMetadataValue(EndpointProperties ?? [])}";
288
var assetFileComparison = StringComparer.Ordinal.Compare(
AssetFile
, other.
AssetFile
);
401
string.Equals(x.
AssetFile
, y.
AssetFile
, StringComparison.Ordinal);
412
return HashCode.Combine(obj.Route, obj.
AssetFile
);
423
nameof(
AssetFile
),
456
nameof(
AssetFile
) =>
AssetFile
?? "",
469
case nameof(
AssetFile
):
499
{ nameof(
AssetFile
),
AssetFile
?? "" },
524
destinationItem.SetMetadata(nameof(
AssetFile
),
AssetFile
?? "");
DefineStaticWebAssetEndpoints.cs (1)
79
var assetFile = endpointCandidate.GetMetadata(nameof(StaticWebAssetEndpoint.
AssetFile
));
FilterStaticWebAssetEndpoints.cs (1)
44
if (assetFiles.Count > 0 && !assetFiles.TryGetValue(endpoint.
AssetFile
, out asset))
GenerateStaticWebAssetEndpointsManifest.cs (3)
85
if (!manifestAssets.TryGetValue(endpoint.
AssetFile
, out var asset))
87
Log.LogMessage(MessageImportance.Low, "Skipping endpoint '{0}' because the asset '{1}' is not part of the manifest", endpoint.Route, endpoint.
AssetFile
);
119
Log.LogMessage(MessageImportance.Low, "Including endpoint '{0}' for asset '{1}' with final location '{2}'", endpoint.Route, endpoint.
AssetFile
, asset.TargetPath);
GenerateStaticWebAssetEndpointsPropsFile.cs (5)
46
.ThenBy(e => e.
AssetFile
, StringComparer.OrdinalIgnoreCase);
50
var asset = assets[element.
AssetFile
];
56
new XElement(nameof(StaticWebAssetEndpoint.
AssetFile
), fullPathExpression),
127
if (!asset.ContainsKey(endpoint.
AssetFile
))
129
Log.LogError($"The asset file '{endpoint.
AssetFile
}' specified in the endpoint '{endpoint.Route}' does not exist.");
GenerateStaticWebAssetsManifest.cs (5)
53
0 => string.CompareOrdinal(l.
AssetFile
, r.
AssetFile
),
107
if (assetsByIdentity.ContainsKey(endpoint.
AssetFile
))
110
Log.LogMessage(MessageImportance.Low, $"Accepted endpoint: Route='{endpoint.Route}', AssetFile='{endpoint.
AssetFile
}'");
114
Log.LogMessage(MessageImportance.Low, $"Filtered out endpoint: Endpoint='{endpoint.Route}' AssetFile='{endpoint.
AssetFile
}'");
OverrideHtmlAssetPlaceholders.cs (3)
48
var endpoints = StaticWebAssetEndpoint.FromItemGroup(Endpoints).Where(e => e.
AssetFile
.EndsWith(".js") || e.
AssetFile
.EndsWith(".mjs"));
220
var asset = Assets.FirstOrDefault(a => a.ItemSpec == endpoint.
AssetFile
);
ResolveFingerprintedStaticWebAssetEndpointsForAssets.cs (1)
32
var endpointsByAsset = candidateEndpoints.GroupBy(e => e.
AssetFile
, OSPath.PathComparer)
ResolveStaticWebAssetEndpointRoutes.cs (2)
25
if (!assets.TryGetValue(endpoint.
AssetFile
, out var asset))
27
Log.LogError($"The asset file '{endpoint.
AssetFile
}' for endpoint '{endpoint.Route}' was not found.");
UpdateExternallyDefinedStaticWebAssets.cs (1)
42
.GroupBy(e => e.
AssetFile
, OSPath.PathComparer)
Microsoft.NET.Sdk.StaticWebAssets.Tests (43)
StaticWebAssetEndpointsIntegrationTest.cs (7)
199
var file = new FileInfo(endpoint.
AssetFile
);
337
var publishAsset = publishManifest.Assets.Where(a => a.Identity == unCompressedAssetEndpoint.Single().
AssetFile
);
345
var publishGzAsset = publishManifest.Assets.Where(a => a.Identity == appGzAssetEndpoint.Single().
AssetFile
);
354
var publishBrAsset = publishManifest.Assets.Where(a => a.Identity == appBrAssetEndpoint.Single().
AssetFile
);
523
var endpointsByAssetFile = endpoints.Endpoints.GroupBy(e => e.
AssetFile
).ToDictionary(g => g.Key, g => g.ToArray());
527
wwwrootFolderFiles.Should().Contain(endpoint.
AssetFile
);
528
foundAssets.Add(endpoint.
AssetFile
);
StaticWebAssets\ApplyCompressionNegotiationTest.cs (3)
1560
var compressedEndpoint = endpoints.FirstOrDefault(e => e.Route == "candidate.js" && e.
AssetFile
.Contains("candidate.js.gz"));
1627
var compressedEndpoint = endpoints.FirstOrDefault(e => e.Route == "candidate.js" && e.
AssetFile
.Contains("candidate.js.gz"));
1694
var compressedEndpoint = endpoints.FirstOrDefault(e => e.Route == "candidate.js" && e.
AssetFile
.Contains("candidate.js.gz"));
StaticWebAssets\DefineStaticWebAssetEndpointsTest.cs (6)
58
endpoint.
AssetFile
.Should().Be(Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")));
126
endpoint.
AssetFile
.Should().Be(Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")));
175
otherEndpoint.
AssetFile
.Should().Be(Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")));
243
endpoint.
AssetFile
.Should().Be(Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")));
292
otherEndpoint.
AssetFile
.Should().Be(Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")));
537
endpoint.
AssetFile
.Should().Be(assetIdentity);
StaticWebAssets\ReadStaticWebAssetsManifestFileTest.cs (1)
198
endpoint.GetMetadata(nameof(StaticWebAssetEndpoint.
AssetFile
)).Should().BeEquivalentTo($"{identity}");
StaticWebAssets\UpdateStaticWebAssetEndpointsTest.cs (3)
253
AssetFile = fingerprintedEndpoints[0].
AssetFile
+ ".gz",
284
var updatedUnmodifiedEndpoint = updatedEndpoints.Where(e => e.
AssetFile
.EndsWith(".gz"));
287
var updatedModifiedEndpoints = updatedEndpoints.Where(e => !e.
AssetFile
.EndsWith(".gz"));
StaticWebAssetsBaselineComparer.cs (14)
84
.ThenBy(a => a.
AssetFile
)
97
{string.Join($"{Environment.NewLine} ", foundDuplicateEndpoints.Select(a => @$"{a.Key.Route} - {a.Key.
AssetFile
} - {a.Key.Selectors.Length} - {a.Value.Length}"))}{Environment.NewLine}");
101
actualAssetsByIdentity.Should().ContainKey(endpoint.
AssetFile
);
106
.ThenBy(a => a.
AssetFile
)
353
For {expectedAsset.
AssetFile
}:
405
string.Join($"{Environment.NewLine}\t", expectedEndpoints.Select(a => $"{a.Route} - {a.Selectors.Length} - {a.
AssetFile
}")),
407
string.Join($"{Environment.NewLine}\t", manifestEndpoints.Select(a => $"{a.Route} - {a.Selectors.Length} - {a.
AssetFile
}"))
413
{string.Join($"{Environment.NewLine}\t", missingEndpoints.Select(a => $"{a.Route} - {a.
AssetFile
}"))}");
419
{string.Join($"{Environment.NewLine}\t", unexpectedEndpoints.Select(a => $"{a.Route} - {a.
AssetFile
}"))}");
439
if (manifestAsset.
AssetFile
!= expectedAsset.
AssetFile
)
441
assetDifferences.Add($"Expected manifest SourceType of {expectedAsset.
AssetFile
} but found {manifestAsset.
AssetFile
}.");
506
return Path.GetExtension(asset.
AssetFile
.TrimEnd(']'));
StaticWebAssetsBaselineFactory.cs (2)
79
var endpointsByAssetFile = manifest.Endpoints.GroupBy(e => e.
AssetFile
).ToDictionary(g => g.Key, g => g.ToArray());
181
endpoint.
AssetFile
,
StaticWebAssetsCompressionIntegrationTest.cs (6)
60
var standardEndpoints = manifest2.Endpoints.Where(e => string.Equals(e.
AssetFile
, file, StringComparison.Ordinal)).ToArray();
61
var gzipEndpoints = manifest2.Endpoints.Where(e => string.Equals(e.
AssetFile
, gzipFile, StringComparison.Ordinal)).ToArray();
62
var brotliEndpoints = manifest2.Endpoints.Where(e => string.Equals(e.
AssetFile
, brotliFile, StringComparison.Ordinal)).ToArray();
172
var standardEndpoints = manifest2.Endpoints.Where(e => string.Equals(e.
AssetFile
, file, StringComparison.Ordinal)).ToArray();
173
var gzipEndpoints = manifest2.Endpoints.Where(e => string.Equals(e.
AssetFile
, gzipFile, StringComparison.Ordinal)).ToArray();
174
var brotliEndpoints = manifest2.Endpoints.Where(e => string.Equals(e.
AssetFile
, brotliFile, StringComparison.Ordinal)).ToArray();
StaticWebAssetsFingerprintingTest.cs (1)
176
=> endpoints.Endpoints.FirstOrDefault(e => e.Route == route && e.Selectors.Length == 0)?.
AssetFile
?? throw new Exception($"Missing endpoint for file '{route}' in '{endpointsManifestPath}'");