-
Notifications
You must be signed in to change notification settings - Fork 654
Inject into correct point in build pipeline for VS 2017 #1119
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,8 +8,13 @@ | |
<!-- Property that enables WriteVersionInfoToBuildLog --> | ||
<WriteVersionInfoToBuildLog Condition=" '$(WriteVersionInfoToBuildLog)' == '' ">true</WriteVersionInfoToBuildLog> | ||
|
||
<!-- Property that enables UpdateAssemblyInfo --> | ||
<!-- Property that enables UpdateAssemblyInfo. Default to off for SDK builds --> | ||
<UpdateAssemblyInfo Condition=" '$(UpdateAssemblyInfo)' == '' and '$(TargetFramework)' != '' ">false</UpdateAssemblyInfo> | ||
<UpdateAssemblyInfo Condition=" '$(UpdateAssemblyInfo)' == '' ">true</UpdateAssemblyInfo> | ||
|
||
<!-- Property that enables setting of Version --> | ||
<UpdateVersionProperties Condition=" '$(UpdateVersionProperties)' == '' ">true</UpdateVersionProperties> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would be nice if these properties can be documented here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will update the docs now |
||
<UseFullSemVerForNuGet Condition=" '$(UseFullSemVerForNuGet)' == '' ">false</UseFullSemVerForNuGet> | ||
|
||
<!-- Property that enables GetVersion --> | ||
<GetVersion Condition=" '$(GetVersion)' == '' ">true</GetVersion> | ||
|
@@ -27,7 +32,7 @@ | |
TaskName="GitVersionTask.WriteVersionInfoToBuildLog" | ||
AssemblyFile="$(GitVersionTaskLibrary)GitVersionTask.dll" /> | ||
|
||
<Target Name="WriteVersionInfoToBuildLog" BeforeTargets="CoreCompile" Condition="$(WriteVersionInfoToBuildLog) == 'true'"> | ||
<Target Name="WriteVersionInfoToBuildLog" BeforeTargets="CoreCompile;GetAssemblyVersion;GenerateNuspec" Condition="$(WriteVersionInfoToBuildLog) == 'true'"> | ||
<WriteVersionInfoToBuildLog SolutionDirectory="$(SolutionDir)" NoFetch="$(GitVersion_NoFetchEnabled)"/> | ||
</Target> | ||
|
||
|
@@ -49,7 +54,7 @@ | |
</ItemGroup> | ||
</Target> | ||
|
||
<Target Name="GetVersion" BeforeTargets="CoreCompile" Condition="$(GetVersion) == 'true'"> | ||
<Target Name="GetVersion" BeforeTargets="CoreCompile;GetAssemblyVersion;GenerateNuspec" Condition="$(GetVersion) == 'true'"> | ||
|
||
<GetVersion SolutionDirectory="$(SolutionDir)" NoFetch="$(GitVersion_NoFetchEnabled)"> | ||
<Output TaskParameter="Major" PropertyName="GitVersion_Major" /> | ||
|
@@ -77,6 +82,18 @@ | |
<Output TaskParameter="CommitsSinceVersionSource" PropertyName="GitVersion_CommitsSinceVersionSource" /> | ||
<Output TaskParameter="CommitsSinceVersionSourcePadded" PropertyName="GitVersion_CommitsSinceVersionSourcePadded" /> | ||
</GetVersion> | ||
|
||
<PropertyGroup Condition=" '$(UpdateVersionProperties)' == 'true' "> | ||
<Version>$(GitVersion_FullSemVer)</Version> | ||
<VersionPrefix>$(GitVersion_MajorMinorPatch)</VersionPrefix> | ||
<VersionSuffix Condition=" '$(UseFullSemVerForNuGet)' == 'false' ">$(GitVersion_NuGetPreReleaseTag)</VersionSuffix> | ||
<VersionSuffix Condition=" '$(UseFullSemVerForNuGet)' == 'true' ">$(GitVersion_PreReleaseTag)</VersionSuffix> | ||
<PackageVersion Condition=" '$(UseFullSemVerForNuGet)' == 'false' ">$(GitVersion_NuGetVersion)</PackageVersion> | ||
<PackageVersion Condition=" '$(UseFullSemVerForNuGet)' == 'true' ">$(GitVersion_FullSemVer)</PackageVersion> | ||
<InformationalVersion Condition=" '$(InformationalVersion)' == '' ">$(GitVersion_InformationalVersion)</InformationalVersion> | ||
<AssemblyVersion Condition=" '$(AssemblyVersion)' == '' ">$(GitVersion_AssemblySemVer)</AssemblyVersion> | ||
<FileVersion Condition=" '$(FileVersion)' == '' ">$(GitVersion_MajorMinorPatch).$(GitVersion_CommitsSinceVersionSource)</FileVersion> | ||
</PropertyGroup> | ||
|
||
</Target> | ||
|
||
|
@@ -93,6 +110,4 @@ | |
</None> | ||
</ItemGroup> | ||
|
||
</Project> | ||
|
||
|
||
</Project> |
79 changes: 79 additions & 0 deletions
79
src/GitVersionTask/NugetAssets/buildMultiTargeting/GitVersionTask.targets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir> | ||
<GitVersion_NoFetchEnabled Condition="$(GitVersion_NoFetchEnabled) == ''">false</GitVersion_NoFetchEnabled> | ||
|
||
<!-- Property that enables WriteVersionInfoToBuildLog --> | ||
<WriteVersionInfoToBuildLog Condition=" '$(WriteVersionInfoToBuildLog)' == '' ">true</WriteVersionInfoToBuildLog> | ||
|
||
<!-- Property that enables UpdateAssemblyInfo. Default to off for SDK builds --> | ||
<UpdateAssemblyInfo Condition=" '$(UpdateAssemblyInfo)' == '' and '$(TargetFramework)' != '' ">false</UpdateAssemblyInfo> | ||
<UpdateAssemblyInfo Condition=" '$(UpdateAssemblyInfo)' == '' ">true</UpdateAssemblyInfo> | ||
|
||
<GetVersion Condition=" '$(GetVersion)' == '' ">true</GetVersion> | ||
|
||
<!-- Property that enables setting of Version --> | ||
<UpdateVersionProperties Condition=" '$(UpdateVersionProperties)' == '' ">true</UpdateVersionProperties> | ||
<UseFullSemVerForNuGet Condition=" '$(UseFullSemVerForNuGet)' == '' ">false</UseFullSemVerForNuGet> | ||
|
||
<GitVersionTaskLibrary>$(MSBuildThisFileDirectory)..\build\</GitVersionTaskLibrary> | ||
</PropertyGroup> | ||
|
||
<UsingTask | ||
TaskName="GitVersionTask.UpdateAssemblyInfo" | ||
AssemblyFile="$(GitVersionTaskLibrary)GitVersionTask.dll" /> | ||
<UsingTask | ||
TaskName="GitVersionTask.GetVersion" | ||
AssemblyFile="$(GitVersionTaskLibrary)GitVersionTask.dll" /> | ||
<UsingTask | ||
TaskName="GitVersionTask.WriteVersionInfoToBuildLog" | ||
AssemblyFile="$(GitVersionTaskLibrary)GitVersionTask.dll" /> | ||
|
||
<Target Name="WriteVersionInfoToBuildLog" BeforeTargets="DispatchToInnerBuilds;GenerateNuspec" Condition="$(WriteVersionInfoToBuildLog) == 'true'"> | ||
<WriteVersionInfoToBuildLog SolutionDirectory="$(SolutionDir)" NoFetch="$(GitVersion_NoFetchEnabled)"/> | ||
</Target> | ||
|
||
<Target Name="GetVersion" BeforeTargets="DispatchToInnerBuilds;GenerateNuspec" Condition="$(GetVersion) == 'true'"> | ||
|
||
<GetVersion SolutionDirectory="$(SolutionDir)" NoFetch="$(GitVersion_NoFetchEnabled)"> | ||
<Output TaskParameter="Major" PropertyName="GitVersion_Major" /> | ||
<Output TaskParameter="Minor" PropertyName="GitVersion_Minor" /> | ||
<Output TaskParameter="Patch" PropertyName="GitVersion_Patch" /> | ||
<Output TaskParameter="BuildMetaData" PropertyName="GitVersion_BuildMetaData" /> | ||
<Output TaskParameter="BuildMetaDataPadded" PropertyName="GitVersion_BuildMetaDataPadded" /> | ||
<Output TaskParameter="FullBuildMetaData" PropertyName="GitVersion_FullBuildMetaData" /> | ||
<Output TaskParameter="BranchName" PropertyName="GitVersion_BranchName" /> | ||
<Output TaskParameter="Sha" PropertyName="GitVersion_Sha" /> | ||
<Output TaskParameter="MajorMinorPatch" PropertyName="GitVersion_MajorMinorPatch" /> | ||
<Output TaskParameter="SemVer" PropertyName="GitVersion_SemVer" /> | ||
<Output TaskParameter="LegacySemVer" PropertyName="GitVersion_LegacySemVer" /> | ||
<Output TaskParameter="LegacySemVerPadded" PropertyName="GitVersion_LegacySemVerPadded" /> | ||
<Output TaskParameter="FullSemVer" PropertyName="GitVersion_FullSemVer" /> | ||
<Output TaskParameter="AssemblySemVer" PropertyName="GitVersion_AssemblySemVer" /> | ||
<Output TaskParameter="NuGetVersion" PropertyName="GitVersion_NuGetVersion" /> | ||
<Output TaskParameter="NuGetPreReleaseTag" PropertyName="GitVersion_NuGetPreReleaseTag" /> | ||
<Output TaskParameter="PreReleaseTag" PropertyName="GitVersion_PreReleaseTag" /> | ||
<Output TaskParameter="PreReleaseTagWithDash" PropertyName="GitVersion_PreReleaseTagWithDash" /> | ||
<Output TaskParameter="PreReleaseLabel" PropertyName="GitVersion_PreReleaseLabel" /> | ||
<Output TaskParameter="PreReleaseNumber" PropertyName="GitVersion_PreReleaseNumber" /> | ||
<Output TaskParameter="InformationalVersion" PropertyName="GitVersion_InformationalVersion" /> | ||
<Output TaskParameter="CommitDate" PropertyName="GitVersion_CommitDate" /> | ||
<Output TaskParameter="CommitsSinceVersionSource" PropertyName="GitVersion_CommitsSinceVersionSource" /> | ||
<Output TaskParameter="CommitsSinceVersionSourcePadded" PropertyName="GitVersion_CommitsSinceVersionSourcePadded" /> | ||
</GetVersion> | ||
|
||
<PropertyGroup Condition=" '$(UpdateVersionProperties)' == 'true' "> | ||
<Version>$(GitVersion_FullSemVer)</Version> | ||
<VersionPrefix>$(GitVersion_MajorMinorPatch)</VersionPrefix> | ||
<VersionSuffix Condition=" '$(UseFullSemVerForNuGet)' == 'false' ">$(GitVersion_NuGetPreReleaseTag)</VersionSuffix> | ||
<VersionSuffix Condition=" '$(UseFullSemVerForNuGet)' == 'true' ">$(GitVersion_PreReleaseTag)</VersionSuffix> | ||
<PackageVersion Condition=" '$(UseFullSemVerForNuGet)' == 'false' ">$(GitVersion_NuGetVersion)</PackageVersion> | ||
<PackageVersion Condition=" '$(UseFullSemVerForNuGet)' == 'true' ">$(GitVersion_FullSemVer)</PackageVersion> | ||
<InformationalVersion Condition=" '$(InformationalVersion)' == '' ">$(GitVersion_InformationalVersion)</InformationalVersion> | ||
<AssemblyVersion Condition=" '$(AssemblyVersion)' == '' ">$(GitVersion_AssemblySemVer)</AssemblyVersion> | ||
<FileVersion Condition=" '$(FileVersion)' == '' ">$(GitVersion_MajorMinorPatch).$(GitVersion_CommitsSinceVersionSource)</FileVersion> | ||
</PropertyGroup> | ||
|
||
</Target> | ||
</Project> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Shouldn't the file NugetAssets\GitVersionTask.targets be deleted?
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.
it was moved into the build folder
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.
Ah, missed this :)