Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Feb 3, 2023. It is now read-only.

Commit b4b620e

Browse files
committed
Load Native binaries from solution's package folder
We define a new MSBuild property, $(PackageDir) and look for the native binaries in there. This new property is based on $(SolutionDir) if that's defined. $(SolutionDir) is defined if you build with Visual Studio. If not, you need to pass it via msbuild.exe /p:SolutionDir=path
1 parent ac4c7d9 commit b4b620e

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

LibGit2Sharp/LibGit2Sharp.csproj

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="..\packages\LibGit2Sharp.NativeBinaries.1.0.86\build\LibGit2Sharp.NativeBinaries.props" Condition="Exists('..\packages\LibGit2Sharp.NativeBinaries.1.0.86\build\LibGit2Sharp.NativeBinaries.props')" />
3+
<PropertyGroup Condition="'$(SolutionDir)' == '' or '$(SolutionDir)' == '*undefined*'">
4+
<SolutionDir>..\..\..\</SolutionDir>
5+
</PropertyGroup>
6+
<PropertyGroup Condition="'$(PackageDir)' == '' or '$(PackageDir)' == '*undefined*'">
7+
<PackageDir>$(SolutionDir)packages</PackageDir>
8+
</PropertyGroup>
9+
<Import Project="$(PackageDir)\LibGit2Sharp.NativeBinaries.1.0.86\build\LibGit2Sharp.NativeBinaries.props"
10+
Condition="Exists('$(PackageDir)\LibGit2Sharp.NativeBinaries.1.0.86\build\LibGit2Sharp.NativeBinaries.props')" />
411
<PropertyGroup>
512
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
613
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -399,12 +406,6 @@
399406
<PreBuildEvent>
400407
</PreBuildEvent>
401408
</PropertyGroup>
402-
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
403-
<PropertyGroup>
404-
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
405-
</PropertyGroup>
406-
<Error Condition="!Exists('..\packages\LibGit2Sharp.NativeBinaries.1.0.86\build\LibGit2Sharp.NativeBinaries.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LibGit2Sharp.NativeBinaries.1.0.86\build\LibGit2Sharp.NativeBinaries.props'))" />
407-
</Target>
408409
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
409410
Other similar extension points exist, see Microsoft.Common.targets.
410411
<Target Name="BeforeBuild">

0 commit comments

Comments
 (0)