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

Notification

Icon
Error

GitVersion.MSBuild error
Tim Long
#1 Posted : Tuesday, January 12, 2021 11:48:22 PM(UTC)
Rank: Member

Groups: Registered
Joined: 8/20/2016(UTC)
Posts: 20
Location: United Kingdom

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
I have recently migrated from GitVersion.Task to GitVersion.MSBuild (the former being deprecated) and now I'm getting this build error:

Quote:

C:\Users\Tim\.nuget\packages\gitversion.msbuild\5.6.3\tools\GitVersion.MsBuild.targets: The command "C:\Users\Tim\.nuget\packages\gitversion.msbuild\5.6.3\tools\net48/gitversion.exe C:\Users\Tim\AppData\Local\NCrunch\12004\2\TA.Ascom.ReactiveCommunications -output file -outputfile obj\/gitversion.json" exited with code 1.


I'm thinking that's mostly a GitVersion problem, however I do have DisableGitVersionTask = True in my build properties, so it probably shouldn't even be running. I'm not sure if the name of the property needs to change or what?

--Tim
Remco
#2 Posted : Tuesday, January 12, 2021 11:56:08 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 810 times
Was thanked: 1077 time(s) in 1022 post(s)
Hi Tim,

Unfortunately I have no experience with this package, but my guess would be that it has a dependency on something that isn't being copied to the NCrunch workspace.

You might be able to get this working by adding obj\gitversion.json to NCrunch's additional files to include setting.

Otherwise, I would recommend taking a look at the GitVersion.MsBuild.targets file for more information on which properties may be used to suppress its behaviour.
Tim Long
#3 Posted : Wednesday, January 13, 2021 12:14:30 AM(UTC)
Rank: Member

Groups: Registered
Joined: 8/20/2016(UTC)
Posts: 20
Location: United Kingdom

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
Remco;15242 wrote:

You might be able to get this working by adding obj\gitversion.json to NCrunch's additional files to include setting.


Let me clarify. I believe that GitVersion is _generating_ that file, not looking for it. The error is that its a malformed path (that part is the GitVersion problem).

Correction: on further investigation it's because it can't find the Git repository. I guess I could have NCrunch include the .git directory but what would be even better if to be able to prevent the task from running, like it used to be with GitVersion.Task.

-Tim
Remco
#5 Posted : Wednesday, January 13, 2021 12:31:07 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 810 times
Was thanked: 1077 time(s) in 1022 post(s)
Tim Long;15243 wrote:

Let me clarify. I believe that GitVersion is _generating_ that file, not looking for it. The error is that its a malformed path (that part is the GitVersion problem).


Understood. In this case, it may be enough to simply create an empty text file inside the 'obj' directory, then include this file in NCrunch's additional files to include setting. This will force NCrunch to create the directory inside the workspace, hopefully allowing the task to run without problems.

Tim Long;15243 wrote:

What I see as potentially an NCrunch problem is that I can't prevent it from running by setting IgnoreGitVersionTask=True like I used to be able to.


Presently, NCrunch has no build integration with this git package. This means that any configuration settings used to suppress the package are specific to the package itself and are not under our control. Usually, a quick look at the targets inside the package can reveal a way to suppress the targets.
1 user thanked Remco for this useful post.
Tim Long on 1/13/2021(UTC)
Remco
#4 Posted : Wednesday, January 13, 2021 12:42:17 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 810 times
Was thanked: 1077 time(s) in 1022 post(s)
Tim Long;15243 wrote:

Correction: on further investigation it's because it can't find the Git repository. I guess I could have NCrunch include the .git directory but what would be even better if to be able to prevent the task from running, like it used to be with GitVersion.Task.


From the NCrunch side, all we really do is pass properties into the build. From there, it's up to the package as to how it deals with these properties.

I've just done a quick review of this package. It looks to be quite new, with only around 600 downloads. The mechanism it uses to disable itself seems to work through a chain of properties that appears quite complicated and I'm not entirely sure whether it works correctly. It's quite possible that your intended off switch just won't work on this package. I would recommend including the 'obj' directory or trying a different system/package.
Tim Long
#6 Posted : Wednesday, January 13, 2021 12:47:35 AM(UTC)
Rank: Member

Groups: Registered
Joined: 8/20/2016(UTC)
Posts: 20
Location: United Kingdom

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
I got my build to work by including the .git folder. It's not ideal but its good enough :)
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.053 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download