-
Notifications
You must be signed in to change notification settings - Fork 5.4k
[browser] Make WASM framework asset CopyToOutputDirectory configurable #127285
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
Changes from all commits
445d334
1037300
fc681c1
b21ad54
41b60c3
9e1c91a
c5040e2
f239571
6815cdb
f830463
07d1d49
9e284fd
00635ac
c6fe5e5
906e584
07f446a
8eb1a80
40bdbab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,8 +60,35 @@ public async Task BuildThenPublishWithAOT(Configuration config, bool aot) | |
| (_, string output) = BuildProject(info, config, new BuildOptions(Label: "first_build", AOT: aot), isNativeBuild: aot); | ||
|
|
||
| BuildPaths paths = GetBuildPaths(config, forPublish: isPublish); | ||
| // With CopyToOutputDirectory=Never, framework files aren't copied to bin/_framework/ | ||
| // during build. They live in obj subdirs: dotnet.native.* in obj/wasm/for-build/ | ||
| // (for native rebuilds like Release+AOT), and JS/source maps in obj/{config}/{tfm}/fx/{source-id}/_framework/. | ||
| // The boot config (dotnet.js) is at obj/{config}/{tfm}/dotnet.js. | ||
| string fxFrameworkDir = WasmSdkBasedProjectProvider.GetMaterializedFrameworkDir(paths.ObjDir); | ||
|
|
||
| BuildPaths buildObjPaths = paths with { BinFrameworkDir = fxFrameworkDir }; | ||
| IDictionary<string, (string fullPath, bool unchanged)> pathsDict = | ||
| GetFilesTable(info.ProjectName, aot, paths, unchanged: false); | ||
| GetFilesTable(info.ProjectName, aot, buildObjPaths, unchanged: false, bootConfigDir: paths.ObjDir); | ||
|
|
||
| // dotnet.native.* are produced by the native rebuild into obj/wasm/for-build/ using | ||
|
Comment on lines
+69
to
+73
|
||
| // their canonical (non-fingerprinted) names — fingerprinting is applied later when | ||
| // publishing to bin. | ||
| foreach (var nativeName in new[] { "dotnet.native.wasm", "dotnet.native.js" }) | ||
| { | ||
| if (pathsDict.TryGetValue(nativeName, out var entry)) | ||
| { | ||
| pathsDict[nativeName] = (Path.Combine(paths.ObjWasmDir, nativeName), entry.unchanged); | ||
| } | ||
| } | ||
|
|
||
| // dotnet.runtime.js lives in the materialized fx dir under its canonical (non-fingerprinted) | ||
| // name during build — fingerprinting is applied later when publishing to bin. GetFilesTable | ||
| // rewrites this entry to the fingerprinted name (from the boot config, which already reflects | ||
| // the publish layout), so override it back to the unfingerprinted obj/fx path. | ||
| if (pathsDict.TryGetValue("dotnet.runtime.js", out var runtimeJsEntry)) | ||
| { | ||
| pathsDict["dotnet.runtime.js"] = (Path.Combine(fxFrameworkDir, "dotnet.runtime.js"), runtimeJsEntry.unchanged); | ||
| } | ||
|
|
||
| string mainDll = $"{info.ProjectName}.dll"; | ||
| var firstBuildStat = StatFiles(pathsDict); | ||
|
|
||
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.
This overrides
_WasmFrameworkCopyToOutputDirectoryunconditionally. To keep the file overrideable (and consistent with the surrounding properties in thisPropertyGroup), consider setting it only when it’s not already set (e.g., add a Condition checking for empty).