From 84a5f62eb94a2701e976e40eee885bc98f7fa3e7 Mon Sep 17 00:00:00 2001 From: Jay Cho Date: Fri, 1 Dec 2023 15:30:43 +0900 Subject: [PATCH] Fix merge manifest error --- .../MergeManifest.cs | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/workload/src/Samsung.Tizen.Build.Tasks/MergeManifest.cs b/workload/src/Samsung.Tizen.Build.Tasks/MergeManifest.cs index 0323abad..83aef555 100644 --- a/workload/src/Samsung.Tizen.Build.Tasks/MergeManifest.cs +++ b/workload/src/Samsung.Tizen.Build.Tasks/MergeManifest.cs @@ -2,7 +2,6 @@ using System.IO; using System.Linq; using System.Xml.Linq; - using Microsoft.Build.Framework; using Microsoft.Build.Utilities; @@ -17,7 +16,7 @@ public class MergeManifest : Task public ITaskItem[] SubManifestFileList { - set + set { if (value != null) subManifestFileList = value.ToList(); @@ -71,11 +70,25 @@ public override bool Execute() } else if (subapp.Name.LocalName == "privileges") { - mainDoc.Root.Element(ns + "privileges").Add(subapp.Descendants(ns + "privilege")); + if (mainDoc.Root.Element(ns + "privileges") == null) + { + mainDoc.Root.Add(subapp); + } + else + { + mainDoc.Root.Element(ns + "privileges").Add(subapp.Descendants(ns + "privilege")); + } } else if (subapp.Name.LocalName == "account") { - mainDoc.Root.Element(ns + "account").Add(subapp.Descendants(ns + "account-provider")); + if (mainDoc.Root.Element(ns + "account") == null) + { + mainDoc.Root.Add(subapp); + } + else + { + mainDoc.Root.Element(ns + "account").Add(subapp.Descendants(ns + "account-provider")); + } } else if (subapp.Name.LocalName == "feature") {