aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core/CommandLine/CompileCommand.cs
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2019-03-01 16:45:55 -0800
committerRob Mensching <rob@robmensching.com>2019-03-01 16:51:02 -0800
commit615bc202834ac45a9a107e5fccd900081a4abf74 (patch)
treeceebc5b3652f0274bee745701a3538439b0275d1 /src/WixToolset.Core/CommandLine/CompileCommand.cs
parent009f11ca9cf8674b40b74888aae90bcd4817828b (diff)
downloadwix-615bc202834ac45a9a107e5fccd900081a4abf74.tar.gz
wix-615bc202834ac45a9a107e5fccd900081a4abf74.tar.bz2
wix-615bc202834ac45a9a107e5fccd900081a4abf74.zip
Include the preprocessed include files with the processed document
This change also cleans up the internal state handling of the preprocesor to pass the processing state around rather than depend on "global state" in member variables. This removes the need to "reset" the member variables before preprocessing which is much cleaner.
Diffstat (limited to 'src/WixToolset.Core/CommandLine/CompileCommand.cs')
-rw-r--r--src/WixToolset.Core/CommandLine/CompileCommand.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/WixToolset.Core/CommandLine/CompileCommand.cs b/src/WixToolset.Core/CommandLine/CompileCommand.cs
index 69e35cab..bc37ee8c 100644
--- a/src/WixToolset.Core/CommandLine/CompileCommand.cs
+++ b/src/WixToolset.Core/CommandLine/CompileCommand.cs
@@ -63,11 +63,11 @@ namespace WixToolset.Core.CommandLine
63 context.SourcePath = sourceFile.SourcePath; 63 context.SourcePath = sourceFile.SourcePath;
64 context.Variables = this.PreprocessorVariables; 64 context.Variables = this.PreprocessorVariables;
65 65
66 XDocument document = null; 66 IPreprocessResult result = null;
67 try 67 try
68 { 68 {
69 var preprocessor = this.ServiceProvider.GetService<IPreprocessor>(); 69 var preprocessor = this.ServiceProvider.GetService<IPreprocessor>();
70 document = preprocessor.Preprocess(context); 70 result = preprocessor.Preprocess(context);
71 } 71 }
72 catch (WixException e) 72 catch (WixException e)
73 { 73 {
@@ -83,7 +83,7 @@ namespace WixToolset.Core.CommandLine
83 compileContext.Extensions = this.ExtensionManager.Create<ICompilerExtension>(); 83 compileContext.Extensions = this.ExtensionManager.Create<ICompilerExtension>();
84 compileContext.OutputPath = sourceFile.OutputPath; 84 compileContext.OutputPath = sourceFile.OutputPath;
85 compileContext.Platform = this.Platform; 85 compileContext.Platform = this.Platform;
86 compileContext.Source = document; 86 compileContext.Source = result?.Document;
87 87
88 var compiler = this.ServiceProvider.GetService<ICompiler>(); 88 var compiler = this.ServiceProvider.GetService<ICompiler>();
89 var intermediate = compiler.Compile(compileContext); 89 var intermediate = compiler.Compile(compileContext);