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

Notification

Icon
Error

Custom ItemGroups to be copied over to workspace
nayan
#1 Posted : Thursday, May 14, 2015 6:48:09 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/14/2015(UTC)
Posts: 4
Location: United States of America

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
Hi,

I have some custom targets which operate on files included in a custom ItemGroup. e.g
Code:

<SettingFile Include="common.xml" />


But by default, NCrunch only recognizes "None, Content, Compile" items as mentioned in Implicit File Dependencies page.

As a workaround, I am currently adding the file twice just to get it building. e.g.

Code:

<SettingFile Include="common.xml" />
<None Include="common.xml">
    <Visible>False</Visible>
</None>


Is there any way to specify a list of custom Items which NCrunch should copy over ? That would be really useful in avoid all this duplication.

Thanks.
Remco
#2 Posted : Thursday, May 14, 2015 10:01:57 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi,

There isn't any way to change the list of item types that are identified by NCrunch (this is hard-coded), but if the files have a common extension or placement, you should be able to use the additional files to include option to make NCrunch aware of them.

You can also try adding the following to your project file. It is somewhat easier to manage than manually adding each file twice:

<ItemGroup Condition="'$(NCrunch)' == '1'">
<Content Include="@(SettingsFile)" />
</ItemGroup>
nayan
#3 Posted : Friday, May 15, 2015 1:49:23 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/14/2015(UTC)
Posts: 4
Location: United States of America

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
Hi Remco,

Thanks for the quick reply.

Yes, it's possible to conditionally include the files but this quickly gets out of hand if there are different types of such custom items.

The information is already present in the csproj and it builds using MSBuild. So I feel it would be cleaner if we could specify such a list of custom items in project-level configuration file. Would this be a feasible feature request ?


For context, the scenario is coming up with some shared logic to be used by other teams. They have the freedom to add build targets, so I don't control the list of such custom items. Having a configurable list sounds easier than asking them to make sure to include the file in None or Content.
Remco
#4 Posted : Friday, May 15, 2015 3:10:58 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
nayan;7334 wrote:

For context, the scenario is coming up with some shared logic to be used by other teams. They have the freedom to add build targets, so I don't control the list of such custom items. Having a configurable list sounds easier than asking them to make sure to include the file in None or Content.


This makes really good sense, and it's a good reason to request such a feature. I'm afraid that my priorities are a little tied according to demand for features like this, but you're very welcome to make a formal request for it if you like.
1 user thanked Remco for this useful post.
nayan on 5/15/2015(UTC)
nayan
#5 Posted : Friday, May 15, 2015 4:59:52 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/14/2015(UTC)
Posts: 4
Location: United States of America

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
Thanks.

Posted the request here - https://ncrunch.uservoic...m-itemgroups-to-be-copie
1 user thanked nayan for this useful post.
Remco on 5/15/2015(UTC)
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.037 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download