aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBob Arnson <bob@joyofsetup.com>2017-12-29 15:12:24 -0500
committerBob Arnson <bob@joyofsetup.com>2017-12-29 15:12:24 -0500
commit59004832767115df136c553169e992577e5981d6 (patch)
tree09bc208c63c06820f86cee24e9fe0022f638a132 /src
parentab4ee36c182b67a80ca3404fdc344bf948192740 (diff)
downloadwix-59004832767115df136c553169e992577e5981d6.tar.gz
wix-59004832767115df136c553169e992577e5981d6.tar.bz2
wix-59004832767115df136c553169e992577e5981d6.zip
Pass along include search paths to those that need it.
Diffstat (limited to '')
-rw-r--r--src/WixToolset.Core/CommandLine/BuildCommand.cs3
-rw-r--r--src/WixToolset.Core/CommandLine/CommandLineParser.cs6
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs39
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/Package.en-us.wxl11
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/Package.wxs22
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/PackageComponents.wxs10
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/data/Package.wxi4
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/data/test.txt1
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj5
9 files changed, 99 insertions, 2 deletions
diff --git a/src/WixToolset.Core/CommandLine/BuildCommand.cs b/src/WixToolset.Core/CommandLine/BuildCommand.cs
index 1731caaf..fb258179 100644
--- a/src/WixToolset.Core/CommandLine/BuildCommand.cs
+++ b/src/WixToolset.Core/CommandLine/BuildCommand.cs
@@ -13,7 +13,7 @@ namespace WixToolset.Core.CommandLine
13 13
14 internal class BuildCommand : ICommandLineCommand 14 internal class BuildCommand : ICommandLineCommand
15 { 15 {
16 public BuildCommand(IServiceProvider serviceProvider, IEnumerable<SourceFile> sources, IDictionary<string, string> preprocessorVariables, IEnumerable<string> locFiles, IEnumerable<string> libraryFiles, string outputPath, OutputType outputType, string cabCachePath, IEnumerable<string> cultures, bool bindFiles, IEnumerable<BindPath> bindPaths, string intermediateFolder, string contentsFile, string outputsFile, string builtOutputsFile) 16 public BuildCommand(IServiceProvider serviceProvider, IEnumerable<SourceFile> sources, IDictionary<string, string> preprocessorVariables, IEnumerable<string> locFiles, IEnumerable<string> libraryFiles, string outputPath, OutputType outputType, string cabCachePath, IEnumerable<string> cultures, bool bindFiles, IEnumerable<BindPath> bindPaths, IEnumerable<string> includeSearchPaths, string intermediateFolder, string contentsFile, string outputsFile, string builtOutputsFile)
17 { 17 {
18 this.ServiceProvider = serviceProvider; 18 this.ServiceProvider = serviceProvider;
19 this.Messaging = serviceProvider.GetService<IMessaging>(); 19 this.Messaging = serviceProvider.GetService<IMessaging>();
@@ -29,6 +29,7 @@ namespace WixToolset.Core.CommandLine
29 this.Cultures = cultures; 29 this.Cultures = cultures;
30 this.BindFiles = bindFiles; 30 this.BindFiles = bindFiles;
31 this.BindPaths = bindPaths; 31 this.BindPaths = bindPaths;
32 this.IncludeSearchPaths = includeSearchPaths;
32 33
33 this.IntermediateFolder = intermediateFolder ?? Path.GetTempPath(); 34 this.IntermediateFolder = intermediateFolder ?? Path.GetTempPath();
34 this.ContentsFile = contentsFile; 35 this.ContentsFile = contentsFile;
diff --git a/src/WixToolset.Core/CommandLine/CommandLineParser.cs b/src/WixToolset.Core/CommandLine/CommandLineParser.cs
index 3c7f3d1e..500bed08 100644
--- a/src/WixToolset.Core/CommandLine/CommandLineParser.cs
+++ b/src/WixToolset.Core/CommandLine/CommandLineParser.cs
@@ -171,6 +171,10 @@ namespace WixToolset.Core.CommandLine
171 case "-version": 171 case "-version":
172 showVersion = true; 172 showVersion = true;
173 return true; 173 return true;
174
175 case "sval":
176 // todo: implement
177 return true;
174 } 178 }
175 179
176 return false; 180 return false;
@@ -207,7 +211,7 @@ namespace WixToolset.Core.CommandLine
207 var variables = this.GatherPreprocessorVariables(defines); 211 var variables = this.GatherPreprocessorVariables(defines);
208 var bindPathList = this.GatherBindPaths(bindPaths); 212 var bindPathList = this.GatherBindPaths(bindPaths);
209 var type = CalculateOutputType(outputType, outputFile); 213 var type = CalculateOutputType(outputType, outputFile);
210 return new BuildCommand(this.ServiceProvider, sourceFiles, variables, locFiles, libraryFiles, outputFile, type, cabCachePath, cultures, bindFiles, bindPathList, intermediateFolder, contentsFile, outputsFile, builtOutputsFile); 214 return new BuildCommand(this.ServiceProvider, sourceFiles, variables, locFiles, libraryFiles, outputFile, type, cabCachePath, cultures, bindFiles, bindPathList, includePaths, intermediateFolder, contentsFile, outputsFile, builtOutputsFile);
211 } 215 }
212 216
213 case Commands.Compile: 217 case Commands.Compile:
diff --git a/src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs b/src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs
index 7e54174d..a171981a 100644
--- a/src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs
+++ b/src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs
@@ -278,6 +278,45 @@ namespace WixToolsetTest.CoreIntegration
278 } 278 }
279 } 279 }
280 280
281 [Fact]
282 public void CanBuildWithIncludePath()
283 {
284 var folder = TestData.Get(@"TestData\IncludePath");
285 var bindpath = Path.Combine(folder, "data");
286
287 using (var fs = new DisposableFileSystem())
288 {
289 var baseFolder = fs.GetFolder();
290 var intermediateFolder = Path.Combine(baseFolder, "obj");
291
292 var program = new Program();
293 var result = program.Run(new WixToolsetServiceProvider(), null, new[]
294 {
295 "build",
296 Path.Combine(folder, "Package.wxs"),
297 Path.Combine(folder, "PackageComponents.wxs"),
298 "-loc", Path.Combine(folder, "Package.en-us.wxl"),
299 "-bindpath", bindpath,
300 "-intermediateFolder", intermediateFolder,
301 "-o", Path.Combine(baseFolder, @"bin\test.msi"),
302 "-i", bindpath,
303 });
304
305 Assert.Equal(0, result);
306
307 Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.msi")));
308 Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.wixpdb")));
309 Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\MsiPackage\test.txt")));
310
311 var intermediate = Intermediate.Load(Path.Combine(baseFolder, @"bin\test.wir"));
312 var section = intermediate.Sections.Single();
313
314 var wixFile = section.Tuples.OfType<WixFileTuple>().Single();
315 Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path);
316 Assert.Equal(@"test.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path);
317 }
318 }
319
281 [Fact(Skip = "Not implemented yet.")] 320 [Fact(Skip = "Not implemented yet.")]
282 public void CanBuildInstanceTransform() 321 public void CanBuildInstanceTransform()
283 { 322 {
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/Package.en-us.wxl b/src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/Package.en-us.wxl
new file mode 100644
index 00000000..38c12ac1
--- /dev/null
+++ b/src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/Package.en-us.wxl
@@ -0,0 +1,11 @@
1<?xml version="1.0" encoding="utf-8"?>
2
3<!--
4This file contains the declaration of all the localizable strings.
5-->
6<WixLocalization xmlns="http://wixtoolset.org/schemas/v4/wxl" Culture="en-US">
7
8 <String Id="DowngradeError">A newer version of [ProductName] is already installed.</String>
9 <String Id="FeatureTitle">MsiPackage</String>
10
11</WixLocalization>
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/Package.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/Package.wxs
new file mode 100644
index 00000000..8deab961
--- /dev/null
+++ b/src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/Package.wxs
@@ -0,0 +1,22 @@
1<?xml version="1.0" encoding="utf-8"?>
2<?include Package.wxi ?>
3<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
4 <Product Id="*" Name="MsiPackage" Language="1033" Version="$(var.ProductVersion)" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a">
5 <Package InstallerVersion="200" Compressed="no" InstallScope="perMachine" />
6
7 <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" />
8 <MediaTemplate />
9
10 <Feature Id="ProductFeature" Title="!(loc.FeatureTitle)">
11 <ComponentGroupRef Id="ProductComponents" />
12 </Feature>
13 </Product>
14
15 <Fragment>
16 <Directory Id="TARGETDIR" Name="SourceDir">
17 <Directory Id="ProgramFilesFolder">
18 <Directory Id="INSTALLFOLDER" Name="MsiPackage" />
19 </Directory>
20 </Directory>
21 </Fragment>
22</Wix>
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/PackageComponents.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/PackageComponents.wxs
new file mode 100644
index 00000000..e26c4509
--- /dev/null
+++ b/src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/PackageComponents.wxs
@@ -0,0 +1,10 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
3 <Fragment>
4 <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
5 <Component>
6 <File Source="test.txt" />
7 </Component>
8 </ComponentGroup>
9 </Fragment>
10</Wix>
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/data/Package.wxi b/src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/data/Package.wxi
new file mode 100644
index 00000000..f2df3b86
--- /dev/null
+++ b/src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/data/Package.wxi
@@ -0,0 +1,4 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Include xmlns="http://wixtoolset.org/schemas/v4/wxs">
3 <?define ProductVersion = "1.2.3" ?>
4</Include>
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/data/test.txt b/src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/data/test.txt
new file mode 100644
index 00000000..cd0db0e1
--- /dev/null
+++ b/src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/data/test.txt
@@ -0,0 +1 @@
This is test.txt. \ No newline at end of file
diff --git a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj
index d406a0da..d1901b38 100644
--- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj
+++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj
@@ -27,6 +27,11 @@
27 <Content Include="TestData\SingleFile\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> 27 <Content Include="TestData\SingleFile\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" />
28 <Content Include="TestData\SingleFile\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> 28 <Content Include="TestData\SingleFile\Package.wxs" CopyToOutputDirectory="PreserveNewest" />
29 <Content Include="TestData\SingleFile\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> 29 <Content Include="TestData\SingleFile\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" />
30 <Content Include="TestData\IncludePath\data\test.txt" CopyToOutputDirectory="PreserveNewest" />
31 <Content Include="TestData\IncludePath\data\Package.wxi" CopyToOutputDirectory="PreserveNewest" />
32 <Content Include="TestData\IncludePath\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" />
33 <Content Include="TestData\IncludePath\Package.wxs" CopyToOutputDirectory="PreserveNewest" />
34 <Content Include="TestData\IncludePath\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" />
30 <Content Include="TestData\SingleFileCompressed\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> 35 <Content Include="TestData\SingleFileCompressed\data\test.txt" CopyToOutputDirectory="PreserveNewest" />
31 <Content Include="TestData\SingleFileCompressed\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> 36 <Content Include="TestData\SingleFileCompressed\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" />
32 <Content Include="TestData\SingleFileCompressed\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> 37 <Content Include="TestData\SingleFileCompressed\Package.wxs" CopyToOutputDirectory="PreserveNewest" />