-
Notifications
You must be signed in to change notification settings - Fork 654
Fix GitVersionTask on Linux #1177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this. I only have a couple of questions I would appreciate to have answered. 😃 It would be good to have the Travis build green as well. I haven't looked at why it's failing.
@@ -9,6 +9,7 @@ | |||
<GitVersionPath Condition="'$(GitVersionPath)' == ''">$(MSBuildProjectDirectory)</GitVersionPath> | |||
<GitVersionCustomizeTargetFile Condition="'$(GitVersionCustomizeTargetFile)' == '' And Exists('$(MSBuildProjectDirectory)\GitVersionTask.targets')">$(SolutionDir)\GitVersionTask.targets</GitVersionCustomizeTargetFile> | |||
<GitVersionCustomizeTargetFile Condition="'$(GitVersionCustomizeTargetFile)' == '' And '$(SolutionDir)' != '' And Exists('$(SolutionDir)\GitVersionTask.targets')">$(SolutionDir)\GitVersionTask.targets</GitVersionCustomizeTargetFile> | |||
<GitVersionCustomizeTargetFile Condition="'$(GitVersionCustomizeTargetFile)' == ''">*Undefined*</GitVersionCustomizeTargetFile> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've never seen *Undefined*
used as a placeholder in MSBuild before. Won't an empty element initialise the property to an empty string?
@@ -9,6 +9,7 @@ | |||
<GitVersionPath Condition="'$(GitVersionPath)' == ''">$(MSBuildProjectDirectory)</GitVersionPath> | |||
<GitVersionCustomizeTargetFile Condition="'$(GitVersionCustomizeTargetFile)' == '' And Exists('$(MSBuildProjectDirectory)\GitVersionTask.targets')">$(SolutionDir)\GitVersionTask.targets</GitVersionCustomizeTargetFile> | |||
<GitVersionCustomizeTargetFile Condition="'$(GitVersionCustomizeTargetFile)' == '' And '$(SolutionDir)' != '' And Exists('$(SolutionDir)\GitVersionTask.targets')">$(SolutionDir)\GitVersionTask.targets</GitVersionCustomizeTargetFile> | |||
<GitVersionCustomizeTargetFile Condition="'$(GitVersionCustomizeTargetFile)' == ''">*Undefined*</GitVersionCustomizeTargetFile> | |||
<IntermediateOutputPath Condition="$(IntermediateOutputPath) == '' Or $(IntermediateOutputPath) == '*Undefined*'">$(MSBuildProjectDirectory)\obj\$(Configuration)\</IntermediateOutputPath> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see *Undefined*
is used here too and I honestly haven't noticed it before. Seems like @SimonCropp added it in ec6e369. Is this normal MSBuild nomenclature?
@@ -9,6 +9,7 @@ | |||
<GitVersionPath Condition="'$(GitVersionPath)' == ''">$(MSBuildProjectDirectory)</GitVersionPath> | |||
<GitVersionCustomizeTargetFile Condition="'$(GitVersionCustomizeTargetFile)' == '' And Exists('$(MSBuildProjectDirectory)\GitVersionTask.targets')">$(SolutionDir)\GitVersionTask.targets</GitVersionCustomizeTargetFile> | |||
<GitVersionCustomizeTargetFile Condition="'$(GitVersionCustomizeTargetFile)' == '' And '$(SolutionDir)' != '' And Exists('$(SolutionDir)\GitVersionTask.targets')">$(SolutionDir)\GitVersionTask.targets</GitVersionCustomizeTargetFile> | |||
<GitVersionCustomizeTargetFile Condition="'$(GitVersionCustomizeTargetFile)' == ''">*Undefined*</GitVersionCustomizeTargetFile> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
@@ -39,7 +40,7 @@ | |||
TaskName="GitVersionTask.WriteVersionInfoToBuildLog" | |||
AssemblyFile="$(GitVersionTaskLibrary)GitVersionTask.dll" /> | |||
|
|||
<Import Project="$(GitVersionCustomizeTargetFile)" Condition="'$(GitVersionCustomizeTargetFile)' != '' and Exists($(GitVersionCustomizeTargetFile))" /> | |||
<Import Project="$(GitVersionCustomizeTargetFile)" Condition="'$(GitVersionCustomizeTargetFile)' != '' and Exists('$(GitVersionCustomizeTargetFile)')" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you have to check for *Undefined*
here as well?
@@ -37,7 +38,7 @@ | |||
TaskName="GitVersionTask.WriteVersionInfoToBuildLog" | |||
AssemblyFile="$(GitVersionTaskLibrary)GitVersionTask.dll" /> | |||
|
|||
<Import Project="$(GitVersionCustomizeTargetFile)" Condition="'$(GitVersionCustomizeTargetFile)' != '' and Exists($(GitVersionCustomizeTargetFile))" /> | |||
<Import Project="$(GitVersionCustomizeTargetFile)" Condition="'$(GitVersionCustomizeTargetFile)' != '' and Exists('$(GitVersionCustomizeTargetFile)')" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you have to check for *Undefined*
here as well?
The travis build failures don't look like they are related to this change. Review status: 0 of 2 files reviewed at latest revision, 5 unresolved discussions, some commit checks failed. src/GitVersionTask/NugetAssets/build/GitVersionTask.targets, line 12 at r1 (raw file): Previously, asbjornu (Asbjørn Ulsberg) wrote…
You're right. I didn't think that it would work, but it does! Done. src/GitVersionTask/NugetAssets/build/GitVersionTask.targets, line 13 at r1 (raw file): Previously, asbjornu (Asbjørn Ulsberg) wrote…
I've occasionally seen it in Conditions, but I don't know if it will actually ever have this value (unless explicitly set to it 😃 ) src/GitVersionTask/NugetAssets/buildMultiTargeting/GitVersionTask.targets, line 12 at r1 (raw file): Previously, asbjornu (Asbjørn Ulsberg) wrote…
Done. Comments from Reviewable |
The additional import statement introduced in #1163 causes failure on Linux when a project tries to use the GitVersionTask. It seems that Mono can't cope with an empty `Project` attribute in the `Import` element. Additionally there seems to be a bug at least in Mono 3.x in that it requires the argument in `Exists` to be passed in quotes. This change fixes these two problems and allows to use the GitVersionTask again on Linux.
The additional import statement introduced in #1163 causes failure
on Linux when a project tries to use the GitVersionTask. It seems
that Mono can't cope with an empty
Project
attribute in theImport
element. Additionally there seems to be a bug at least inMono 3.x in that it requires the argument in
Exists
to be passedin quotes.
This change fixes these two problems and allows to use the
GitVersionTask again on Linux.
I'd appreciate if a Beta-12 with this fix could be released soon.