From 466e4147808ea8643e8f4c88e70ced8f6b01dbad Mon Sep 17 00:00:00 2001 From: emaf Date: Mon, 20 Jul 2020 15:05:28 -0300 Subject: [PATCH 1/2] [msbuild] Changes GetMinimumOSVersionTaskBase to use ITaskItem for inputs From Visual Studio we need the input files to be instead of plain strings to identify the files that need to be copied to the Mac --- .../Tasks/GetMinimumOSVersionTaskBase.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/msbuild/Xamarin.MacDev.Tasks.Core/Tasks/GetMinimumOSVersionTaskBase.cs b/msbuild/Xamarin.MacDev.Tasks.Core/Tasks/GetMinimumOSVersionTaskBase.cs index 00a78e450f9d..578eca5bd080 100644 --- a/msbuild/Xamarin.MacDev.Tasks.Core/Tasks/GetMinimumOSVersionTaskBase.cs +++ b/msbuild/Xamarin.MacDev.Tasks.Core/Tasks/GetMinimumOSVersionTaskBase.cs @@ -6,7 +6,7 @@ namespace Xamarin.MacDev.Tasks { public abstract class GetMinimumOSVersionTaskBase : XamarinTask { - public string AppManifest { get; set; } + public ITaskItem AppManifest { get; set; } [Required] public string SdkVersion { get; set; } @@ -18,9 +18,9 @@ public override bool Execute () { PDictionary plist = null; - if (!string.IsNullOrEmpty (AppManifest)) { + if (!string.IsNullOrEmpty (AppManifest.ItemSpec)) { try { - plist = PDictionary.FromFile (AppManifest); + plist = PDictionary.FromFile (AppManifest.ItemSpec); } catch (Exception ex) { Log.LogError (null, null, null, AppManifest, 0, 0, 0, 0, MSBStrings.E0010, AppManifest, ex.Message); return false; From 770f068d8ff0998160ada55d3be8af3f2e5f140c Mon Sep 17 00:00:00 2001 From: emaf Date: Mon, 20 Jul 2020 16:57:44 -0300 Subject: [PATCH 2/2] Adds null check for AppManifest in GetMinimumOSVersionTaskBase --- .../Tasks/GetMinimumOSVersionTaskBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/msbuild/Xamarin.MacDev.Tasks.Core/Tasks/GetMinimumOSVersionTaskBase.cs b/msbuild/Xamarin.MacDev.Tasks.Core/Tasks/GetMinimumOSVersionTaskBase.cs index 578eca5bd080..b65a3568a90c 100644 --- a/msbuild/Xamarin.MacDev.Tasks.Core/Tasks/GetMinimumOSVersionTaskBase.cs +++ b/msbuild/Xamarin.MacDev.Tasks.Core/Tasks/GetMinimumOSVersionTaskBase.cs @@ -18,7 +18,7 @@ public override bool Execute () { PDictionary plist = null; - if (!string.IsNullOrEmpty (AppManifest.ItemSpec)) { + if (!string.IsNullOrEmpty (AppManifest?.ItemSpec)) { try { plist = PDictionary.FromFile (AppManifest.ItemSpec); } catch (Exception ex) {