|
|
|
@ -39,15 +39,15 @@ namespace Avalonia.Build.Tasks |
|
|
|
|
|
|
|
public static CompileResult Compile(IBuildEngine engine, string input, string[] references, |
|
|
|
string projectDirectory, |
|
|
|
string output, bool verifyIl, MessageImportance logImportance, string strongNameKey, bool patchCom, |
|
|
|
string output, bool verifyIl, bool defaultCompileBindings, MessageImportance logImportance, string strongNameKey, bool patchCom, |
|
|
|
bool skipXamlCompilation) |
|
|
|
{ |
|
|
|
return Compile(engine, input, references, projectDirectory, output, verifyIl, logImportance, strongNameKey, patchCom, skipXamlCompilation, debuggerLaunch:false); |
|
|
|
return Compile(engine, input, references, projectDirectory, output, verifyIl, defaultCompileBindings, logImportance, strongNameKey, patchCom, skipXamlCompilation, debuggerLaunch:false); |
|
|
|
} |
|
|
|
|
|
|
|
internal static CompileResult Compile(IBuildEngine engine, string input, string[] references, |
|
|
|
string projectDirectory, |
|
|
|
string output, bool verifyIl, MessageImportance logImportance, string strongNameKey, bool patchCom, bool skipXamlCompilation, bool debuggerLaunch) |
|
|
|
string output, bool verifyIl, bool defaultCompileBindings, MessageImportance logImportance, string strongNameKey, bool patchCom, bool skipXamlCompilation, bool debuggerLaunch) |
|
|
|
{ |
|
|
|
var typeSystem = new CecilTypeSystem(references |
|
|
|
.Where(r => !r.ToLowerInvariant().EndsWith("avalonia.build.tasks.dll")) |
|
|
|
@ -57,7 +57,7 @@ namespace Avalonia.Build.Tasks |
|
|
|
|
|
|
|
if (!skipXamlCompilation) |
|
|
|
{ |
|
|
|
var compileRes = CompileCore(engine, typeSystem, projectDirectory, verifyIl, logImportance, debuggerLaunch); |
|
|
|
var compileRes = CompileCore(engine, typeSystem, projectDirectory, verifyIl, defaultCompileBindings, logImportance, debuggerLaunch); |
|
|
|
if (compileRes == null && !patchCom) |
|
|
|
return new CompileResult(true); |
|
|
|
if (compileRes == false) |
|
|
|
@ -78,7 +78,8 @@ namespace Avalonia.Build.Tasks |
|
|
|
} |
|
|
|
|
|
|
|
static bool? CompileCore(IBuildEngine engine, CecilTypeSystem typeSystem, |
|
|
|
string projectDirectory, bool verifyIl, |
|
|
|
string projectDirectory, bool verifyIl, |
|
|
|
bool defaultCompileBindings, |
|
|
|
MessageImportance logImportance |
|
|
|
, bool debuggerLaunch = false) |
|
|
|
{ |
|
|
|
@ -143,7 +144,7 @@ namespace Avalonia.Build.Tasks |
|
|
|
var contextClass = XamlILContextDefinition.GenerateContextClass(typeSystem.CreateTypeBuilder(contextDef), typeSystem, |
|
|
|
xamlLanguage, emitConfig); |
|
|
|
|
|
|
|
var compiler = new AvaloniaXamlIlCompiler(compilerConfig, emitConfig, contextClass) { EnableIlVerification = verifyIl }; |
|
|
|
var compiler = new AvaloniaXamlIlCompiler(compilerConfig, emitConfig, contextClass) { EnableIlVerification = verifyIl, DefaultCompileBindings = defaultCompileBindings }; |
|
|
|
|
|
|
|
var editorBrowsableAttribute = typeSystem |
|
|
|
.GetTypeReference(typeSystem.FindType("System.ComponentModel.EditorBrowsableAttribute")) |
|
|
|
|