From 951365e6b16b8a1e6b83c4dcf3e790b76f945d08 Mon Sep 17 00:00:00 2001 From: Vijay Anand E G <81947404+egvijayanand@users.noreply.github.com> Date: Fri, 4 Nov 2022 23:35:07 +0530 Subject: [PATCH] Library target framework option --- .../.template.config/dotnetcli.host.json | 13 +++++++-- .../.template.config/template.json | 29 +++++++++++++++---- .../FormsClassLib/FormsClassLib.csproj | 4 +-- src/FormsTemplatesCLI/release-notes.txt | 8 ++++- 4 files changed, 44 insertions(+), 10 deletions(-) diff --git a/src/FormsTemplatesCLI/FormsClassLib/.template.config/dotnetcli.host.json b/src/FormsTemplatesCLI/FormsClassLib/.template.config/dotnetcli.host.json index fc64c13..cb7ac1c 100644 --- a/src/FormsTemplatesCLI/FormsClassLib/.template.config/dotnetcli.host.json +++ b/src/FormsTemplatesCLI/FormsClassLib/.template.config/dotnetcli.host.json @@ -1,3 +1,12 @@ { - "$schema": "http://json.schemastore.org/dotnetcli.host" -} \ No newline at end of file + "$schema": "http://json.schemastore.org/dotnetcli.host", + "symbolInfo": { + "Framework": { + "longName": "framework" + } + }, + "usageExamples": [ + "--framework netstandard2.0", + "-f netstandard2.1" + ] +} diff --git a/src/FormsTemplatesCLI/FormsClassLib/.template.config/template.json b/src/FormsTemplatesCLI/FormsClassLib/.template.config/template.json index 0fe2c9c..8018f54 100644 --- a/src/FormsTemplatesCLI/FormsClassLib/.template.config/template.json +++ b/src/FormsTemplatesCLI/FormsClassLib/.template.config/template.json @@ -11,7 +11,7 @@ "Library" ], "identity": "VijayAnand.FormsTemplates.ClassLib", - "description": "A project template for Xamarin.Forms 5 Class Library (ver. 5.0.0.2401)", + "description": "A project template for Xamarin.Forms 5 Class Library (ver. 5.0.0.2515)", "name": "Xamarin.Forms 5 Class Library", "shortName": "formsclasslib", "sourceName": "FormsClassLib", @@ -23,29 +23,48 @@ "104D078F-F441-4A4A-A89B-21C40D7B8C10" ], "symbols": { + "Framework": { + "type": "parameter", + "datatype": "choice", + "description": "Option to choose the class library target framework.", + "choices": [ + { + "choice": "netstandard2.1", + "description": "Target .NET Standard 2.1", + "displayName": ".NET Standard 2.1" + }, + { + "choice": "netstandard2.0", + "description": "Target .NET Standard 2.0", + "displayName": ".NET Standard 2.0" + } + ], + "replaces": "LIB_TFM", + "defaultValue": "netstandard2.0" + }, "include-toolkit": { "type": "parameter", "datatype": "bool", "defaultValue": "false", - "description": "If true, includes reference to the Xamarin.CommunityToolkit NuGet package reference." + "description": "If true, includes reference to the Xamarin.CommunityToolkit NuGet package." }, "include-markup": { "type": "parameter", "datatype": "bool", "defaultValue": "false", - "description": "If true, includes reference to the Xamarin.CommunityToolkit.Markup NuGet package reference." + "description": "If true, includes reference to the Xamarin.CommunityToolkit.Markup NuGet package." }, "include-essentials": { "type": "parameter", "datatype": "bool", "defaultValue": "false", - "description": "If true, includes reference to the Xamarin.Essentials NuGet package reference." + "description": "If true, includes reference to the Xamarin.Essentials NuGet package." }, "include-mvvm-toolkit": { "type": "parameter", "datatype": "bool", "defaultValue": "false", - "description": "If true, includes reference to the CommunityToolkit.Mvvm (aka Microsoft MVVM Toolkit) NuGet package reference." + "description": "If true, includes reference to the CommunityToolkit.Mvvm (aka Microsoft MVVM Toolkit) NuGet package." }, "no-solution-file": { "type": "parameter", diff --git a/src/FormsTemplatesCLI/FormsClassLib/FormsClassLib.csproj b/src/FormsTemplatesCLI/FormsClassLib/FormsClassLib.csproj index 12e4c40..fd9996e 100644 --- a/src/FormsTemplatesCLI/FormsClassLib/FormsClassLib.csproj +++ b/src/FormsTemplatesCLI/FormsClassLib/FormsClassLib.csproj @@ -1,6 +1,6 @@ - netstandard2.0 + LIB_TFM latest enable @@ -8,7 +8,7 @@ FormsClassLib - + diff --git a/src/FormsTemplatesCLI/release-notes.txt b/src/FormsTemplatesCLI/release-notes.txt index 99be46f..248843b 100644 --- a/src/FormsTemplatesCLI/release-notes.txt +++ b/src/FormsTemplatesCLI/release-notes.txt @@ -1,4 +1,10 @@ -What's new in ver. 1.4.0: +What's new in ver. 1.4.1: + +Xamarin.Forms version bumped to 5.0.0.2515 (SR12). + +Option to the choose the library target framework - .NET Standard 2.0 / 2.1 + +v1.4.0: Included an option to add reference Xamarin.Essentials NuGet package during Xamarin.Forms class library creation.