Skip to content
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

[wasm] Do not set _WasmDevel=true for blazor projects #66793

Merged
merged 3 commits into from
Mar 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void NativeBuild_WithDeployOnBuild_UsedByVS(string config, bool nativeRel
AddItemsPropertiesToProject(projectFile, extraProperties: nativeRelink ? string.Empty : "<RunAOTCompilation>true</RunAOTCompilation>");

// build with -p:DeployOnBuild=true, and that will trigger a publish
(CommandResult res, _) = BuildInternal(id, config, publish: false, "-p:DeployOnBuild=true");
(CommandResult res, _) = BuildInternal(id, config, publish: false, setWasmDevel: false, "-p:DeployOnBuild=true");

var expectedFileType = nativeRelink ? NativeFilesType.Relinked : NativeFilesType.AOT;

Expand Down
8 changes: 4 additions & 4 deletions src/tests/BuildWasmApps/Wasm.Build.Tests/BuildTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ public string CreateBlazorWasmTemplateProject(string id)

protected (CommandResult, string) BlazorBuild(BlazorBuildOptions options, params string[] extraArgs)
{
var res = BuildInternal(options.Id, options.Config, publish: false, extraArgs);
var res = BuildInternal(options.Id, options.Config, publish: false, setWasmDevel: false, extraArgs);
AssertDotNetNativeFiles(options.ExpectedFileType, options.Config, forPublish: false, targetFramework: options.TargetFramework);
AssertBlazorBundle(options.Config, isPublish: false, dotnetWasmFromRuntimePack: options.ExpectedFileType == NativeFilesType.FromRuntimePack);

Expand All @@ -407,7 +407,7 @@ public string CreateBlazorWasmTemplateProject(string id)

protected (CommandResult, string) BlazorPublish(BlazorBuildOptions options, params string[] extraArgs)
{
var res = BuildInternal(options.Id, options.Config, publish: true, extraArgs);
var res = BuildInternal(options.Id, options.Config, publish: true, setWasmDevel: false, extraArgs);
AssertDotNetNativeFiles(options.ExpectedFileType, options.Config, forPublish: true, targetFramework: options.TargetFramework);
AssertBlazorBundle(options.Config, isPublish: true, dotnetWasmFromRuntimePack: options.ExpectedFileType == NativeFilesType.FromRuntimePack);

Expand All @@ -423,7 +423,7 @@ public string CreateBlazorWasmTemplateProject(string id)
return res;
}

protected (CommandResult, string) BuildInternal(string id, string config, bool publish=false, params string[] extraArgs)
protected (CommandResult, string) BuildInternal(string id, string config, bool publish=false, bool setWasmDevel=true, params string[] extraArgs)
{
string label = publish ? "publish" : "build";
Console.WriteLine($"{Environment.NewLine}** {label} **{Environment.NewLine}");
Expand All @@ -435,7 +435,7 @@ public string CreateBlazorWasmTemplateProject(string id)
$"-bl:{logPath}",
$"-p:Configuration={config}",
"-p:BlazorEnableCompression=false",
"-p:_WasmDevel=true"
setWasmDevel ? "-p:_WasmDevel=true" : string.Empty
}.Concat(extraArgs).ToArray();

CommandResult res = new DotNetCommand(s_buildEnv)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void BlazorOnlyLinkRebuild(string config)

string objDir = Path.Combine(_projectDir!, "obj", config, DefaultTargetFramework, "wasm");

BlazorBuild(new BlazorBuildOptions(id, config, NativeFilesType.Relinked));
BlazorBuild(new BlazorBuildOptions(id, config, NativeFilesType.Relinked), "-p:EmccLinkOptimizationFlag=-O2");
File.Move(Path.Combine(s_buildEnv.LogRootPath, id, $"{id}-build.binlog"),
Path.Combine(s_buildEnv.LogRootPath, id, $"{id}-build-first.binlog"));

Expand Down