Skip to content

Commit

Permalink
Add GitVersion_NoNormalizeEnabled property for GitVersionTask
Browse files Browse the repository at this point in the history
  • Loading branch information
chuseman authored and arturcic committed Nov 22, 2019
1 parent fd6ba11 commit 76d4b1f
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 20 deletions.
2 changes: 2 additions & 0 deletions src/GitVersionTask.MsBuild/GitVersionTaskBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@ public abstract class GitVersionTaskBase : Task
public string ConfigFilePath { get; set; }

public bool NoFetch { get; set; }

public bool NoNormalize { get; set; }
}
}
3 changes: 2 additions & 1 deletion src/GitVersionTask/GitVersionTasks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ private static IServiceProvider BuildServiceProvider(GitVersionTaskBase task)
{
TargetPath = task.SolutionDirectory,
ConfigFile = task.ConfigFilePath,
NoFetch = task.NoFetch
NoFetch = task.NoFetch,
NoNormalize = task.NoNormalize
};

services.AddSingleton(_ => Options.Create(arguments));
Expand Down
1 change: 1 addition & 0 deletions src/GitVersionTask/build/GitVersionTask.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<GitVersionPath Condition="'$(GitVersionPath)' == ''">$(MSBuildProjectDirectory)</GitVersionPath>

<GitVersion_NoFetchEnabled Condition="$(GitVersion_NoFetchEnabled) == ''">false</GitVersion_NoFetchEnabled>
<GitVersion_NoNormalizeEnabled Condition="$(GitVersion_NoNormalizeEnabled) == ''">false</GitVersion_NoNormalizeEnabled>

<DisableGitVersionTask Condition=" '$(DisableGitVersionTask)' == '' ">false</DisableGitVersionTask>

Expand Down
40 changes: 23 additions & 17 deletions src/GitVersionTask/build/GitVersionTask.targets
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,23 @@

<Target Name="WriteVersionInfoToBuildLog" BeforeTargets="CoreCompile;GetAssemblyVersion;GenerateNuspec" Condition="$(WriteVersionInfoToBuildLog) == 'true'">

<WriteVersionInfoToBuildLog SolutionDirectory="$(GitVersionPath)" ConfigFilePath="$(GitVersionConfig)" NoFetch="$(GitVersion_NoFetchEnabled)"/>
<WriteVersionInfoToBuildLog SolutionDirectory="$(GitVersionPath)"
ConfigFilePath="$(GitVersionConfig)"
NoFetch="$(GitVersion_NoFetchEnabled)"
NoNormalize="$(GitVersion_NoNormalizeEnabled)" />

</Target>

<Target Name="UpdateAssemblyInfo" BeforeTargets="CoreCompile" Condition="$(UpdateAssemblyInfo) == 'true'">

<UpdateAssemblyInfo
SolutionDirectory="$(GitVersionPath)"
ConfigFilePath="$(GitVersionConfig)"
NoFetch="$(GitVersion_NoFetchEnabled)"
ProjectFile="$(MSBuildProjectFullPath)"
IntermediateOutputPath="$(IntermediateOutputPath)"
Language="$(Language)"
CompileFiles ="@(Compile)">
<UpdateAssemblyInfo SolutionDirectory="$(GitVersionPath)"
ConfigFilePath="$(GitVersionConfig)"
NoFetch="$(GitVersion_NoFetchEnabled)"
NoNormalize="$(GitVersion_NoNormalizeEnabled)"
ProjectFile="$(MSBuildProjectFullPath)"
IntermediateOutputPath="$(IntermediateOutputPath)"
Language="$(Language)"
CompileFiles ="@(Compile)">

<Output TaskParameter="AssemblyInfoTempFilePath" PropertyName="AssemblyInfoTempFilePath" />
</UpdateAssemblyInfo>
Expand All @@ -36,13 +39,13 @@

<Target Name="GenerateGitVersionInformation" BeforeTargets="CoreCompile" Condition="$(GenerateGitVersionInformation) == 'true'">

