Add default values for global build options.

This commit is contained in:
Mohammadreza Taikandi 2021-03-26 07:40:53 +00:00
parent e23ec07cab
commit 792afd4567
1 changed files with 2 additions and 2 deletions

View File

@ -43,8 +43,8 @@ namespace MapTo
var compilationOptions = (context.Compilation as CSharpCompilation)?.Options;
return new(
context.GetBuildGlobalOption<AccessModifier>(nameof(ConstructorAccessModifier)),
context.GetBuildGlobalOption<AccessModifier>(nameof(GeneratedMethodsAccessModifier)),
context.GetBuildGlobalOption(nameof(ConstructorAccessModifier), AccessModifier.Public),
context.GetBuildGlobalOption(nameof(GeneratedMethodsAccessModifier), AccessModifier.Public),
context.GetBuildGlobalOption(nameof(GenerateXmlDocument), true),
compilationOptions is not null && (compilationOptions.NullableContextOptions == NullableContextOptions.Warnings || compilationOptions.NullableContextOptions == NullableContextOptions.Enable)
);