Hi,
I'm getting a strange error using NCrunch 1.48's 'Additional files to include' configuration option. It seems that a text file is not being simply copied, but rather, somehow a Unicode BOM is being injected into the file as part of the copy. Is that feasible?
I've uploaded an example of a broken test project here;
https://github.com/steve.../ncrunch-build-problem. It requires Java to run.
The odd thing here is that the tests work find in Visual Studio with the built-in testing window and the NUnit test runner, so it seems to only occur with NCrunch. And it seems somewhat intermittent, in that sometimes it builds in NCrunch, and sometimes it doesn't.
Here's the deal. I have a file, included in .csproj file like this;
Code:
<ItemGroup>
<Antlr4 Include="Interpreters\KPI\Measures.g4">
<Generator>MSBuild:Compile</Generator>
<CustomToolNamespace>MyProject.Interpreters.KPI</CustomToolNamespace>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Antlr4>
</ItemGroup>
This is an ANTLR grammar; ANTLR is a Java-based parser generator, so as part of the build, it kicks off a Java process which generates some C# from the '.g4' grammar file. However, by default, the '.g4' grammar file doesn't seem to get copied into NCunch's workspace automatically; I get this kind of build error;
Code:
..\Libraries\Antlr4.4.2.2-alpha001\build\Antlr4.targets (132)#0: cannot find or open file: C:\temp\ncrunch\4248\124\src\[...]\Interpreters\KPI\Measures.g4
So I add it as a file in 'Additional files to include'. At this point, the tool finds the file but fails with an error indicating that the *copied* version of the file now has a Byte-order mark on it -- the ANTLR tool now throws out this error;
Code:
Interpreters\KPI\Measures.g4 (1)#0: '´' came as a complete surprise to me
Interpreters\KPI\Measures.g4 (1)#1: '╗' came as a complete surprise to me
Interpreters\KPI\Measures.g4 (1)#2: '┐' came as a complete surprise to me
which seems to indicate that the copied file now contains the UTF-8 BOM. The Java standard libraries are pretty ropey when dealing with BOMs, so it seems that this is what is happening here.
My reading is that NCrunch seems to be doing something other than a straight file copy with the files listed in 'Additional files to include'. Is that true?