-
Notifications
You must be signed in to change notification settings - Fork 5.4k
[browser] Library mode without workload #122607
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
base: main
Are you sure you want to change the base?
Changes from all commits
5045603
b3709e4
991951b
5f80cfd
24c1136
5d9b507
9985286
feb48c4
ee5c599
3c4b6b2
23aa3d8
d474eb2
16f727d
d4fdeb9
b31e81a
3298155
072cb2c
f8ca894
0807980
f931287
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 |
|---|---|---|
|
|
@@ -300,10 +300,12 @@ void AssertFile(string suffix) | |
| } | ||
| } | ||
|
|
||
| [Theory] | ||
| // [InlineData(false)] https://github.com/dotnet/runtime/issues/123477 | ||
| [InlineData(true)] | ||
| public async Task LibraryModeBuild(bool useWasmSdk) | ||
| [Theory, TestCategory("no-workload")] | ||
| [InlineData(false, false)] | ||
| [InlineData(false, true)] | ||
| [InlineData(true, false)] | ||
| [InlineData(true, true)] | ||
| public async Task LibraryMode(bool useWasmSdk, bool isPublish) | ||
|
Comment on lines
+303
to
+308
|
||
| { | ||
| var config = Configuration.Release; | ||
| ProjectInfo info = CopyTestAsset(config, aot: false, TestAsset.LibraryModeTestApp, "libraryMode"); | ||
|
|
@@ -313,13 +315,22 @@ public async Task LibraryModeBuild(bool useWasmSdk) | |
| { "Microsoft.NET.Sdk.WebAssembly", "Microsoft.NET.Sdk" } | ||
| }); | ||
| } | ||
| BuildProject(info, config, new BuildOptions(AssertAppBundle: useWasmSdk)); | ||
|
|
||
| // Without WASM SDK, the project is a plain library with browser-wasm RID. | ||
| // It should build and publish successfully but won't produce a wasm app bundle. | ||
| if (isPublish) | ||
| PublishProject(info, config, new PublishOptions(AssertAppBundle: useWasmSdk)); | ||
| else | ||
| BuildProject(info, config, new BuildOptions(AssertAppBundle: useWasmSdk)); | ||
|
|
||
| if (useWasmSdk) | ||
| { | ||
| var result = await RunForBuildWithDotnetRun(new BrowserRunOptions(config, ExpectedExitCode: 100)); | ||
| var result = isPublish | ||
| ? await RunForPublishWithWebServer(new BrowserRunOptions(config, ExpectedExitCode: 100)) | ||
| : await RunForBuildWithDotnetRun(new BrowserRunOptions(config, ExpectedExitCode: 100)); | ||
|
|
||
| Assert.Contains("WASM Library MyExport is called", result.TestOutput); | ||
| } | ||
|
|
||
| } | ||
|
|
||
| [Theory] | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
Opt out per assembly would be good. Maybe existing
<IsTrimmable>true</IsTrimmable>?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.
Tell me about the scenario please
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 target simulates the default behavior for
OutputType=exe=> "application assembly is root assembly for trimmer"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 is not about components in a nuget ? This is "reactor" runtime+app without
Main()?Isn't that already covered by
[JSExport]being a trimmer root ?