// IBuildTarget.cs // // Author: // Lluis Sanchez Gual // // Copyright (c) 2008 Novell, Inc (http://www.novell.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.Collections.Generic; using MonoDevelop.Core; using System.Threading.Tasks; using System; namespace MonoDevelop.Projects { public interface IBuildTarget { /// /// Builds the target /// /// Monitor for tracking progress /// Configuration to build /// If set to true build referenced targets before building this one Task Build (ProgressMonitor monitor, ConfigurationSelector configuration, bool buildReferencedTargets = false, OperationContext operationContext = null); /// /// Cleans the targets /// /// Monitor for tracking progress /// Configuration to clean Task Clean (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext = null); /// /// Executes the target /// /// Monitor for tracking progress /// Execution context /// Configuration to execute Task Execute (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration); /// /// Determines whether this target can be executed using the specified execution context and configuration. /// /// true if this instance can be executed; otherwise, false. /// An execution context /// Configuration to execute bool CanExecute (ExecutionContext context, ConfigurationSelector configuration); /// /// Determines whether this target can be built using the specified configuration. /// /// true if this instance can be built; otherwise, false. /// Configuration. bool CanBuild (ConfigurationSelector configuration); /// /// Prepares the target for execution /// /// The execution. /// Monitor for tracking progress /// Execution context /// Configuration to execute /// This method can be called (it is not mandatory) before Execute() to give the target a chance /// to asynchronously prepare the execution that is going to be done later on. It can be used for example /// to start the simulator that is going to be used for execution. Calling this method is optional, and /// there is no guarantee that Execute() will actually be called. Task PrepareExecution (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration); [Obsolete ("This method will be removed in future releases")] bool NeedsBuilding (ConfigurationSelector configuration); /// /// Gets the name of the target /// /// The name string Name { get; } /// /// Gets the build targets that should be built before the project is executed. /// If the project itself is not included, it will not be built. /// IEnumerable GetExecutionDependencies (); } }