Skip to content
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
1 change: 1 addition & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<PackageVersion_JetBrainsAnnotations>2019.1.3</PackageVersion_JetBrainsAnnotations>
<PackageVersion_YamlDotNet>8.1.0</PackageVersion_YamlDotNet>
<PackageVersion_NewtonsoftJson>12.0.3</PackageVersion_NewtonsoftJson>
<PackageVersion_MicrosoftExtensions>3.0.0</PackageVersion_MicrosoftExtensions>

<PackageVersion_MicrosoftTestSdk>16.5.0</PackageVersion_MicrosoftTestSdk>
<PackageVersion_NSubstitute>4.2.1</PackageVersion_NSubstitute>
Expand Down
4 changes: 2 additions & 2 deletions src/GitVersionCore.Tests/GitVersionCore.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<PackageReference Include="FluentDateTime" Version="2.0.0" />
<PackageReference Include="GitTools.Testing" Version="1.2.0" />
<PackageReference Include="LibGit2Sharp.NativeBinaries" Version="$(PackageVersion_LibGit2Sharp_NativeBinaries)" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.2" />
<PackageReference Include="Microsoft.Extensions.Options" Version="3.1.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="$(PackageVersion_MicrosoftExtensions)" />
<PackageReference Include="Microsoft.Extensions.Options" Version="$(PackageVersion_MicrosoftExtensions)" />
<PackageReference Include="YamlDotNet" Version="$(PackageVersion_YamlDotNet)" />
</ItemGroup>
<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/GitVersionCore/GitVersionCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<ItemGroup>
<PackageReference Include="LibGit2Sharp" Version="$(PackageVersion_LibGit2Sharp)" />
<PackageReference Include="JetBrains.Annotations" Version="$(PackageVersion_JetBrainsAnnotations)" PrivateAssets="All" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.2" />
<PackageReference Include="Microsoft.Extensions.Options" Version="3.1.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="$(PackageVersion_MicrosoftExtensions)" />
<PackageReference Include="Microsoft.Extensions.Options" Version="$(PackageVersion_MicrosoftExtensions)" />
<PackageReference Include="YamlDotNet" Version="$(PackageVersion_YamlDotNet)" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/GitVersionExe/GitVersionExe.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="3.1.2" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="$(PackageVersion_MicrosoftExtensions)" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/GitVersionTask.MsBuild/GitVersionTask.MsBuild.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<TargetFrameworks>net472;netstandard2.0</TargetFrameworks>
Copy link
Contributor

@dazinator dazinator Mar 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it was this that was the main part of the problem. This assembly needs to be cross compiled for full net framework and .net core, .net core msbuild ends up using the .net standard compiled one, and .net framework msbuild needs to use the full .net (net472) compiled version of the assembly - that's becuase in this assembly there is stuff like this:

  static TaskProxy()
        {
#if !NETFRAMEWORK
            GitLoaderContext.Init("GitVersionCore", "LibGit2Sharp");
#endif
            LibGit2SharpLoader.LoadAssembly("GitVersionTask");

If we only build the .net standard version of the binary to be used by both .net core and net framework msbuild variants, then it doesn't exhibit the correct dependency loading behaviours.

I had fixed this in my PR, but I broke other things when trying to refactor task proxy. I have decided to start my PR again from a clean branch off latest master, and I'll just do some more targetted fixes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm working now on adding some integration tests using msbuild and dotnet build to validate the GitVersionTask, when that is in place I think we can release, and you can use that for validating the refactoring you're doing. As for the support for preview builds of msbuild I think we need to handle that after this release,

<LangVersion>8.0</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/GitVersionTask.Tests/GitVersionTask.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="16.4.0" />
<PackageReference Include="LibGit2Sharp" Version="$(PackageVersion_LibGit2Sharp)" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="$(PackageVersion_MicrosoftExtensions)" />
</ItemGroup>
<ItemGroup>
<Content Include="Approved\**\*.txt" />
Expand Down
2 changes: 1 addition & 1 deletion src/GitVersionTask/GitVersionTask.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.2" PrivateAssets="All" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="$(PackageVersion_MicrosoftExtensions)" PrivateAssets="All" />
<PackageReference Include="LibGit2Sharp" Version="$(PackageVersion_LibGit2Sharp)" PrivateAssets="All" />
</ItemGroup>

Expand Down