<GenerateGitVersionInformation
SolutionDirectory="$(GitVersionPath)"
ConfigFilePath="$(GitVersionConfig)"
NoFetch="$(GitVersion_NoFetchEnabled)"
ProjectFile="$(MSBuildProjectFullPath)"
IntermediateOutputPath="$(IntermediateOutputPath)"
Language="$(Language)">
<GenerateGitVersionInformation SolutionDirectory="$(GitVersionPath)"
ConfigFilePath="$(GitVersionConfig)"
NoFetch="$(GitVersion_NoFetchEnabled)"
NoNormalize="$(GitVersion_NoNormalizeEnabled)"
ProjectFile="$(MSBuildProjectFullPath)"
IntermediateOutputPath="$(IntermediateOutputPath)"
Language="$(Language)">

<Output TaskParameter="GitVersionInformationFilePath" PropertyName="GitVersionInformationFilePath" />
</GenerateGitVersionInformation>
Expand All @@ -59,7 +62,10 @@

<Target Name="GetVersion" BeforeTargets="CoreCompile;GetAssemblyVersion;GenerateNuspec;_GenerateRestoreProjectSpec;_GetOutputItemsFromPack;EnsureWixToolsetInstalled" Condition="$(GetVersion) == 'true'">

<GetVersion SolutionDirectory="$(GitVersionPath)" ConfigFilePath="$(GitVersionConfig)" NoFetch="$(GitVersion_NoFetchEnabled)">
<GetVersion SolutionDirectory="$(GitVersionPath)"
ConfigFilePath="$(GitVersionConfig)"
NoFetch="$(GitVersion_NoFetchEnabled)"
NoNormalize="$(GitVersion_NoNormalizeEnabled)">
<Output TaskParameter="Major" PropertyName="GitVersion_Major" />
<Output TaskParameter="Minor" PropertyName="GitVersion_Minor" />
<Output TaskParameter="Patch" PropertyName="GitVersion_Patch" />
Expand Down
10 changes: 8 additions & 2 deletions src/GitVersionTask/buildMultiTargeting/GitVersionTask.targets
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
<UsingTask TaskName="WriteVersionInfoToBuildLog" AssemblyFile="$(GitVersionAssemblyFile)" />

<Target Name="WriteVersionInfoToBuildLog" BeforeTargets="CoreCompile;GetAssemblyVersion;GenerateNuspec" Condition="$(WriteVersionInfoToBuildLog) == 'true'">
<WriteVersionInfoToBuildLog SolutionDirectory="$(GitVersionPath)" ConfigFilePath="$(GitVersionConfig)" NoFetch="$(GitVersion_NoFetchEnabled)"/>
<WriteVersionInfoToBuildLog SolutionDirectory="$(GitVersionPath)"
ConfigFilePath="$(GitVersionConfig)"
NoFetch="$(GitVersion_NoFetchEnabled)"
NoNormalize="$(GitVersion_NoNormalizeEnabled)" />
</Target>

<Target Name="UpdateAssemblyInfo" DependsOnTargets="_UpdateAssemblyInfo;DispatchToInnerBuilds" />
Expand All @@ -22,7 +25,10 @@
</Target>

<Target Name="GetVersion" BeforeTargets="CoreCompile;GetAssemblyVersion;GenerateNuspec;_GenerateRestoreProjectSpec;EnsureWixToolsetInstalled" Condition="$(GetVersion) == 'true'">
<GetVersion SolutionDirectory="$(GitVersionPath)" ConfigFilePath="$(GitVersionConfig)" NoFetch="$(GitVersion_NoFetchEnabled)">
<GetVersion SolutionDirectory="$(GitVersionPath)"
ConfigFilePath="$(GitVersionConfig)"
NoFetch="$(GitVersion_NoFetchEnabled)"
NoNormalize="$(GitVersion_NoNormalizeEnabled)">
<Output TaskParameter="Major" PropertyName="GitVersion_Major" />
<Output TaskParameter="Minor" PropertyName="GitVersion_Minor" />
<Output TaskParameter="Patch" PropertyName="GitVersion_Patch" />
Expand Down

0 comments on commit 76d4b1f

Please sign in to comment.