aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core/Compiler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/WixToolset.Core/Compiler.cs')
-rw-r--r--src/WixToolset.Core/Compiler.cs25
1 files changed, 6 insertions, 19 deletions
diff --git a/src/WixToolset.Core/Compiler.cs b/src/WixToolset.Core/Compiler.cs
index 7d09be6d..ffe907e8 100644
--- a/src/WixToolset.Core/Compiler.cs
+++ b/src/WixToolset.Core/Compiler.cs
@@ -22,7 +22,7 @@ namespace WixToolset.Core
22 /// <summary> 22 /// <summary>
23 /// Compiler of the WiX toolset. 23 /// Compiler of the WiX toolset.
24 /// </summary> 24 /// </summary>
25 internal class Compiler 25 internal class Compiler : ICompiler
26 { 26 {
27 public const string UpgradeDetectedProperty = "WIX_UPGRADE_DETECTED"; 27 public const string UpgradeDetectedProperty = "WIX_UPGRADE_DETECTED";
28 public const string UpgradePreventedCondition = "NOT WIX_UPGRADE_DETECTED"; 28 public const string UpgradePreventedCondition = "NOT WIX_UPGRADE_DETECTED";
@@ -84,14 +84,6 @@ namespace WixToolset.Core
84 84
85 private CompilerCore Core { get; set; } 85 private CompilerCore Core { get; set; }
86 86
87 public string CompliationId { get; set; }
88
89 public string OutputPath { get; set; }
90
91 public Platform Platform { get; set; }
92
93 public XDocument SourceDocument { get; set; }
94
95 /// <summary> 87 /// <summary>
96 /// Gets or sets the platform which the compiler will use when defaulting 64-bit attributes and elements. 88 /// Gets or sets the platform which the compiler will use when defaulting 64-bit attributes and elements.
97 /// </summary> 89 /// </summary>
@@ -109,22 +101,17 @@ namespace WixToolset.Core
109 /// </summary> 101 /// </summary>
110 /// <returns>Intermediate object representing compiled source document.</returns> 102 /// <returns>Intermediate object representing compiled source document.</returns>
111 /// <remarks>This method is not thread-safe.</remarks> 103 /// <remarks>This method is not thread-safe.</remarks>
112 public Intermediate Execute() 104 public Intermediate Compile(ICompileContext context)
113 { 105 {
114 this.Context = this.ServiceProvider.GetService<ICompileContext>();
115 this.Context.Extensions = this.ServiceProvider.GetService<IExtensionManager>().Create<ICompilerExtension>();
116 this.Context.CompilationId = this.CompliationId;
117 this.Context.OutputPath = this.OutputPath;
118 this.Context.Platform = this.Platform;
119 this.Context.Source = this.SourceDocument;
120
121 var target = new Intermediate(); 106 var target = new Intermediate();
122 107
123 if (String.IsNullOrEmpty(this.Context.CompilationId)) 108 if (String.IsNullOrEmpty(context.CompilationId))
124 { 109 {
125 this.Context.CompilationId = target.Id; 110 context.CompilationId = target.Id;
126 } 111 }
127 112
113 this.Context = context;
114
128 var extensionsByNamespace = new Dictionary<XNamespace, ICompilerExtension>(); 115 var extensionsByNamespace = new Dictionary<XNamespace, ICompilerExtension>();
129 116
130 foreach (var extension in this.Context.Extensions) 117 foreach (var extension in this.Context.Extensions)