From d3759cdbf50b874ed6cf159b1673bdf189ff32d9 Mon Sep 17 00:00:00 2001 From: Glenn <5834289+glennawatson@users.noreply.github.com> Date: Wed, 1 Jan 2020 16:40:54 +1100 Subject: [PATCH] fix: set TargetFramework to have default value (#98) --- src/Pharmacist.MsBuild.NuGet/PharmacistNuGetTask.cs | 8 ++++---- version.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Pharmacist.MsBuild.NuGet/PharmacistNuGetTask.cs b/src/Pharmacist.MsBuild.NuGet/PharmacistNuGetTask.cs index 87042c9..79dee28 100644 --- a/src/Pharmacist.MsBuild.NuGet/PharmacistNuGetTask.cs +++ b/src/Pharmacist.MsBuild.NuGet/PharmacistNuGetTask.cs @@ -27,6 +27,8 @@ namespace Pharmacist.MsBuild.NuGet [SuppressMessage("Design", "CA1031: Catch specific exceptions", Justification = "Final logging location for exceptions.")] public class PharmacistNuGetTask : Task, IEnableLogger { + private const string DefaultTargetFramework = "netstandard2.0"; + private static readonly ISet ExclusionPackageReferenceSet = new HashSet(StringComparer.InvariantCultureIgnoreCase) { "Pharmacist.MSBuild", @@ -42,8 +44,7 @@ public class PharmacistNuGetTask : Task, IEnableLogger /// /// Gets or sets the target framework. /// - [Required] - public string TargetFramework { get; set; } + public string TargetFramework { get; set; } = DefaultTargetFramework; /// /// Gets or sets the output file. @@ -65,8 +66,7 @@ public override bool Execute() if (string.IsNullOrWhiteSpace(TargetFramework)) { - Log.LogError($"{nameof(TargetFramework)} is not set"); - return false; + TargetFramework = DefaultTargetFramework; } using (var writer = new StreamWriter(Path.Combine(OutputFile))) diff --git a/version.json b/version.json index 2ffd524..a9f94f7 100644 --- a/version.json +++ b/version.json @@ -1,5 +1,5 @@ { - "version": "1.3", + "version": "1.4", "publicReleaseRefSpec": [ "^refs/heads/master$", // we release out of master "^refs/heads/develop$", // we release out of develop