Skip to content

Commit

Permalink
enable nullable by default in the classlib template
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarolf committed Jun 2, 2021
1 parent 8006248 commit 7f9adf7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@
"datatype": "bool",
"description": "If specified, skips the automatic restore of the project on create.",
"defaultValue": "false"
},
"Nullable": {
"type": "parameter",
"datatype": "bool",
"defaultValue": "true",
"description": "Whether to enable nullable reference types for this project."
}
},
"primaryOutputs": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<TargetFramework Condition="'$(TargetFrameworkOverride)' != ''">TargetFrameworkOverride</TargetFramework>
<RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">Company.ClassLibrary1</RootNamespace>
<LangVersion Condition="'$(langVersion)' != ''">$(ProjectLanguageVersion)</LangVersion>
<Nullable Condition="'$(Nullable)' == 'true'">enable</Nullable>
</PropertyGroup>

</Project>
6 changes: 5 additions & 1 deletion test/dotnet-new3.UnitTests/DotnetNewHelp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ public class DotnetNewHelp
--no-restore If specified, skips the automatic restore of the project on create.
bool - Optional
Default: false ";
Default: false
--nullable Whether to enable nullable reference types for this project.
bool - Optional
Default: true ";

#endregion
private readonly ITestOutputHelper _log;
Expand Down

0 comments on commit 7f9adf7

Please sign in to comment.