Skip to content

Commit 531f7b6

Browse files
committed
Merge remote-tracking branch 'origin/master' into BuildNumberFromVersionJson
2 parents 8f77eda + 14d6ff9 commit 531f7b6

19 files changed

+412
-81
lines changed

appveyor.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 99.0.{build}
1+
version: '{build}'
22
skip_tags: true
33
os: Visual Studio 2017
44
configuration: Release
@@ -22,6 +22,10 @@ before_build:
2222
build_script:
2323
- ps: >-
2424
.\build.ps1
25+
test:
26+
assemblies:
27+
only:
28+
- NerdBank.GitVersioning.Tests.dll
2529
artifacts:
2630
- path: bin\**\*.nupkg
2731
- path: bin\js\*.tgz

doc/nuget-acquisition.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,16 @@ NuGet Package Manager GUI, or the NuGet Package Manager Console:
77
Install-Package Nerdbank-GitVersioning
88
```
99

10+
If in a project that uses PackageReference for this package reference, you should manually add
11+
`PrivateAssets="all"` to the PackageReference xml element to workaround
12+
[this issue](https://github.com/AArnott/Nerdbank.GitVersioning/issues/122).
13+
1014
After installing this NuGet package, you may need to configure the version generation logic
1115
in order for it to work properly.
1216

13-
With NuGet 2.x, the configuration is handled automatically via the tools\Install.ps1 script.
14-
For NuGet 3.x, you can run the script tools\Create-VersionFile.ps1 to help you create the
15-
version.json file and remove the old assembly attributes.
17+
When using packagse.config, the configuration is handled automatically via the tools\Install.ps1 script.
18+
When using project.json or PackageReference, you can run the script tools\Create-VersionFile.ps1 to help
19+
you create the version.json file and remove the old assembly attributes.
1620

1721
The scripts will look for the presence of a version.json or version.txt file.
1822
If one already exists, nothing happens. If the version file does not exist,
@@ -35,14 +39,19 @@ source code, as commonly found in your `Properties\AssemblyInfo.cs` file:
3539
[assembly: AssemblyInformationalVersion("1.0.0-dev")]
3640
```
3741

