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

Turn XamlC on by default #1422

Merged
merged 4 commits into from
Jun 29, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions .nuspec/Microsoft.Maui.Controls.targets
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
OptimizeIL = "true"
DebugSymbols = "$(DebugSymbols)"
DebugType = "$(DebugType)"
DefaultCompile = "true"
ValidateOnly = "$(_MauiXamlCValidateOnly)"
KeepXamlResources = "$(MauiKeepXamlResources)" />
<Touch Files="$(IntermediateOutputPath)XamlC.stamp" AlwaysCreate="True" />
Expand Down
14 changes: 2 additions & 12 deletions src/Controls/src/Build.Tasks/XamlCTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@ public class XamlCTask : XamlTask
bool hasCompiledXamlResources;
public bool KeepXamlResources { get; set; }
public bool OptimizeIL { get; set; }

[Obsolete("OutputGeneratedILAsCode is obsolete as of version 2.3.4. This option is no longer available.")]
[EditorBrowsable(EditorBrowsableState.Never)]
public bool OutputGeneratedILAsCode { get; set; }

public bool CompileByDefault { get; set; }
public bool DefaultCompile { get; set; }
public bool ForceCompile { get; set; }

public IAssemblyResolver DefaultAssemblyResolver { get; set; }
Expand All @@ -41,7 +36,7 @@ public override bool Execute(out IList<Exception> thrownExceptions)
{
thrownExceptions = null;
LoggingHelper.LogMessage(Normal, $"{new string(' ', 0)}Compiling Xaml, assembly: {Assembly}");
var skipassembly = !CompileByDefault;
var skipassembly = !DefaultCompile;
bool success = true;

if (!File.Exists(Assembly))
Expand Down Expand Up @@ -226,11 +221,6 @@ public override bool Execute(out IList<Exception> thrownExceptions)
initComp.Body.Optimize();
LoggingHelper.LogMessage(Low, $"{new string(' ', 8)}done.");
}

#pragma warning disable 0618
if (OutputGeneratedILAsCode)
LoggingHelper.LogMessage(Low, $"{new string(' ', 6)}Decompiling option has been removed. Use a 3rd party decompiler to admire the beauty of the IL generated");
#pragma warning restore 0618
resourcesToPrune.Add(resource);
}
if (hasCompiledXamlResources)
Expand Down