Skip to content
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

Exopose NoNormalize property for GitVersionTask #1929

Merged
merged 1 commit into from
Nov 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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