42+
If you are using the new VS 2017 .NET Core/Standard projects (or otherwise using the .NET SDK project type)
43+
you won't see these attributes in your AssemblyInfo.cs file but you may still get compiler errors
44+
due to duplicate attributes. In that case, a Rebuild of your project should resolve
45+
[the issue](https://github.com/AArnott/Nerdbank.GitVersioning/issues/121).
46+
3847
This NuGet package creates these attributes at build time based on version information
3948
found in your `version.json` file and your git repo's HEAD position.
4049

4150
When the package is installed, a version.json file is created in your project directory
42-
(for NuGet 2.x clients). This ensures backwards compatibility where the installation of
51+
(for packages.config clients). This ensures backwards compatibility where the installation of
4352
this package will not cause the assembly version of the project to change. If you would
4453
like the same version number to be applied to all projects in the repo, then you may move
45-
the file to the root directory of your git repo.
54+
the version.json file to the root directory of your git repo.
4655

4756
Note: After first installing the package, you need to commit the version file so that
4857
it will be picked up during the build's version generation. If you build prior to committing,

src/Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<Project>
22
<PropertyGroup>
3+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
34
<BaseIntermediateOutputPath>$(MSBuildThisFileDirectory)..\obj\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
45
<OutputPath>$(MSBuildThisFileDirectory)..\bin\$(MSBuildProjectName)\$(Configuration)\</OutputPath>
56
</PropertyGroup>
Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<configuration>
3-
<runtime>
4-
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
5-
<dependentAssembly>
6-
<assemblyIdentity name="Validation" publicKeyToken="2fc06f0d701809a7" culture="neutral" />
7-
<bindingRedirect oldVersion="2.0.0.0" newVersion="2.3.0.0" />
8-
</dependentAssembly>
9-
</assemblyBinding>
10-
</runtime>
113
</configuration>

src/NerdBank.GitVersioning.Tests/NerdBank.GitVersioning.Tests.csproj

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net45</TargetFramework>
3+
<TargetFramework>net452</TargetFramework>
4+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
5+
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
6+
<DebugType>full</DebugType>
47
</PropertyGroup>
58
<ItemGroup>
69
<EmbeddedResource Include="..\Nerdbank.GitVersioning.NuGet\build\*.targets">
@@ -21,11 +24,14 @@
2124
<PackageReference Include="7z.NET" Version="1.0.3" />
2225
<PackageReference Include="Newtonsoft.Json.Schema" Version="2.0.11" />
2326
<PackageReference Include="System.Collections.Immutable" Version="1.3.1" />
24-
<PackageReference Include="Microsoft.Build" Version="14.3" Condition=" '$(TargetFramework)' == 'net45' " />
27+
<PackageReference Include="Microsoft.Build" Version="14.3" Condition=" '$(TargetFramework)' == 'net452' " />
2528
<PackageReference Include="Xunit.Combinatorial" Version="1.1.12" />
26-
<PackageReference Include="xunit" Version="2.1.0" />
29+
<PackageReference Include="xunit" Version="2.2.0" />
2730
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="1.1.1" />
2831
<PackageReference Include="Nerdbank.GitVersioning.LKG" Version="1.6.20-beta-gfea83a8c9e" />
29-
<PackageReference Include="xunit.runner.visualstudio" Version="2.1.0" />
32+
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
33+
</ItemGroup>
34+
<ItemGroup>
35+
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
3036
</ItemGroup>
3137
</Project>

src/NerdBank.GitVersioning/NerdBank.GitVersioning.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<PropertyGroup>
33
<TargetFrameworks>netcoreapp1.0;net45</TargetFrameworks>
44
<GenerateDocumentationFile>true</GenerateDocumentationFile>
5+
<DebugType Condition=" '$(Configuration)' == 'debug' ">Full</DebugType>
56
</PropertyGroup>
67
<ItemGroup>
78
<PackageReference Include="LibGit2Sharp" Version="0.24.7-g9fca61fdda" />

src/Nerdbank.GitVersioning.NuGet/Nerdbank.GitVersioning.NuGet.nuproj

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,14 @@
5555
<NoneToContentPort Include="@(None)" Condition=" '%(None.CopyToOutputDirectory)' == 'PreserveNewest' " />
5656
<None Remove="@(NoneToContentPort)" />
5757
<Content Include="@(NoneToContentPort)">
58-
<Link>build\%(NoneToContentPort.Link)</Link>
58+
<Link>build\MSBuildFull\%(NoneToContentPort.Link)</Link>
5959
<CopyToOutputDirectory />
60-
<PackageDirectory>build</PackageDirectory>
60+
<PackageDirectory>build\MSBuildFull</PackageDirectory>
61+
</Content>
62+
<Content Include="@(NoneToContentPort)">
63+
<Link>build\MSBuildCore\%(NoneToContentPort.Link)</Link>
64+
<CopyToOutputDirectory />
65+
<PackageDirectory>build\MSBuildCore</PackageDirectory>
6166
</Content>
6267
</ItemGroup>
6368
</Target>
@@ -104,7 +109,8 @@
104109
<ItemGroup>
105110
<PackageFile Remove="@(PackageFile)" Condition="
106111
$([System.String]::new('%(TargetPath)').StartsWith('build\')) and
107-
!$([System.String]::new('%(TargetPath)').StartsWith('build\lib\')) and
112+
!$([System.String]::new('%(TargetPath)').StartsWith('build\MSBuildFull\lib\')) and
113+
!$([System.String]::new('%(TargetPath)').StartsWith('build\MSBuildCore\lib\')) and
108114
'%(FileName)' != 'NerdBank.GitVersioning' and
109115
'%(FileName)' != 'NerdBank.GitVersioning.Tasks' and
110116
'%(FileName)' != 'MSBuildExtensionTask' and

src/Nerdbank.GitVersioning.NuGet/build/Nerdbank.GitVersioning.targets

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
33
<PropertyGroup>
4+
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
45
<VersionSourceFile>$(IntermediateOutputPath)\$(AssemblyName).Version$(DefaultLanguageSourceExtension)</VersionSourceFile>
56

67
<PrepareResourcesDependsOn>
@@ -140,7 +141,7 @@
140141
AssemblyConfiguration="$(Configuration)"
141142
EmitNonVersionCustomAttributes="$(NBGV_EmitNonVersionCustomAttributes)"
142143
/>
143-
<!-- Avoid applying the newly generated AssemblyVersionInfo.cs file to the build
144+
<!-- Avoid applying the newly generated AssemblyVersionInfo.cs file to the build
144145
unless it has changed in order to allow for incremental building. -->
145146
<Nerdbank.GitVersioning.Tasks.CompareFiles OriginalItems="$(VersionSourceFile)" NewItems="$(NewVersionSourceFile)">
146147
<Output TaskParameter="AreChanged" PropertyName="AssemblyVersionInfoChanged" />

src/Nerdbank.GitVersioning.NuGet/tools/Get-CommitId.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ $null = [Reflection.Assembly]::LoadFile((Resolve-Path "$DependencyBasePath\Valid
2727
$null = [Reflection.Assembly]::LoadFile((Resolve-Path "$DependencyBasePath\NerdBank.GitVersioning.dll"))
2828
$null = [Reflection.Assembly]::LoadFile((Resolve-Path "$DependencyBasePath\LibGit2Sharp.dll"))
2929
$null = [Reflection.Assembly]::LoadFile((Resolve-Path "$DependencyBasePath\Newtonsoft.Json.dll"))
30-
[Nerdbank.GitVersioning.GitExtensions]::HelpFindLibGit2NativeBinaries("$DependencyBasePath\..")
30+
[Nerdbank.GitVersioning.GitExtensions]::HelpFindLibGit2NativeBinaries($DependencyBasePath)
3131

3232
$ProjectDirectory = (Resolve-Path $ProjectDirectory).ProviderPath
3333
$GitPath = $ProjectDirectory

src/Nerdbank.GitVersioning.NuGet/tools/Get-Version.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ $null = [Reflection.Assembly]::LoadFile((Resolve-Path "$DependencyBasePath\Newto
1919
$ProjectDirectory = (Resolve-Path $ProjectDirectory).ProviderPath
2020

2121
try {
22-
[Nerdbank.GitVersioning.GitExtensions]::HelpFindLibGit2NativeBinaries("$DependencyBasePath\..")
22+
[Nerdbank.GitVersioning.GitExtensions]::HelpFindLibGit2NativeBinaries($DependencyBasePath)
2323
$CloudBuild = [Nerdbank.GitVersioning.CloudBuild]::Active
2424
$VersionOracle = [Nerdbank.GitVersioning.VersionOracle]::Create($ProjectDirectory, $null, $CloudBuild)
2525
$VersionOracle

0 commit comments

Comments
 (0)