// // TargetEvaluationContext.cs // // Author: // Lluis Sanchez Gual // // Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using MonoDevelop.Projects.MSBuild; namespace MonoDevelop.Projects { public class TargetEvaluationContext: ProjectOperationContext { List loggers = new List (); public TargetEvaluationContext () { PropertiesToEvaluate = new HashSet (); ItemsToEvaluate = new HashSet (); LogVerbosity = MSBuildProjectService.DefaultMSBuildVerbosity; } public TargetEvaluationContext (OperationContext other): this () { if (other != null) CopyFrom (other); } public HashSet PropertiesToEvaluate { get; private set; } public HashSet ItemsToEvaluate { get; private set; } public MSBuildVerbosity LogVerbosity { get; set; } public ICollection Loggers { get { return loggers; } } public string BinLogFilePath { get; set; } /// /// Gets or sets the builder queue to be used to execute the target /// /// /// This property helps the build system decide which builder to use /// to execute the target. /// public BuilderQueue BuilderQueue { get; set; } = BuilderQueue.LongOperations; /// /// Gets or sets a value indicating whether referenced projects must be /// loaded and configured before running the target (true by default) /// public bool LoadReferencedProjects { get; set; } = true; public override void CopyFrom (OperationContext other) { base.CopyFrom (other); var o = other as TargetEvaluationContext; if (o != null) { PropertiesToEvaluate = new HashSet (o.PropertiesToEvaluate); ItemsToEvaluate = new HashSet (o.ItemsToEvaluate); loggers = new List (o.Loggers); LogVerbosity = o.LogVerbosity; } } } public enum BuilderQueue { /// /// This builder queue is used to execute targets that are quick to execute, /// for example getting the list of assembly references of a project. /// ShortOperations, /// /// This builder queue is used to execute targets which may take a long /// time to execute, for example building, cleaning or deploying a project. /// LongOperations } }