aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2018-07-23 14:21:40 -0700
committerRob Mensching <rob@firegiant.com>2018-07-23 14:27:11 -0700
commit5a1afc9030a1fcc101b6bb52b576fbbfa3ad33c2 (patch)
treed409a2399bd831f16ecdb8e68947ea672dcd65d4 /src/WixToolset.Core
parent2724cfee4c163f3297ee25edfd2372767cfd4945 (diff)
downloadwix-5a1afc9030a1fcc101b6bb52b576fbbfa3ad33c2.tar.gz
wix-5a1afc9030a1fcc101b6bb52b576fbbfa3ad33c2.tar.bz2
wix-5a1afc9030a1fcc101b6bb52b576fbbfa3ad33c2.zip
Integrate Extensibility.Data namespace change from Extensibility repo
Diffstat (limited to 'src/WixToolset.Core')
-rw-r--r--src/WixToolset.Core/Bind/DelayedField.cs2
-rw-r--r--src/WixToolset.Core/Bind/ExpectedExtractFile.cs2
-rw-r--r--src/WixToolset.Core/Bind/ExtractEmbeddedFilesCommand.cs2
-rw-r--r--src/WixToolset.Core/Bind/FileResolver.cs2
-rw-r--r--src/WixToolset.Core/Bind/ResolveDelayedFieldsCommand.cs2
-rw-r--r--src/WixToolset.Core/Bind/ResolveFieldsCommand.cs2
-rw-r--r--src/WixToolset.Core/Bind/TransferFilesCommand.cs2
-rw-r--r--src/WixToolset.Core/BindContext.cs4
-rw-r--r--src/WixToolset.Core/Binder.cs3
-rw-r--r--src/WixToolset.Core/CommandLine/BuildCommand.cs3
-rw-r--r--src/WixToolset.Core/CommandLine/CommandLineArguments.cs1
-rw-r--r--src/WixToolset.Core/CommandLine/CommandLineContext.cs3
-rw-r--r--src/WixToolset.Core/CommandLine/CommandLineParser.cs32
-rw-r--r--src/WixToolset.Core/CommandLine/CompileCommand.cs3
-rw-r--r--src/WixToolset.Core/CommandLine/HelpCommand.cs2
-rw-r--r--src/WixToolset.Core/CommandLine/VersionCommand.cs2
-rw-r--r--src/WixToolset.Core/CompileContext.cs4
-rw-r--r--src/WixToolset.Core/Compiler.cs14
-rw-r--r--src/WixToolset.Core/CompilerCore.cs1
-rw-r--r--src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs3
-rw-r--r--src/WixToolset.Core/ExtensibilityServices/PreprocessHelper.cs25
-rw-r--r--src/WixToolset.Core/IncribeContext.cs4
-rw-r--r--src/WixToolset.Core/Layout.cs15
-rw-r--r--src/WixToolset.Core/LayoutContext.cs5
-rw-r--r--src/WixToolset.Core/Librarian.cs18
-rw-r--r--src/WixToolset.Core/LibraryContext.cs1
-rw-r--r--src/WixToolset.Core/LinkContext.cs4
-rw-r--r--src/WixToolset.Core/Linker.cs29
-rw-r--r--src/WixToolset.Core/PreprocessContext.cs4
-rw-r--r--src/WixToolset.Core/Preprocessor.cs18
-rw-r--r--src/WixToolset.Core/ResolveContext.cs3
-rw-r--r--src/WixToolset.Core/Resolver.cs12
-rw-r--r--src/WixToolset.Core/WixToolsetServiceProvider.cs4
33 files changed, 124 insertions, 107 deletions
diff --git a/src/WixToolset.Core/Bind/DelayedField.cs b/src/WixToolset.Core/Bind/DelayedField.cs
index 8b761b94..7d0045e6 100644
--- a/src/WixToolset.Core/Bind/DelayedField.cs
+++ b/src/WixToolset.Core/Bind/DelayedField.cs
@@ -3,7 +3,7 @@
3namespace WixToolset.Core.Bind 3namespace WixToolset.Core.Bind
4{ 4{
5 using WixToolset.Data; 5 using WixToolset.Data;
6 using WixToolset.Extensibility; 6 using WixToolset.Extensibility.Data;
7 7
8 /// <summary> 8 /// <summary>
9 /// Structure used to hold a row and field that contain binder variables, which need to be resolved 9 /// Structure used to hold a row and field that contain binder variables, which need to be resolved
diff --git a/src/WixToolset.Core/Bind/ExpectedExtractFile.cs b/src/WixToolset.Core/Bind/ExpectedExtractFile.cs
index fc2b43c7..afad12fc 100644
--- a/src/WixToolset.Core/Bind/ExpectedExtractFile.cs
+++ b/src/WixToolset.Core/Bind/ExpectedExtractFile.cs
@@ -3,7 +3,7 @@
3namespace WixToolset.Core.Bind 3namespace WixToolset.Core.Bind
4{ 4{
5 using System; 5 using System;
6 using WixToolset.Extensibility; 6 using WixToolset.Extensibility.Data;
7 7
8 internal class ExpectedExtractFile : IExpectedExtractFile 8 internal class ExpectedExtractFile : IExpectedExtractFile
9 { 9 {
diff --git a/src/WixToolset.Core/Bind/ExtractEmbeddedFilesCommand.cs b/src/WixToolset.Core/Bind/ExtractEmbeddedFilesCommand.cs
index 7e7c21b1..d82609db 100644
--- a/src/WixToolset.Core/Bind/ExtractEmbeddedFilesCommand.cs
+++ b/src/WixToolset.Core/Bind/ExtractEmbeddedFilesCommand.cs
@@ -7,7 +7,7 @@ namespace WixToolset.Core.Bind
7 using System.Linq; 7 using System.Linq;
8 using System.Reflection; 8 using System.Reflection;
9 using WixToolset.Data; 9 using WixToolset.Data;
10 using WixToolset.Extensibility; 10 using WixToolset.Extensibility.Data;
11 11
12 public class ExtractEmbeddedFilesCommand 12 public class ExtractEmbeddedFilesCommand
13 { 13 {
diff --git a/src/WixToolset.Core/Bind/FileResolver.cs b/src/WixToolset.Core/Bind/FileResolver.cs
index a20d3f34..86075e46 100644
--- a/src/WixToolset.Core/Bind/FileResolver.cs
+++ b/src/WixToolset.Core/Bind/FileResolver.cs
@@ -7,8 +7,8 @@ namespace WixToolset.Core.Bind
7 using System.IO; 7 using System.IO;
8 using System.Linq; 8 using System.Linq;
9 using WixToolset.Data; 9 using WixToolset.Data;
10 using WixToolset.Data.Bind;
11 using WixToolset.Extensibility; 10 using WixToolset.Extensibility;
11 using WixToolset.Extensibility.Data;
12 12
13 internal class FileResolver 13 internal class FileResolver
14 { 14 {
diff --git a/src/WixToolset.Core/Bind/ResolveDelayedFieldsCommand.cs b/src/WixToolset.Core/Bind/ResolveDelayedFieldsCommand.cs
index 6f8da9ec..bec03907 100644
--- a/src/WixToolset.Core/Bind/ResolveDelayedFieldsCommand.cs
+++ b/src/WixToolset.Core/Bind/ResolveDelayedFieldsCommand.cs
@@ -7,7 +7,7 @@ namespace WixToolset.Core.Bind
7 using System.Globalization; 7 using System.Globalization;
8 using System.Text; 8 using System.Text;
9 using WixToolset.Data; 9 using WixToolset.Data;
10 using WixToolset.Extensibility; 10 using WixToolset.Extensibility.Data;
11 using WixToolset.Extensibility.Services; 11 using WixToolset.Extensibility.Services;
12 12
13 /// <summary> 13 /// <summary>
diff --git a/src/WixToolset.Core/Bind/ResolveFieldsCommand.cs b/src/WixToolset.Core/Bind/ResolveFieldsCommand.cs
index 744f022c..0d5c3142 100644
--- a/src/WixToolset.Core/Bind/ResolveFieldsCommand.cs
+++ b/src/WixToolset.Core/Bind/ResolveFieldsCommand.cs
@@ -5,8 +5,8 @@ namespace WixToolset.Core.Bind
5 using System; 5 using System;
6 using System.Collections.Generic; 6 using System.Collections.Generic;
7 using WixToolset.Data; 7 using WixToolset.Data;
8 using WixToolset.Data.Bind;
9 using WixToolset.Extensibility; 8 using WixToolset.Extensibility;
9 using WixToolset.Extensibility.Data;
10 using WixToolset.Extensibility.Services; 10 using WixToolset.Extensibility.Services;
11 11
12 /// <summary> 12 /// <summary>
diff --git a/src/WixToolset.Core/Bind/TransferFilesCommand.cs b/src/WixToolset.Core/Bind/TransferFilesCommand.cs
index 6230a4f5..79f0cd81 100644
--- a/src/WixToolset.Core/Bind/TransferFilesCommand.cs
+++ b/src/WixToolset.Core/Bind/TransferFilesCommand.cs
@@ -7,8 +7,8 @@ namespace WixToolset.Core.Bind
7 using System.IO; 7 using System.IO;
8 using System.Security.AccessControl; 8 using System.Security.AccessControl;
9 using WixToolset.Data; 9 using WixToolset.Data;
10 using WixToolset.Data.Bind;
11 using WixToolset.Extensibility; 10 using WixToolset.Extensibility;
11 using WixToolset.Extensibility.Data;
12 using WixToolset.Extensibility.Services; 12 using WixToolset.Extensibility.Services;
13 13
14 internal class TransferFilesCommand 14 internal class TransferFilesCommand
diff --git a/src/WixToolset.Core/BindContext.cs b/src/WixToolset.Core/BindContext.cs
index f423b731..12719f51 100644
--- a/src/WixToolset.Core/BindContext.cs
+++ b/src/WixToolset.Core/BindContext.cs
@@ -6,7 +6,7 @@ namespace WixToolset.Core
6 using System.Collections.Generic; 6 using System.Collections.Generic;
7 using WixToolset.Data; 7 using WixToolset.Data;
8 using WixToolset.Extensibility; 8 using WixToolset.Extensibility;
9 using WixToolset.Extensibility.Services; 9 using WixToolset.Extensibility.Data;
10 10
11 public class BindContext : IBindContext 11 public class BindContext : IBindContext
12 { 12 {
@@ -17,8 +17,6 @@ namespace WixToolset.Core
17 17
18 public IServiceProvider ServiceProvider { get; } 18 public IServiceProvider ServiceProvider { get; }
19 19
20 public IMessaging Messaging { get; set; }
21
22 public IEnumerable<BindPath> BindPaths { get; set; } 20 public IEnumerable<BindPath> BindPaths { get; set; }
23 21
24 public int CabbingThreadCount { get; set; } 22 public int CabbingThreadCount { get; set; }
diff --git a/src/WixToolset.Core/Binder.cs b/src/WixToolset.Core/Binder.cs
index f112a214..23f1ba21 100644
--- a/src/WixToolset.Core/Binder.cs
+++ b/src/WixToolset.Core/Binder.cs
@@ -11,6 +11,7 @@ namespace WixToolset.Core
11 using WixToolset.Data.Bind; 11 using WixToolset.Data.Bind;
12 using WixToolset.Data.Tuples; 12 using WixToolset.Data.Tuples;
13 using WixToolset.Extensibility; 13 using WixToolset.Extensibility;
14 using WixToolset.Extensibility.Data;
14 using WixToolset.Extensibility.Services; 15 using WixToolset.Extensibility.Services;
15 16
16 /// <summary> 17 /// <summary>
@@ -56,7 +57,6 @@ namespace WixToolset.Core
56 public BindResult Execute() 57 public BindResult Execute()
57 { 58 {
58 var context = this.ServiceProvider.GetService<IBindContext>(); 59 var context = this.ServiceProvider.GetService<IBindContext>();
59 context.Messaging = this.ServiceProvider.GetService<IMessaging>();
60 context.CabbingThreadCount = this.CabbingThreadCount; 60 context.CabbingThreadCount = this.CabbingThreadCount;
61 context.CabCachePath = this.CabCachePath; 61 context.CabCachePath = this.CabCachePath;
62 context.Codepage = this.Codepage; 62 context.Codepage = this.Codepage;
@@ -72,7 +72,6 @@ namespace WixToolset.Core
72 context.SuppressIces = this.SuppressIces; 72 context.SuppressIces = this.SuppressIces;
73 context.SuppressValidation = this.SuppressValidation; 73 context.SuppressValidation = this.SuppressValidation;
74 74
75
76 // Prebind. 75 // Prebind.
77 // 76 //
78 foreach (var extension in context.Extensions) 77 foreach (var extension in context.Extensions)
diff --git a/src/WixToolset.Core/CommandLine/BuildCommand.cs b/src/WixToolset.Core/CommandLine/BuildCommand.cs
index 7b605da1..d8327b7a 100644
--- a/src/WixToolset.Core/CommandLine/BuildCommand.cs
+++ b/src/WixToolset.Core/CommandLine/BuildCommand.cs
@@ -7,8 +7,7 @@ namespace WixToolset.Core.CommandLine
7 using System.IO; 7 using System.IO;
8 using System.Linq; 8 using System.Linq;
9 using WixToolset.Data; 9 using WixToolset.Data;
10 using WixToolset.Data.Bind; 10 using WixToolset.Extensibility.Data;
11 using WixToolset.Extensibility;
12 using WixToolset.Extensibility.Services; 11 using WixToolset.Extensibility.Services;
13 12
14 internal class BuildCommand : ICommandLineCommand 13 internal class BuildCommand : ICommandLineCommand
diff --git a/src/WixToolset.Core/CommandLine/CommandLineArguments.cs b/src/WixToolset.Core/CommandLine/CommandLineArguments.cs
index 37adcfd3..2f8226df 100644
--- a/src/WixToolset.Core/CommandLine/CommandLineArguments.cs
+++ b/src/WixToolset.Core/CommandLine/CommandLineArguments.cs
@@ -7,6 +7,7 @@ namespace WixToolset.Core.CommandLine
7 using System.IO; 7 using System.IO;
8 using System.Text; 8 using System.Text;
9 using System.Text.RegularExpressions; 9 using System.Text.RegularExpressions;
10 using WixToolset.Extensibility.Data;
10 using WixToolset.Extensibility.Services; 11 using WixToolset.Extensibility.Services;
11 12
12 internal class CommandLineArguments : ICommandLineArguments 13 internal class CommandLineArguments : ICommandLineArguments
diff --git a/src/WixToolset.Core/CommandLine/CommandLineContext.cs b/src/WixToolset.Core/CommandLine/CommandLineContext.cs
index c589222d..ea0cf3d4 100644
--- a/src/WixToolset.Core/CommandLine/CommandLineContext.cs
+++ b/src/WixToolset.Core/CommandLine/CommandLineContext.cs
@@ -3,6 +3,7 @@
3namespace WixToolset.Core.CommandLine 3namespace WixToolset.Core.CommandLine
4{ 4{
5 using System; 5 using System;
6 using WixToolset.Extensibility.Data;
6 using WixToolset.Extensibility.Services; 7 using WixToolset.Extensibility.Services;
7 8
8 internal class CommandLineContext : ICommandLineContext 9 internal class CommandLineContext : ICommandLineContext
@@ -14,8 +15,6 @@ namespace WixToolset.Core.CommandLine
14 15
15 public IServiceProvider ServiceProvider { get; } 16 public IServiceProvider ServiceProvider { get; }
16 17
17 public IMessaging Messaging { get; set; }
18
19 public IExtensionManager ExtensionManager { get; set; } 18 public IExtensionManager ExtensionManager { get; set; }
20 19
21 public ICommandLineArguments Arguments { get; set; } 20 public ICommandLineArguments Arguments { get; set; }
diff --git a/src/WixToolset.Core/CommandLine/CommandLineParser.cs b/src/WixToolset.Core/CommandLine/CommandLineParser.cs
index 65aea1fc..92944ab2 100644
--- a/src/WixToolset.Core/CommandLine/CommandLineParser.cs
+++ b/src/WixToolset.Core/CommandLine/CommandLineParser.cs
@@ -7,6 +7,7 @@ namespace WixToolset.Core.CommandLine
7 using System.IO; 7 using System.IO;
8 using WixToolset.Data; 8 using WixToolset.Data;
9 using WixToolset.Extensibility; 9 using WixToolset.Extensibility;
10 using WixToolset.Extensibility.Data;
10 using WixToolset.Extensibility.Services; 11 using WixToolset.Extensibility.Services;
11 12
12 internal enum Commands 13 internal enum Commands
@@ -19,27 +20,34 @@ namespace WixToolset.Core.CommandLine
19 Bind, 20 Bind,
20 } 21 }
21 22
22 internal class CommandLineParser : ICommandLine 23 internal class CommandLineParser : ICommandLineParser
23 { 24 {
24 private IServiceProvider ServiceProvider { get; set; } 25 public CommandLineParser(IServiceProvider serviceProvider)
26 {
27 this.ServiceProvider = serviceProvider;
28
29 this.Messaging = this.ServiceProvider.GetService<IMessaging>();
30 }
31
32 private IServiceProvider ServiceProvider { get; }
25 33
26 private IMessaging Messaging { get; set; } 34 private IMessaging Messaging { get; set; }
27 35
36 public IExtensionManager ExtensionManager { get; set; }
37
38 public ICommandLineArguments Arguments { get; set; }
39
28 public static string ExpectedArgument { get; } = "expected argument"; 40 public static string ExpectedArgument { get; } = "expected argument";
29 41
30 public string ActiveCommand { get; private set; } 42 public string ActiveCommand { get; private set; }
31 43
32 public IExtensionManager ExtensionManager { get; private set; } 44 public bool ShowHelp { get; private set; }
33
34 public bool ShowHelp { get; set; }
35 45
36 public ICommandLineCommand ParseStandardCommandLine(ICommandLineContext context) 46 public ICommandLineCommand ParseStandardCommandLine()
37 { 47 {
38 this.ServiceProvider = context.ServiceProvider; 48 var context = this.ServiceProvider.GetService<ICommandLineContext>();
39 49 context.ExtensionManager = this.ExtensionManager ?? this.ServiceProvider.GetService<IExtensionManager>();
40 this.Messaging = context.Messaging ?? this.ServiceProvider.GetService<IMessaging>(); 50 context.Arguments = this.Arguments;
41
42 this.ExtensionManager = context.ExtensionManager ?? this.ServiceProvider.GetService<IExtensionManager>();
43 51
44 var next = String.Empty; 52 var next = String.Empty;
45 53
@@ -277,7 +285,7 @@ namespace WixToolset.Core.CommandLine
277 return OutputType.Unknown; 285 return OutputType.Unknown;
278 } 286 }
279 287
280 private ICommandLine Parse(ICommandLineContext context, Func<CommandLineParser, string, bool> parseCommand, Func<CommandLineParser, IParseCommandLine, string, bool> parseArgument) 288 private ICommandLineParser Parse(ICommandLineContext context, Func<CommandLineParser, string, bool> parseCommand, Func<CommandLineParser, IParseCommandLine, string, bool> parseArgument)
281 { 289 {
282 var extensions = this.ExtensionManager.Create<IExtensionCommandLine>(); 290 var extensions = this.ExtensionManager.Create<IExtensionCommandLine>();
283 291
diff --git a/src/WixToolset.Core/CommandLine/CompileCommand.cs b/src/WixToolset.Core/CommandLine/CompileCommand.cs
index 123318f5..6bd0f25a 100644
--- a/src/WixToolset.Core/CommandLine/CompileCommand.cs
+++ b/src/WixToolset.Core/CommandLine/CompileCommand.cs
@@ -5,8 +5,7 @@ namespace WixToolset.Core.CommandLine
5 using System; 5 using System;
6 using System.Collections.Generic; 6 using System.Collections.Generic;
7 using WixToolset.Data; 7 using WixToolset.Data;
8 using WixToolset.Extensibility; 8 using WixToolset.Extensibility.Data;
9 using WixToolset.Extensibility.Services;
10 9
11 internal class CompileCommand : ICommandLineCommand 10 internal class CompileCommand : ICommandLineCommand
12 { 11 {
diff --git a/src/WixToolset.Core/CommandLine/HelpCommand.cs b/src/WixToolset.Core/CommandLine/HelpCommand.cs
index 6e547d60..b1298e46 100644
--- a/src/WixToolset.Core/CommandLine/HelpCommand.cs
+++ b/src/WixToolset.Core/CommandLine/HelpCommand.cs
@@ -3,7 +3,7 @@
3namespace WixToolset.Core.CommandLine 3namespace WixToolset.Core.CommandLine
4{ 4{
5 using System; 5 using System;
6 using WixToolset.Extensibility.Services; 6 using WixToolset.Extensibility.Data;
7 7
8 internal class HelpCommand : ICommandLineCommand 8 internal class HelpCommand : ICommandLineCommand
9 { 9 {
diff --git a/src/WixToolset.Core/CommandLine/VersionCommand.cs b/src/WixToolset.Core/CommandLine/VersionCommand.cs
index a04aac31..e67aafb8 100644
--- a/src/WixToolset.Core/CommandLine/VersionCommand.cs
+++ b/src/WixToolset.Core/CommandLine/VersionCommand.cs
@@ -3,7 +3,7 @@
3namespace WixToolset.Core.CommandLine 3namespace WixToolset.Core.CommandLine
4{ 4{
5 using System; 5 using System;
6 using WixToolset.Extensibility.Services; 6 using WixToolset.Extensibility.Data;
7 7
8 internal class VersionCommand : ICommandLineCommand 8 internal class VersionCommand : ICommandLineCommand
9 { 9 {
diff --git a/src/WixToolset.Core/CompileContext.cs b/src/WixToolset.Core/CompileContext.cs
index fcca94d8..6f19961f 100644
--- a/src/WixToolset.Core/CompileContext.cs
+++ b/src/WixToolset.Core/CompileContext.cs
@@ -7,7 +7,7 @@ namespace WixToolset.Core
7 using System.Xml.Linq; 7 using System.Xml.Linq;
8 using WixToolset.Data; 8 using WixToolset.Data;
9 using WixToolset.Extensibility; 9 using WixToolset.Extensibility;
10 using WixToolset.Extensibility.Services; 10 using WixToolset.Extensibility.Data;
11 11
12 public class CompileContext : ICompileContext 12 public class CompileContext : ICompileContext
13 { 13 {
@@ -18,8 +18,6 @@ namespace WixToolset.Core
18 18
19 public IServiceProvider ServiceProvider { get; } 19 public IServiceProvider ServiceProvider { get; }
20 20
21 public IMessaging Messaging { get; set; }
22
23 public string CompilationId { get; set; } 21 public string CompilationId { get; set; }
24 22
25 public IEnumerable<ICompilerExtension> Extensions { get; set; } 23 public IEnumerable<ICompilerExtension> Extensions { get; set; }
diff --git a/src/WixToolset.Core/Compiler.cs b/src/WixToolset.Core/Compiler.cs
index cd51fed6..06f477c1 100644
--- a/src/WixToolset.Core/Compiler.cs
+++ b/src/WixToolset.Core/Compiler.cs
@@ -15,6 +15,7 @@ namespace WixToolset.Core
15 using WixToolset.Data; 15 using WixToolset.Data;
16 using WixToolset.Data.Tuples; 16 using WixToolset.Data.Tuples;
17 using WixToolset.Extensibility; 17 using WixToolset.Extensibility;
18 using WixToolset.Extensibility.Data;
18 using WixToolset.Extensibility.Services; 19 using WixToolset.Extensibility.Services;
19 using Wix = WixToolset.Data.Serialize; 20 using Wix = WixToolset.Data.Serialize;
20 21
@@ -71,10 +72,14 @@ namespace WixToolset.Core
71 public Compiler(IServiceProvider serviceProvider) 72 public Compiler(IServiceProvider serviceProvider)
72 { 73 {
73 this.ServiceProvider = serviceProvider; 74 this.ServiceProvider = serviceProvider;
75
76 this.Messaging = serviceProvider.GetService<IMessaging>();
74 } 77 }
75 78
76 private IServiceProvider ServiceProvider { get; } 79 private IServiceProvider ServiceProvider { get; }
77 80
81 public IMessaging Messaging { get; }
82
78 private ICompileContext Context { get; set; } 83 private ICompileContext Context { get; set; }
79 84
80 private CompilerCore Core { get; set; } 85 private CompilerCore Core { get; set; }
@@ -107,7 +112,6 @@ namespace WixToolset.Core
107 public Intermediate Execute() 112 public Intermediate Execute()
108 { 113 {
109 this.Context = this.ServiceProvider.GetService<ICompileContext>(); 114 this.Context = this.ServiceProvider.GetService<ICompileContext>();
110 this.Context.Messaging = this.ServiceProvider.GetService<IMessaging>();
111 this.Context.Extensions = this.ServiceProvider.GetService<IExtensionManager>().Create<ICompilerExtension>(); 115 this.Context.Extensions = this.ServiceProvider.GetService<IExtensionManager>().Create<ICompilerExtension>();
112 this.Context.CompilationId = this.CompliationId; 116 this.Context.CompilationId = this.CompliationId;
113 this.Context.OutputPath = this.OutputPath; 117 this.Context.OutputPath = this.OutputPath;
@@ -131,7 +135,7 @@ namespace WixToolset.Core
131 } 135 }
132 else 136 else
133 { 137 {
134 this.Context.Messaging.Write(ErrorMessages.DuplicateExtensionXmlSchemaNamespace(extension.GetType().ToString(), extension.Namespace.NamespaceName, collidingExtension.GetType().ToString())); 138 this.Messaging.Write(ErrorMessages.DuplicateExtensionXmlSchemaNamespace(extension.GetType().ToString(), extension.Namespace.NamespaceName, collidingExtension.GetType().ToString()));
135 } 139 }
136 140
137 extension.PreCompile(this.Context); 141 extension.PreCompile(this.Context);
@@ -142,9 +146,9 @@ namespace WixToolset.Core
142 { 146 {
143 var parseHelper = this.Context.ServiceProvider.GetService<IParseHelper>(); 147 var parseHelper = this.Context.ServiceProvider.GetService<IParseHelper>();
144 148
145 this.Core = new CompilerCore(target, this.Context.Messaging, parseHelper, extensionsByNamespace); 149 this.Core = new CompilerCore(target, this.Messaging, parseHelper, extensionsByNamespace);
146 this.Core.ShowPedanticMessages = this.ShowPedanticMessages; 150 this.Core.ShowPedanticMessages = this.ShowPedanticMessages;
147 this.componentIdPlaceholdersResolver = new WixVariableResolver(this.Context.Messaging); 151 this.componentIdPlaceholdersResolver = new WixVariableResolver(this.Messaging);
148 152
149 // parse the document 153 // parse the document
150 var source = this.Context.Source; 154 var source = this.Context.Source;
@@ -185,7 +189,7 @@ namespace WixToolset.Core
185 this.Core = null; 189 this.Core = null;
186 } 190 }
187 191
188 return this.Context.Messaging.EncounteredError ? null : target; 192 return this.Messaging.EncounteredError ? null : target;
189 } 193 }
190 194
191 private void ResolveComponentIdPlaceholders(Intermediate target) 195 private void ResolveComponentIdPlaceholders(Intermediate target)
diff --git a/src/WixToolset.Core/CompilerCore.cs b/src/WixToolset.Core/CompilerCore.cs
index 651c80a3..c9165b52 100644
--- a/src/WixToolset.Core/CompilerCore.cs
+++ b/src/WixToolset.Core/CompilerCore.cs
@@ -14,6 +14,7 @@ namespace WixToolset.Core
14 using System.Xml.Linq; 14 using System.Xml.Linq;
15 using WixToolset.Data; 15 using WixToolset.Data;
16 using WixToolset.Extensibility; 16 using WixToolset.Extensibility;
17 using WixToolset.Extensibility.Data;
17 using WixToolset.Extensibility.Services; 18 using WixToolset.Extensibility.Services;
18 using Wix = WixToolset.Data.Serialize; 19 using Wix = WixToolset.Data.Serialize;
19 20
diff --git a/src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs b/src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs
index b65abdfb..f62f8f10 100644
--- a/src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs
+++ b/src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs
@@ -12,10 +12,11 @@ namespace WixToolset.Core.ExtensibilityServices
12 using System.Text.RegularExpressions; 12 using System.Text.RegularExpressions;
13 using System.Xml.Linq; 13 using System.Xml.Linq;
14 using WixToolset.Data; 14 using WixToolset.Data;
15 using Wix = WixToolset.Data.Serialize;
16 using WixToolset.Data.Tuples; 15 using WixToolset.Data.Tuples;
17 using WixToolset.Extensibility; 16 using WixToolset.Extensibility;
17 using WixToolset.Extensibility.Data;
18 using WixToolset.Extensibility.Services; 18 using WixToolset.Extensibility.Services;
19 using Wix = WixToolset.Data.Serialize;
19 20
20 internal class ParseHelper : IParseHelper 21 internal class ParseHelper : IParseHelper
21 { 22 {
diff --git a/src/WixToolset.Core/ExtensibilityServices/PreprocessHelper.cs b/src/WixToolset.Core/ExtensibilityServices/PreprocessHelper.cs
index 0331c815..0e4bba51 100644
--- a/src/WixToolset.Core/ExtensibilityServices/PreprocessHelper.cs
+++ b/src/WixToolset.Core/ExtensibilityServices/PreprocessHelper.cs
@@ -9,6 +9,7 @@ namespace WixToolset.Core.ExtensibilityServices
9 using System.Xml.Linq; 9 using System.Xml.Linq;
10 using WixToolset.Data; 10 using WixToolset.Data;
11 using WixToolset.Extensibility; 11 using WixToolset.Extensibility;
12 using WixToolset.Extensibility.Data;
12 using WixToolset.Extensibility.Services; 13 using WixToolset.Extensibility.Services;
13 14
14 internal class PreprocessHelper : IPreprocessHelper 15 internal class PreprocessHelper : IPreprocessHelper
@@ -19,10 +20,14 @@ namespace WixToolset.Core.ExtensibilityServices
19 public PreprocessHelper(IServiceProvider serviceProvider) 20 public PreprocessHelper(IServiceProvider serviceProvider)
20 { 21 {
21 this.ServiceProvider = serviceProvider; 22 this.ServiceProvider = serviceProvider;
23
24 this.Messaging = this.ServiceProvider.GetService<IMessaging>();
22 } 25 }
23 26
24 private IServiceProvider ServiceProvider { get; } 27 private IServiceProvider ServiceProvider { get; }
25 28
29 private IMessaging Messaging { get; }
30
26 private Dictionary<string, IPreprocessorExtension> ExtensionsByPrefix { get; set; } 31 private Dictionary<string, IPreprocessorExtension> ExtensionsByPrefix { get; set; }
27 32
28 public void AddVariable(IPreprocessContext context, string name, string value) 33 public void AddVariable(IPreprocessContext context, string name, string value)
@@ -42,7 +47,7 @@ namespace WixToolset.Core.ExtensibilityServices
42 { 47 {
43 if (showWarning) 48 if (showWarning)
44 { 49 {
45 context.Messaging.Write(WarningMessages.VariableDeclarationCollision(context.CurrentSourceLineNumber, name, value, currentValue)); 50 this.Messaging.Write(WarningMessages.VariableDeclarationCollision(context.CurrentSourceLineNumber, name, value, currentValue));
46 } 51 }
47 52
48 context.Variables[name] = value; 53 context.Variables[name] = value;
@@ -220,7 +225,7 @@ namespace WixToolset.Core.ExtensibilityServices
220 return context.CurrentSourceLineNumber.FileName; 225 return context.CurrentSourceLineNumber.FileName;
221 226
222 case "PLATFORM": 227 case "PLATFORM":
223 context.Messaging.Write(WarningMessages.DeprecatedPreProcVariable(context.CurrentSourceLineNumber, "$(sys.PLATFORM)", "$(sys.BUILDARCH)")); 228 this.Messaging.Write(WarningMessages.DeprecatedPreProcVariable(context.CurrentSourceLineNumber, "$(sys.PLATFORM)", "$(sys.BUILDARCH)"));
224 229
225 goto case "BUILDARCH"; 230 goto case "BUILDARCH";
226 231
@@ -295,7 +300,7 @@ namespace WixToolset.Core.ExtensibilityServices
295 { 300 {
296 // Add any core defined pragmas here 301 // Add any core defined pragmas here
297 default: 302 default:
298 context.Messaging.Write(WarningMessages.PreprocessorUnknownPragma(context.CurrentSourceLineNumber, pragmaName)); 303 this.Messaging.Write(WarningMessages.PreprocessorUnknownPragma(context.CurrentSourceLineNumber, pragmaName));
299 break; 304 break;
300 } 305 }
301 break; 306 break;
@@ -306,7 +311,7 @@ namespace WixToolset.Core.ExtensibilityServices
306 { 311 {
307 if (!extension.ProcessPragma(prefix, pragma, args, parent)) 312 if (!extension.ProcessPragma(prefix, pragma, args, parent))
308 { 313 {
309 context.Messaging.Write(WarningMessages.PreprocessorUnknownPragma(context.CurrentSourceLineNumber, pragmaName)); 314 this.Messaging.Write(WarningMessages.PreprocessorUnknownPragma(context.CurrentSourceLineNumber, pragmaName));
310 } 315 }
311 } 316 }
312 break; 317 break;
@@ -339,7 +344,7 @@ namespace WixToolset.Core.ExtensibilityServices
339 currentPosition = remainder.IndexOf(')'); 344 currentPosition = remainder.IndexOf(')');
340 if (-1 == currentPosition) 345 if (-1 == currentPosition)
341 { 346 {
342 context.Messaging.Write(ErrorMessages.InvalidPreprocessorVariable(context.CurrentSourceLineNumber, remainder)); 347 this.Messaging.Write(ErrorMessages.InvalidPreprocessorVariable(context.CurrentSourceLineNumber, remainder));
343 break; 348 break;
344 } 349 }
345 350
@@ -385,12 +390,12 @@ namespace WixToolset.Core.ExtensibilityServices
385 { 390 {
386 if (isFunction) 391 if (isFunction)
387 { 392 {
388 context.Messaging.Write(ErrorMessages.InvalidPreprocessorFunction(context.CurrentSourceLineNumber, remainder)); 393 this.Messaging.Write(ErrorMessages.InvalidPreprocessorFunction(context.CurrentSourceLineNumber, remainder));
389 break; 394 break;
390 } 395 }
391 else 396 else
392 { 397 {
393 context.Messaging.Write(ErrorMessages.InvalidPreprocessorVariable(context.CurrentSourceLineNumber, remainder)); 398 this.Messaging.Write(ErrorMessages.InvalidPreprocessorVariable(context.CurrentSourceLineNumber, remainder));
394 break; 399 break;
395 } 400 }
396 } 401 }
@@ -410,12 +415,12 @@ namespace WixToolset.Core.ExtensibilityServices
410 { 415 {
411 if (isFunction) 416 if (isFunction)
412 { 417 {
413 context.Messaging.Write(ErrorMessages.UndefinedPreprocessorFunction(context.CurrentSourceLineNumber, subString)); 418 this.Messaging.Write(ErrorMessages.UndefinedPreprocessorFunction(context.CurrentSourceLineNumber, subString));
414 break; 419 break;
415 } 420 }
416 else 421 else
417 { 422 {
418 context.Messaging.Write(ErrorMessages.UndefinedPreprocessorVariable(context.CurrentSourceLineNumber, subString)); 423 this.Messaging.Write(ErrorMessages.UndefinedPreprocessorVariable(context.CurrentSourceLineNumber, subString));
419 break; 424 break;
420 } 425 }
421 } 426 }
@@ -448,7 +453,7 @@ namespace WixToolset.Core.ExtensibilityServices
448 { 453 {
449 if (!context.Variables.Remove(name)) 454 if (!context.Variables.Remove(name))
450 { 455 {
451 context.Messaging.Write(ErrorMessages.CannotReundefineVariable(context.CurrentSourceLineNumber, name)); 456 this.Messaging.Write(ErrorMessages.CannotReundefineVariable(context.CurrentSourceLineNumber, name));
452 } 457 }
453 } 458 }
454 459
diff --git a/src/WixToolset.Core/IncribeContext.cs b/src/WixToolset.Core/IncribeContext.cs
index 9e4e3602..9a002d68 100644
--- a/src/WixToolset.Core/IncribeContext.cs
+++ b/src/WixToolset.Core/IncribeContext.cs
@@ -3,7 +3,7 @@
3namespace WixToolset.Core 3namespace WixToolset.Core
4{ 4{
5 using System; 5 using System;
6 using WixToolset.Extensibility; 6 using WixToolset.Extensibility.Data;
7 using WixToolset.Extensibility.Services; 7 using WixToolset.Extensibility.Services;
8 8
9 internal class InscribeContext : IInscribeContext 9 internal class InscribeContext : IInscribeContext
@@ -15,8 +15,6 @@ namespace WixToolset.Core
15 15
16 public IServiceProvider ServiceProvider { get; } 16 public IServiceProvider ServiceProvider { get; }
17 17
18 public IMessaging Messaging { get; set; }
19
20 public string IntermediateFolder { get; set; } 18 public string IntermediateFolder { get; set; }
21 19
22 public string InputFilePath { get; set; } 20 public string InputFilePath { get; set; }
diff --git a/src/WixToolset.Core/Layout.cs b/src/WixToolset.Core/Layout.cs
index d62335fb..a44c212d 100644
--- a/src/WixToolset.Core/Layout.cs
+++ b/src/WixToolset.Core/Layout.cs
@@ -8,8 +8,8 @@ namespace WixToolset.Core
8 using System.Linq; 8 using System.Linq;
9 using WixToolset.Core.Bind; 9 using WixToolset.Core.Bind;
10 using WixToolset.Data; 10 using WixToolset.Data;
11 using WixToolset.Data.Bind;
12 using WixToolset.Extensibility; 11 using WixToolset.Extensibility;
12 using WixToolset.Extensibility.Data;
13 using WixToolset.Extensibility.Services; 13 using WixToolset.Extensibility.Services;
14 14
15 /// <summary> 15 /// <summary>
@@ -20,10 +20,14 @@ namespace WixToolset.Core
20 public Layout(IServiceProvider serviceProvider) 20 public Layout(IServiceProvider serviceProvider)
21 { 21 {
22 this.ServiceProvider = serviceProvider; 22 this.ServiceProvider = serviceProvider;
23
24 this.Messaging = serviceProvider.GetService<IMessaging>();
23 } 25 }
24 26
25 private IServiceProvider ServiceProvider { get; } 27 private IServiceProvider ServiceProvider { get; }
26 28
29 private IMessaging Messaging { get; }
30
27 public IEnumerable<FileTransfer> FileTransfers { get; set; } 31 public IEnumerable<FileTransfer> FileTransfers { get; set; }
28 32
29 public IEnumerable<string> ContentFilePaths { get; set; } 33 public IEnumerable<string> ContentFilePaths { get; set; }
@@ -36,21 +40,16 @@ namespace WixToolset.Core
36 40
37 public bool SuppressAclReset { get; set; } 41 public bool SuppressAclReset { get; set; }
38 42
39 private IMessaging Messaging { get; set; }
40
41 public void Execute() 43 public void Execute()
42 { 44 {
43 this.Messaging = this.ServiceProvider.GetService<IMessaging>();
44
45 var extensionManager = this.ServiceProvider.GetService<IExtensionManager>(); 45 var extensionManager = this.ServiceProvider.GetService<IExtensionManager>();
46 46
47 var context = this.ServiceProvider.GetService<ILayoutContext>(); 47 var context = this.ServiceProvider.GetService<ILayoutContext>();
48 context.Messaging = this.Messaging;
49 context.Extensions = extensionManager.Create<ILayoutExtension>(); 48 context.Extensions = extensionManager.Create<ILayoutExtension>();
50 context.FileTransfers = this.FileTransfers; 49 context.FileTransfers = this.FileTransfers;
51 context.ContentFilePaths = this.ContentFilePaths; 50 context.ContentFilePaths = this.ContentFilePaths;
52 context.ContentsFile = this.ContentsFile; 51 context.ContentsFile = this.ContentsFile;
53 context.OutputPdbPath = this.OutputsFile; 52 context.OutputsFile = this.OutputsFile;
54 context.BuiltOutputsFile = this.BuiltOutputsFile; 53 context.BuiltOutputsFile = this.BuiltOutputsFile;
55 context.SuppressAclReset = this.SuppressAclReset; 54 context.SuppressAclReset = this.SuppressAclReset;
56 55
@@ -69,7 +68,7 @@ namespace WixToolset.Core
69 { 68 {
70 this.Messaging.Write(VerboseMessages.LayingOutMedia()); 69 this.Messaging.Write(VerboseMessages.LayingOutMedia());
71 70
72 var command = new TransferFilesCommand(context.Messaging, context.Extensions, context.FileTransfers, context.SuppressAclReset); 71 var command = new TransferFilesCommand(this.Messaging, context.Extensions, context.FileTransfers, context.SuppressAclReset);
73 command.Execute(); 72 command.Execute();
74 } 73 }
75 } 74 }
diff --git a/src/WixToolset.Core/LayoutContext.cs b/src/WixToolset.Core/LayoutContext.cs
index 24f171a9..af0df518 100644
--- a/src/WixToolset.Core/LayoutContext.cs
+++ b/src/WixToolset.Core/LayoutContext.cs
@@ -4,9 +4,8 @@ namespace WixToolset.Core
4{ 4{
5 using System; 5 using System;
6 using System.Collections.Generic; 6 using System.Collections.Generic;
7 using WixToolset.Data.Bind;
8 using WixToolset.Extensibility; 7 using WixToolset.Extensibility;
9 using WixToolset.Extensibility.Services; 8 using WixToolset.Extensibility.Data;
10 9
11 public class LayoutContext : ILayoutContext 10 public class LayoutContext : ILayoutContext
12 { 11 {
@@ -17,8 +16,6 @@ namespace WixToolset.Core
17 16
18 public IServiceProvider ServiceProvider { get; } 17 public IServiceProvider ServiceProvider { get; }
19 18
20 public IMessaging Messaging { get; set; }
21
22 public IEnumerable<ILayoutExtension> Extensions { get; set; } 19 public IEnumerable<ILayoutExtension> Extensions { get; set; }
23 20
24 public IEnumerable<IFileSystemExtension> FileSystemExtensions { get; set; } 21 public IEnumerable<IFileSystemExtension> FileSystemExtensions { get; set; }
diff --git a/src/WixToolset.Core/Librarian.cs b/src/WixToolset.Core/Librarian.cs
index c42356ac..15efcfcc 100644
--- a/src/WixToolset.Core/Librarian.cs
+++ b/src/WixToolset.Core/Librarian.cs
@@ -9,6 +9,7 @@ namespace WixToolset.Core
9 using WixToolset.Core.Link; 9 using WixToolset.Core.Link;
10 using WixToolset.Data; 10 using WixToolset.Data;
11 using WixToolset.Extensibility; 11 using WixToolset.Extensibility;
12 using WixToolset.Extensibility.Data;
12 using WixToolset.Extensibility.Services; 13 using WixToolset.Extensibility.Services;
13 14
14 /// <summary> 15 /// <summary>
@@ -19,10 +20,14 @@ namespace WixToolset.Core
19 public Librarian(IServiceProvider serviceProvider) 20 public Librarian(IServiceProvider serviceProvider)
20 { 21 {
21 this.ServiceProvider = serviceProvider; 22 this.ServiceProvider = serviceProvider;
23
24 this.Messaging = this.ServiceProvider.GetService<IMessaging>();
22 } 25 }
23 26
24 private IServiceProvider ServiceProvider { get; } 27 private IServiceProvider ServiceProvider { get; }
25 28
29 private IMessaging Messaging { get; }
30
26 private ILibraryContext Context { get; set; } 31 private ILibraryContext Context { get; set; }
27 32
28 public bool BindFiles { get; set; } 33 public bool BindFiles { get; set; }
@@ -41,7 +46,6 @@ namespace WixToolset.Core
41 public Intermediate Execute() 46 public Intermediate Execute()
42 { 47 {
43 this.Context = new LibraryContext(this.ServiceProvider); 48 this.Context = new LibraryContext(this.ServiceProvider);
44 this.Context.Messaging = this.ServiceProvider.GetService<IMessaging>();
45 this.Context.BindFiles = this.BindFiles; 49 this.Context.BindFiles = this.BindFiles;
46 this.Context.BindPaths = this.BindPaths; 50 this.Context.BindPaths = this.BindPaths;
47 this.Context.Extensions = this.ServiceProvider.GetService<IExtensionManager>().Create<ILibrarianExtension>(); 51 this.Context.Extensions = this.ServiceProvider.GetService<IExtensionManager>().Create<ILibrarianExtension>();
@@ -59,10 +63,10 @@ namespace WixToolset.Core
59 { 63 {
60 var sections = this.Context.Intermediates.SelectMany(i => i.Sections).ToList(); 64 var sections = this.Context.Intermediates.SelectMany(i => i.Sections).ToList();
61 65
62 var collate = new CollateLocalizationsCommand(this.Context.Messaging, this.Context.Localizations); 66 var collate = new CollateLocalizationsCommand(this.Messaging, this.Context.Localizations);
63 var localizationsByCulture = collate.Execute(); 67 var localizationsByCulture = collate.Execute();
64 68
65 if (this.Context.Messaging.EncounteredError) 69 if (this.Messaging.EncounteredError)
66 { 70 {
67 return null; 71 return null;
68 } 72 }
@@ -86,7 +90,7 @@ namespace WixToolset.Core
86 } 90 }
87 } 91 }
88 92
89 return this.Context.Messaging.EncounteredError ? null : library; 93 return this.Messaging.EncounteredError ? null : library;
90 } 94 }
91 95
92 /// <summary> 96 /// <summary>
@@ -95,7 +99,7 @@ namespace WixToolset.Core
95 /// <param name="library">Library to validate.</param> 99 /// <param name="library">Library to validate.</param>
96 private void Validate(Intermediate library) 100 private void Validate(Intermediate library)
97 { 101 {
98 FindEntrySectionAndLoadSymbolsCommand find = new FindEntrySectionAndLoadSymbolsCommand(this.Context.Messaging, library.Sections); 102 FindEntrySectionAndLoadSymbolsCommand find = new FindEntrySectionAndLoadSymbolsCommand(this.Messaging, library.Sections);
99 find.Execute(); 103 find.Execute();
100 104
101 // TODO: Consider bringing this sort of verification back. 105 // TODO: Consider bringing this sort of verification back.
@@ -116,7 +120,7 @@ namespace WixToolset.Core
116 // Resolve paths to files that are to be embedded in the library. 120 // Resolve paths to files that are to be embedded in the library.
117 if (this.Context.BindFiles) 121 if (this.Context.BindFiles)
118 { 122 {
119 var variableResolver = new WixVariableResolver(this.Context.Messaging); 123 var variableResolver = new WixVariableResolver(this.Messaging);
120 124
121 var fileResolver = new FileResolver(this.Context.BindPaths, this.Context.Extensions); 125 var fileResolver = new FileResolver(this.Context.BindPaths, this.Context.Extensions);
122 126
@@ -141,7 +145,7 @@ namespace WixToolset.Core
141 } 145 }
142 else 146 else
143 { 147 {
144 this.Context.Messaging.Write(ErrorMessages.FileNotFound(tuple.SourceLineNumbers, pathField.Path, tuple.Definition.Name)); 148 this.Messaging.Write(ErrorMessages.FileNotFound(tuple.SourceLineNumbers, pathField.Path, tuple.Definition.Name));
145 } 149 }
146 } 150 }
147 } 151 }
diff --git a/src/WixToolset.Core/LibraryContext.cs b/src/WixToolset.Core/LibraryContext.cs
index 56a9389f..0b09aa93 100644
--- a/src/WixToolset.Core/LibraryContext.cs
+++ b/src/WixToolset.Core/LibraryContext.cs
@@ -6,6 +6,7 @@ namespace WixToolset.Core
6 using System.Collections.Generic; 6 using System.Collections.Generic;
7 using WixToolset.Data; 7 using WixToolset.Data;
8 using WixToolset.Extensibility; 8 using WixToolset.Extensibility;
9 using WixToolset.Extensibility.Data;
9 using WixToolset.Extensibility.Services; 10 using WixToolset.Extensibility.Services;
10 11
11 public class LibraryContext : ILibraryContext 12 public class LibraryContext : ILibraryContext
diff --git a/src/WixToolset.Core/LinkContext.cs b/src/WixToolset.Core/LinkContext.cs
index b4474ec5..7576ca3f 100644
--- a/src/WixToolset.Core/LinkContext.cs
+++ b/src/WixToolset.Core/LinkContext.cs
@@ -6,7 +6,7 @@ namespace WixToolset.Core
6 using System.Collections.Generic; 6 using System.Collections.Generic;
7 using WixToolset.Data; 7 using WixToolset.Data;
8 using WixToolset.Extensibility; 8 using WixToolset.Extensibility;
9 using WixToolset.Extensibility.Services; 9 using WixToolset.Extensibility.Data;
10 10
11 public class LinkContext : ILinkContext 11 public class LinkContext : ILinkContext
12 { 12 {
@@ -17,8 +17,6 @@ namespace WixToolset.Core
17 17
18 public IServiceProvider ServiceProvider { get; } 18 public IServiceProvider ServiceProvider { get; }
19 19
20 public IMessaging Messaging { get; set; }
21
22 public IEnumerable<ILinkerExtension> Extensions { get; set; } 20 public IEnumerable<ILinkerExtension> Extensions { get; set; }
23 21
24 public IEnumerable<IExtensionData> ExtensionData { get; set; } 22 public IEnumerable<IExtensionData> ExtensionData { get; set; }
diff --git a/src/WixToolset.Core/Linker.cs b/src/WixToolset.Core/Linker.cs
index db2514fb..4d1a6965 100644
--- a/src/WixToolset.Core/Linker.cs
+++ b/src/WixToolset.Core/Linker.cs
@@ -12,6 +12,7 @@ namespace WixToolset.Core
12 using WixToolset.Data; 12 using WixToolset.Data;
13 using WixToolset.Data.Tuples; 13 using WixToolset.Data.Tuples;
14 using WixToolset.Extensibility; 14 using WixToolset.Extensibility;
15 using WixToolset.Extensibility.Data;
15 using WixToolset.Extensibility.Services; 16 using WixToolset.Extensibility.Services;
16 using WixToolset.Link; 17 using WixToolset.Link;
17 18
@@ -31,11 +32,14 @@ namespace WixToolset.Core
31 public Linker(IServiceProvider serviceProvider) 32 public Linker(IServiceProvider serviceProvider)
32 { 33 {
33 this.ServiceProvider = serviceProvider; 34 this.ServiceProvider = serviceProvider;
35 this.Messaging = this.ServiceProvider.GetService<IMessaging>();
34 this.sectionIdOnRows = true; // TODO: what is the correct value for this? 36 this.sectionIdOnRows = true; // TODO: what is the correct value for this?
35 } 37 }
36 38
37 private IServiceProvider ServiceProvider { get; } 39 private IServiceProvider ServiceProvider { get; }
38 40
41 private IMessaging Messaging { get; }
42
39 private ILinkContext Context { get; set; } 43 private ILinkContext Context { get; set; }
40 44
41 /// <summary> 45 /// <summary>
@@ -71,7 +75,6 @@ namespace WixToolset.Core
71 var creator = this.TupleDefinitionCreator ?? this.ServiceProvider.GetService<ITupleDefinitionCreator>(); 75 var creator = this.TupleDefinitionCreator ?? this.ServiceProvider.GetService<ITupleDefinitionCreator>();
72 76
73 this.Context = this.ServiceProvider.GetService<ILinkContext>(); 77 this.Context = this.ServiceProvider.GetService<ILinkContext>();
74 this.Context.Messaging = this.ServiceProvider.GetService<IMessaging>();
75 this.Context.Extensions = extensionManager.Create<ILinkerExtension>(); 78 this.Context.Extensions = extensionManager.Create<ILinkerExtension>();
76 this.Context.ExtensionData = extensionManager.Create<IExtensionData>(); 79 this.Context.ExtensionData = extensionManager.Create<IExtensionData>();
77 this.Context.ExpectedOutputType = this.OutputType; 80 this.Context.ExpectedOutputType = this.OutputType;
@@ -151,7 +154,7 @@ namespace WixToolset.Core
151 154
152 // First find the entry section and while processing all sections load all the symbols from all of the sections. 155 // First find the entry section and while processing all sections load all the symbols from all of the sections.
153 // sections.FindEntrySectionAndLoadSymbols(false, this, expectedOutputType, out entrySection, out allSymbols); 156 // sections.FindEntrySectionAndLoadSymbols(false, this, expectedOutputType, out entrySection, out allSymbols);
154 var find = new FindEntrySectionAndLoadSymbolsCommand(this.Context.Messaging, sections); 157 var find = new FindEntrySectionAndLoadSymbolsCommand(this.Messaging, sections);
155 find.ExpectedOutputType = this.Context.ExpectedOutputType; 158 find.ExpectedOutputType = this.Context.ExpectedOutputType;
156 find.Execute(); 159 find.Execute();
157 160
@@ -166,12 +169,12 @@ namespace WixToolset.Core
166 169
167 // Resolve the symbol references to find the set of sections we care about for linking. 170 // Resolve the symbol references to find the set of sections we care about for linking.
168 // Of course, we start with the entry section (that's how it got its name after all). 171 // Of course, we start with the entry section (that's how it got its name after all).
169 var resolve = new ResolveReferencesCommand(this.Context.Messaging, find.EntrySection, find.Symbols); 172 var resolve = new ResolveReferencesCommand(this.Messaging, find.EntrySection, find.Symbols);
170 resolve.BuildingMergeModule = (SectionType.Module == find.EntrySection.Type); 173 resolve.BuildingMergeModule = (SectionType.Module == find.EntrySection.Type);
171 174
172 resolve.Execute(); 175 resolve.Execute();
173 176
174 if (this.Context.Messaging.EncounteredError) 177 if (this.Messaging.EncounteredError)
175 { 178 {
176 return null; 179 return null;
177 } 180 }
@@ -185,7 +188,7 @@ namespace WixToolset.Core
185 188
186 this.FlattenSectionsComplexReferences(sections); 189 this.FlattenSectionsComplexReferences(sections);
187 190
188 if (this.Context.Messaging.EncounteredError) 191 if (this.Messaging.EncounteredError)
189 { 192 {
190 return null; 193 return null;
191 } 194 }
@@ -197,7 +200,7 @@ namespace WixToolset.Core
197 var modulesToFeatures = new ConnectToFeatureCollection(); 200 var modulesToFeatures = new ConnectToFeatureCollection();
198 this.ProcessComplexReferences(find.EntrySection, sections, referencedComponents, componentsToFeatures, featuresToFeatures, modulesToFeatures); 201 this.ProcessComplexReferences(find.EntrySection, sections, referencedComponents, componentsToFeatures, featuresToFeatures, modulesToFeatures);
199 202
200 if (this.Context.Messaging.EncounteredError) 203 if (this.Messaging.EncounteredError)
201 { 204 {
202 return null; 205 return null;
203 } 206 }
@@ -212,10 +215,10 @@ namespace WixToolset.Core
212 } 215 }
213 216
214 // Report duplicates that would ultimately end up being primary key collisions. 217 // Report duplicates that would ultimately end up being primary key collisions.
215 var reportDupes = new ReportConflictingSymbolsCommand(this.Context.Messaging, find.PossiblyConflictingSymbols, resolve.ResolvedSections); 218 var reportDupes = new ReportConflictingSymbolsCommand(this.Messaging, find.PossiblyConflictingSymbols, resolve.ResolvedSections);
216 reportDupes.Execute(); 219 reportDupes.Execute();
217 220
218 if (this.Context.Messaging.EncounteredError) 221 if (this.Messaging.EncounteredError)
219 { 222 {
220 return null; 223 return null;
221 } 224 }
@@ -716,12 +719,12 @@ namespace WixToolset.Core
716 // Bundles have groups of data that must be flattened in a way different from other types. 719 // Bundles have groups of data that must be flattened in a way different from other types.
717 this.FlattenBundleTables(resolvedSection); 720 this.FlattenBundleTables(resolvedSection);
718 721
719 if (this.Context.Messaging.EncounteredError) 722 if (this.Messaging.EncounteredError)
720 { 723 {
721 return null; 724 return null;
722 } 725 }
723 726
724 var collate = new CollateLocalizationsCommand(this.Context.Messaging, localizations); 727 var collate = new CollateLocalizationsCommand(this.Messaging, localizations);
725 var localizationsByCulture = collate.Execute(); 728 var localizationsByCulture = collate.Execute();
726 729
727 intermediate = new Intermediate(resolvedSection.Id, new[] { resolvedSection }, localizationsByCulture, null); 730 intermediate = new Intermediate(resolvedSection.Id, new[] { resolvedSection }, localizationsByCulture, null);
@@ -738,7 +741,7 @@ namespace WixToolset.Core
738 } 741 }
739 } 742 }
740 743
741 return this.Context.Messaging.EncounteredError ? null : intermediate; 744 return this.Messaging.EncounteredError ? null : intermediate;
742 } 745 }
743 746
744#if SOLVE_CUSTOM_TABLE 747#if SOLVE_CUSTOM_TABLE
@@ -1118,7 +1121,7 @@ namespace WixToolset.Core
1118 /// <param name="message">Message event arguments.</param> 1121 /// <param name="message">Message event arguments.</param>
1119 public void OnMessage(Message message) 1122 public void OnMessage(Message message)
1120 { 1123 {
1121 this.Context.Messaging.Write(message); 1124 this.Messaging.Write(message);
1122 } 1125 }
1123 1126
1124 /// <summary> 1127 /// <summary>
@@ -1616,7 +1619,7 @@ namespace WixToolset.Core
1616 // will hold Payloads under UX, ChainPackages (references?) under Chain, 1619 // will hold Payloads under UX, ChainPackages (references?) under Chain,
1617 // and ChainPackages/Payloads under the attached and any detatched 1620 // and ChainPackages/Payloads under the attached and any detatched
1618 // Containers. 1621 // Containers.
1619 var groups = new WixGroupingOrdering(entrySection, this.Context.Messaging); 1622 var groups = new WixGroupingOrdering(entrySection, this.Messaging);
1620 1623
1621 // Create UX payloads and Package payloads 1624 // Create UX payloads and Package payloads
1622 groups.UseTypes(new string[] { "Container", "Layout", "PackageGroup", "PayloadGroup", "Package" }, new string[] { "PackageGroup", "Package", "PayloadGroup", "Payload" }); 1625 groups.UseTypes(new string[] { "Container", "Layout", "PackageGroup", "PayloadGroup", "Package" }, new string[] { "PackageGroup", "Package", "PayloadGroup", "Payload" });
diff --git a/src/WixToolset.Core/PreprocessContext.cs b/src/WixToolset.Core/PreprocessContext.cs
index a6085b81..151506e2 100644
--- a/src/WixToolset.Core/PreprocessContext.cs
+++ b/src/WixToolset.Core/PreprocessContext.cs
@@ -6,7 +6,7 @@ namespace WixToolset.Core
6 using System.Collections.Generic; 6 using System.Collections.Generic;
7 using WixToolset.Data; 7 using WixToolset.Data;
8 using WixToolset.Extensibility; 8 using WixToolset.Extensibility;
9 using WixToolset.Extensibility.Services; 9 using WixToolset.Extensibility.Data;
10 10
11 internal class PreprocessContext : IPreprocessContext 11 internal class PreprocessContext : IPreprocessContext
12 { 12 {
@@ -17,8 +17,6 @@ namespace WixToolset.Core
17 17
18 public IServiceProvider ServiceProvider { get; } 18 public IServiceProvider ServiceProvider { get; }
19 19
20 public IMessaging Messaging { get; set; }
21
22 public IEnumerable<IPreprocessorExtension> Extensions { get; set; } 20 public IEnumerable<IPreprocessorExtension> Extensions { get; set; }
23 21
24 public Platform Platform { get; set; } 22 public Platform Platform { get; set; }
diff --git a/src/WixToolset.Core/Preprocessor.cs b/src/WixToolset.Core/Preprocessor.cs
index 23d3f205..ac8cefe3 100644
--- a/src/WixToolset.Core/Preprocessor.cs
+++ b/src/WixToolset.Core/Preprocessor.cs
@@ -6,15 +6,16 @@ namespace WixToolset.Core
6 using System.Collections.Generic; 6 using System.Collections.Generic;
7 using System.Globalization; 7 using System.Globalization;
8 using System.IO; 8 using System.IO;
9 using System.Linq;
9 using System.Text; 10 using System.Text;
10 using System.Text.RegularExpressions; 11 using System.Text.RegularExpressions;
11 using System.Xml; 12 using System.Xml;
12 using System.Xml.Linq; 13 using System.Xml.Linq;
14 using WixToolset.Core.Preprocess;
13 using WixToolset.Data; 15 using WixToolset.Data;
14 using WixToolset.Extensibility; 16 using WixToolset.Extensibility;
15 using WixToolset.Core.Preprocess; 17 using WixToolset.Extensibility.Data;
16 using WixToolset.Extensibility.Services; 18 using WixToolset.Extensibility.Services;
17 using System.Linq;
18 19
19 /// <summary> 20 /// <summary>
20 /// Preprocessor object 21 /// Preprocessor object
@@ -39,6 +40,8 @@ namespace WixToolset.Core
39 public Preprocessor(IServiceProvider serviceProvider) 40 public Preprocessor(IServiceProvider serviceProvider)
40 { 41 {
41 this.ServiceProvider = serviceProvider; 42 this.ServiceProvider = serviceProvider;
43
44 this.Messaging = this.ServiceProvider.GetService<IMessaging>();
42 } 45 }
43 46
44 public IEnumerable<string> IncludeSearchPaths { get; set; } 47 public IEnumerable<string> IncludeSearchPaths { get; set; }
@@ -51,6 +54,8 @@ namespace WixToolset.Core
51 54
52 private IServiceProvider ServiceProvider { get; } 55 private IServiceProvider ServiceProvider { get; }
53 56
57 private IMessaging Messaging { get; }
58
54 private IPreprocessContext Context { get; set; } 59 private IPreprocessContext Context { get; set; }
55 60
56 private Stack<string> CurrentFileStack { get; } = new Stack<string>(); 61 private Stack<string> CurrentFileStack { get; } = new Stack<string>();
@@ -169,7 +174,7 @@ namespace WixToolset.Core
169 throw new WixException(ErrorMessages.InvalidXml(this.Context.CurrentSourceLineNumber, "source", e.Message)); 174 throw new WixException(ErrorMessages.InvalidXml(this.Context.CurrentSourceLineNumber, "source", e.Message));
170 } 175 }
171 176
172 return this.Context.Messaging.EncounteredError ? null : output; 177 return this.Messaging.EncounteredError ? null : output;
173 } 178 }
174 179
175 /// <summary> 180 /// <summary>
@@ -482,7 +487,7 @@ namespace WixToolset.Core
482 { 487 {
483 if ("Include" != reader.LocalName) 488 if ("Include" != reader.LocalName)
484 { 489 {
485 this.Context.Messaging.Write(ErrorMessages.InvalidDocumentElement(sourceLineNumbers, reader.Name, "include", "Include")); 490 this.Messaging.Write(ErrorMessages.InvalidDocumentElement(sourceLineNumbers, reader.Name, "include", "Include"));
486 } 491 }
487 492
488 this.IncludeNextStack.Pop(); 493 this.IncludeNextStack.Pop();
@@ -570,7 +575,7 @@ namespace WixToolset.Core
570 // Resolve other variables in the warning message. 575 // Resolve other variables in the warning message.
571 warningMessage = this.Helper.PreprocessString(this.Context, warningMessage); 576 warningMessage = this.Helper.PreprocessString(this.Context, warningMessage);
572 577
573 this.Context.Messaging.Write(WarningMessages.PreprocessorWarning(this.Context.CurrentSourceLineNumber, warningMessage)); 578 this.Messaging.Write(WarningMessages.PreprocessorWarning(this.Context.CurrentSourceLineNumber, warningMessage));
574 } 579 }
575 580
576 /// <summary> 581 /// <summary>
@@ -1431,7 +1436,6 @@ namespace WixToolset.Core
1431 private IPreprocessContext CreateContext() 1436 private IPreprocessContext CreateContext()
1432 { 1437 {
1433 var context = this.ServiceProvider.GetService<IPreprocessContext>(); 1438 var context = this.ServiceProvider.GetService<IPreprocessContext>();
1434 context.Messaging = this.ServiceProvider.GetService<IMessaging>();
1435 context.Extensions = this.ServiceProvider.GetService<IExtensionManager>().Create<IPreprocessorExtension>(); 1439 context.Extensions = this.ServiceProvider.GetService<IExtensionManager>().Create<IPreprocessorExtension>();
1436 context.CurrentSourceLineNumber = new SourceLineNumber(this.SourcePath); 1440 context.CurrentSourceLineNumber = new SourceLineNumber(this.SourcePath);
1437 context.Platform = this.Platform; 1441 context.Platform = this.Platform;
@@ -1456,7 +1460,7 @@ namespace WixToolset.Core
1456 } 1460 }
1457 else 1461 else
1458 { 1462 {
1459 this.Context.Messaging.Write(ErrorMessages.DuplicateExtensionPreprocessorType(extension.GetType().ToString(), prefix, collidingExtension.GetType().ToString())); 1463 this.Messaging.Write(ErrorMessages.DuplicateExtensionPreprocessorType(extension.GetType().ToString(), prefix, collidingExtension.GetType().ToString()));
1460 } 1464 }
1461 } 1465 }
1462 } 1466 }
diff --git a/src/WixToolset.Core/ResolveContext.cs b/src/WixToolset.Core/ResolveContext.cs
index d49a7d4b..65b991ea 100644
--- a/src/WixToolset.Core/ResolveContext.cs
+++ b/src/WixToolset.Core/ResolveContext.cs
@@ -6,6 +6,7 @@ namespace WixToolset.Core
6 using System.Collections.Generic; 6 using System.Collections.Generic;
7 using WixToolset.Data; 7 using WixToolset.Data;
8 using WixToolset.Extensibility; 8 using WixToolset.Extensibility;
9 using WixToolset.Extensibility.Data;
9 using WixToolset.Extensibility.Services; 10 using WixToolset.Extensibility.Services;
10 11
11 public class ResolveContext : IResolveContext 12 public class ResolveContext : IResolveContext
@@ -17,8 +18,6 @@ namespace WixToolset.Core
17 18
18 public IServiceProvider ServiceProvider { get; } 19 public IServiceProvider ServiceProvider { get; }
19 20
20 public IMessaging Messaging { get; set; }
21
22 public IEnumerable<BindPath> BindPaths { get; set; } 21 public IEnumerable<BindPath> BindPaths { get; set; }
23 22
24 public IEnumerable<IResolverExtension> Extensions { get; set; } 23 public IEnumerable<IResolverExtension> Extensions { get; set; }
diff --git a/src/WixToolset.Core/Resolver.cs b/src/WixToolset.Core/Resolver.cs
index 503d4bb7..5e283f2c 100644
--- a/src/WixToolset.Core/Resolver.cs
+++ b/src/WixToolset.Core/Resolver.cs
@@ -9,6 +9,7 @@ namespace WixToolset.Core
9 using WixToolset.Data; 9 using WixToolset.Data;
10 using WixToolset.Data.Tuples; 10 using WixToolset.Data.Tuples;
11 using WixToolset.Extensibility; 11 using WixToolset.Extensibility;
12 using WixToolset.Extensibility.Data;
12 using WixToolset.Extensibility.Services; 13 using WixToolset.Extensibility.Services;
13 14
14 /// <summary> 15 /// <summary>
@@ -19,9 +20,13 @@ namespace WixToolset.Core
19 public Resolver(IServiceProvider serviceProvider) 20 public Resolver(IServiceProvider serviceProvider)
20 { 21 {
21 this.ServiceProvider = serviceProvider; 22 this.ServiceProvider = serviceProvider;
23
24 this.Messaging = serviceProvider.GetService<IMessaging>();
22 } 25 }
23 26
24 private IServiceProvider ServiceProvider { get; set; } 27 private IServiceProvider ServiceProvider { get; }
28
29 public IMessaging Messaging { get; }
25 30
26 public IEnumerable<BindPath> BindPaths { get; set; } 31 public IEnumerable<BindPath> BindPaths { get; set; }
27 32
@@ -38,7 +43,6 @@ namespace WixToolset.Core
38 var extensionManager = this.ServiceProvider.GetService<IExtensionManager>(); 43 var extensionManager = this.ServiceProvider.GetService<IExtensionManager>();
39 44
40 var context = this.ServiceProvider.GetService<IResolveContext>(); 45 var context = this.ServiceProvider.GetService<IResolveContext>();
41 context.Messaging = this.ServiceProvider.GetService<IMessaging>();
42 context.BindPaths = this.BindPaths; 46 context.BindPaths = this.BindPaths;
43 context.Extensions = extensionManager.Create<IResolverExtension>(); 47 context.Extensions = extensionManager.Create<IResolverExtension>();
44 context.ExtensionData = extensionManager.Create<IExtensionData>(); 48 context.ExtensionData = extensionManager.Create<IExtensionData>();
@@ -46,7 +50,7 @@ namespace WixToolset.Core
46 context.IntermediateFolder = this.IntermediateFolder; 50 context.IntermediateFolder = this.IntermediateFolder;
47 context.IntermediateRepresentation = this.IntermediateRepresentation; 51 context.IntermediateRepresentation = this.IntermediateRepresentation;
48 context.Localizations = this.Localizations; 52 context.Localizations = this.Localizations;
49 context.VariableResolver = new WixVariableResolver(context.Messaging); 53 context.VariableResolver = new WixVariableResolver(this.Messaging);
50 54
51 foreach (IResolverExtension extension in context.Extensions) 55 foreach (IResolverExtension extension in context.Extensions)
52 { 56 {
@@ -82,7 +86,7 @@ namespace WixToolset.Core
82 IEnumerable<DelayedField> delayedFields; 86 IEnumerable<DelayedField> delayedFields;
83 { 87 {
84 var command = new ResolveFieldsCommand(); 88 var command = new ResolveFieldsCommand();
85 command.Messaging = context.Messaging; 89 command.Messaging = this.Messaging;
86 command.BuildingPatch = buildingPatch; 90 command.BuildingPatch = buildingPatch;
87 command.VariableResolver = context.VariableResolver; 91 command.VariableResolver = context.VariableResolver;
88 command.BindPaths = context.BindPaths; 92 command.BindPaths = context.BindPaths;
diff --git a/src/WixToolset.Core/WixToolsetServiceProvider.cs b/src/WixToolset.Core/WixToolsetServiceProvider.cs
index 7d318648..dd6da8c8 100644
--- a/src/WixToolset.Core/WixToolsetServiceProvider.cs
+++ b/src/WixToolset.Core/WixToolsetServiceProvider.cs
@@ -7,7 +7,7 @@ namespace WixToolset.Core
7 using WixToolset.Core.CommandLine; 7 using WixToolset.Core.CommandLine;
8 using WixToolset.Core.ExtensibilityServices; 8 using WixToolset.Core.ExtensibilityServices;
9 using WixToolset.Data; 9 using WixToolset.Data;
10 using WixToolset.Extensibility; 10 using WixToolset.Extensibility.Data;
11 using WixToolset.Extensibility.Services; 11 using WixToolset.Extensibility.Services;
12 12
13 public class WixToolsetServiceProvider : IServiceProvider 13 public class WixToolsetServiceProvider : IServiceProvider
@@ -27,7 +27,7 @@ namespace WixToolset.Core
27 // Transients. 27 // Transients.
28 { typeof(ICommandLineArguments), (provider, singletons) => new CommandLineArguments(provider) }, 28 { typeof(ICommandLineArguments), (provider, singletons) => new CommandLineArguments(provider) },
29 { typeof(ICommandLineContext), (provider, singletons) => new CommandLineContext(provider) }, 29 { typeof(ICommandLineContext), (provider, singletons) => new CommandLineContext(provider) },
30 { typeof(ICommandLine), (provider, singletons) => new CommandLineParser() }, 30 { typeof(ICommandLineParser), (provider, singletons) => new CommandLineParser(provider) },
31 { typeof(IPreprocessContext), (provider, singletons) => new PreprocessContext(provider) }, 31 { typeof(IPreprocessContext), (provider, singletons) => new PreprocessContext(provider) },
32 { typeof(ICompileContext), (provider, singletons) => new CompileContext(provider) }, 32 { typeof(ICompileContext), (provider, singletons) => new CompileContext(provider) },
33 { typeof(ILinkContext), (provider, singletons) => new LinkContext(provider) }, 33 { typeof(ILinkContext), (provider, singletons) => new LinkContext(provider) },