Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

NCrunch does not include files that have a custom build action
abelb
#1 Posted : Friday, September 12, 2014 5:36:35 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 9/12/2014(UTC)
Posts: 155
Location: Netherlands

Thanks: 19 times
Was thanked: 11 time(s) in 11 post(s)
I have an FSharp project that doesn't build because it does not include referenced files from the project file. While I have found a workaround (include these files manually in the NCrunch settings), this is not a long-term solution, because that requires us to remember to add dependencies not only in the project, but also in NCrunch.

In particular, as in the screenshot (sorry, no screenshot, seems that this website does not allow uploading screenshots), this was my setting. First I had trouble getting the custom build action to run, I solved this per the instructions on http://www.ncrunch.net/d...icit-file-dependencies. But now I still receive a file not found error for this file. It is included in the project file, so my assumption is, NCrunch ignores this dependency, even though it uses the standard syntax in the fsproj file.

Any workarounds to this?

Settings:
Build Action: FsLex
Copy to Output directory: Do Not Copy
File Name: AstLexer.fsl

In code:
Code:
  <ItemGroup>
    <Compile Include="PredefinedAst.fs" />
    <Compile Include="CompiledFiles\AstParser.fs">
      <Visible>false</Visible>
      <Link>AstParser.fs</Link>
    </Compile>
    <Compile Include="CompiledFiles\AstLexer.fs">
      <Visible>false</Visible>
      <Link>AstLexer.fs</Link>
    </Compile>
    <FsYacc Include="AstParser.fsy">
      <OtherFlags>--module Exselt.XPath.Parser.AstParser</OtherFlags>
    </FsYacc>
    <FsLex Include="AstLexer.fsl">
      <OtherFlags>--unicode</OtherFlags>
    </FsLex>
    <Compile Include="Common.fs" />
    <Compile Include="Parser.fs" />
  </ItemGroup>
Remco
#2 Posted : Friday, September 12, 2014 10:03:37 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi, thanks for posting.

NCrunch can only track files included in the project file that are of well known types. NCrunch isn't familiar with the 'FsYacc' and 'FsLex' tags, so it won't identify these files automatically. Adding them to the 'Additional files to include' setting for the project will allow you to work around this problem. I've made a note to add these to the auto discovery list in the next version of NCrunch.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.029 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download