-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Static web assets] Account for HintPath when we compute the build assets #19873
Merged
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a464f24
Static web assets fixes and cleanups
javiercn cd1f4d2
Additional tests and cleanups
javiercn 33ca8f8
Fix log messages
javiercn c3e1a22
Update src/RazorSdk/Tasks/StaticWebAssets/ComputeStaticWebAssetsTarge…
javiercn a6bd12a
Respect AppendFrameowrkToOutputPath=false
javiercn a996c81
new test baselines
javiercn b58cf5b
Update src/RazorSdk/Targets/Microsoft.NET.Sdk.Razor.StaticWebAssets.t…
javiercn d10a14d
Fix test
javiercn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -737,6 +737,46 @@ public void PublishProjectWithReferences_NoBuild_GeneratesPublishJsonManifestAnd | |
intermediateOutputPath); | ||
} | ||
|
||
[Fact] | ||
public void PublishProjectWithReferences_AppendTargetFrameworkToOutputPathFalse_GeneratesPublishJsonManifestAndCopiesPublishAssets() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
{ | ||
var testAsset = "RazorAppWithPackageAndP2PReference"; | ||
ProjectDirectory = CreateAspNetSdkTestAsset(testAsset); | ||
|
||
var restore = new RestoreCommand(Log, Path.Combine(ProjectDirectory.TestRoot, "AppWithPackageAndP2PReference")); | ||
restore.Execute().Should().Pass(); | ||
|
||
var publish = new PublishCommand(Log, Path.Combine(ProjectDirectory.TestRoot, "AppWithPackageAndP2PReference")); | ||
publish.WithWorkingDirectory(ProjectDirectory.Path); | ||
publish.Execute("/p:AppendTargetFrameworkToOutputPath=false", "/bl").Should().Pass(); | ||
|
||
var intermediateOutputPath = publish.GetIntermediateDirectory("", "Debug").ToString(); | ||
var publishPath = publish.GetOutputDirectory("", "Debug").ToString(); | ||
|
||
// GenerateStaticWebAssetsManifest should generate the manifest file. | ||
var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); | ||
new FileInfo(path).Should().Exist(); | ||
AssertManifest( | ||
StaticWebAssetsManifest.FromJsonBytes(File.ReadAllBytes(path)), | ||
LoadBuildManifest()); | ||
|
||
// GenerateStaticWebAssetsManifest should copy the file to the output folder. | ||
var finalPath = Path.Combine(publishPath, "AppWithPackageAndP2PReference.staticwebassets.runtime.json"); | ||
new FileInfo(finalPath).Should().NotExist(); | ||
|
||
// GenerateStaticWebAssetsPublishManifest should generate the publish manifest file. | ||
var intermediatePublishManifestPath = Path.Combine(intermediateOutputPath, "staticwebassets.publish.json"); | ||
new FileInfo(path).Should().Exist(); | ||
AssertManifest( | ||
StaticWebAssetsManifest.FromJsonBytes(File.ReadAllBytes(intermediatePublishManifestPath)), | ||
LoadPublishManifest()); | ||
|
||
AssertPublishAssets( | ||
StaticWebAssetsManifest.FromJsonBytes(File.ReadAllBytes(intermediatePublishManifestPath)), | ||
publishPath, | ||
intermediateOutputPath); | ||
} | ||
|
||
[Fact(Skip = "https://github.com/dotnet/sdk/issues/17979")] | ||
public void BuildProjectWithReferences_DeployOnPublish_GeneratesPublishJsonManifestAndCopiesPublishAssets() | ||
{ | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dotnet/aspnetcore#35561