public override bool Execute() { Log.LogMessage(MessageImportance.Normal, "MergePlists Task"); Log.LogMessage(MessageImportance.Normal, $" SourcePlist: {SourcePlist}"); Log.LogMessage(MessageImportance.Normal, $" TargetPlist: {TargetPlist}"); PlistBuddy.Run(TargetPlist, PlistBuddyVerb.Merge, SourcePlist); return(true); }
public override bool Execute() { Log.LogMessage(MessageImportance.Normal, "SetPlistValue Task"); Log.LogMessage(MessageImportance.Normal, $" Plist: {Plist}"); Log.LogMessage(MessageImportance.Normal, $" Selector: {Selector}"); Log.LogMessage(MessageImportance.Normal, $" NewValue: {NewValue}"); PlistBuddy.Run(Plist, PlistBuddyVerb.Set, Selector, NewValue); return(true); }
public override bool Execute() { var entriesToDelete = EntriesToDelete.Select(taskItem => taskItem.ItemSpec).ToArray(); var entriesString = string.Join(", ", entriesToDelete); Log.LogMessage(MessageImportance.Normal, "DeletePlistEntries Task"); Log.LogMessage(MessageImportance.Normal, $" Plist: {Plist}"); Log.LogMessage(MessageImportance.Normal, $" EntriesToDelete: {entriesString}"); Log.LogMessage(MessageImportance.Normal, $" IgnoreResult: {IgnoreResult}"); var plistBuddyCommands = entriesToDelete.Select(entry => new PlistBuddyCommand { Verb = PlistBuddyVerb.Remove, VerbArguments = new [] { entry } }); try { PlistBuddy.Run(Plist, plistBuddyCommands); } catch when(IgnoreResult) { } return(true); }