1 // Copyright (c) Microsoft. All rights reserved.
2 // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 //-----------------------------------------------------------------------
4 // </copyright>
5 // <summary>The interface for build results.</summary>
6 //-----------------------------------------------------------------------
7 
8 using System;
9 using System.Collections.Generic;
10 using System.Text;
11 using Microsoft.Build.Execution;
12 
13 namespace Microsoft.Build.BackEnd
14 {
15     /// <summary>
16     /// An interface representing results for a build request
17     /// </summary>
18     internal interface IBuildResults
19     {
20         /// <summary>
21         /// The exception, if any, generated while the build ran.
22         /// </summary>
23         Exception Exception
24         {
25             get;
26         }
27 
28         /// <summary>
29         /// The overall build result code.
30         /// </summary>
31         BuildResultCode OverallResult
32         {
33             get;
34         }
35 
36         /// <summary>
37         /// Returns an enumerator for all target results in this build result
38         /// </summary>
39         IDictionary<string, TargetResult> ResultsByTarget
40         {
41             get;
42         }
43 
44         /// <summary>
45         /// Set of environment variables for the configuration this result came from
46         /// </summary>
47         Dictionary<string, string> SavedEnvironmentVariables
48         {
49             get;
50             set;
51         }
52 
53         /// <summary>
54         /// The current directory for the configuration this result came from
55         /// </summary>
56         string SavedCurrentDirectory
57         {
58             get;
59             set;
60         }
61 
62         /// <summary>
63         /// Gets the results for a target in the build request
64         /// </summary>
65         /// <param name="target">The target name</param>
66         /// <returns>The target results</returns>
67         ITargetResult this[string target]
68         {
69             get;
70         }
71 
72         /// <summary>
73         /// Returns true if there are results for the specified target
74         /// </summary>
75         /// <param name="target">The target name</param>
76         /// <returns>True if results exist, false otherwise.</returns>
HasResultsForTarget(string target)77         bool HasResultsForTarget(string target);
78     }
79 }
80