diff --git a/nuget.package/LibGit2Sharp.nuspec b/nuget.package/LibGit2Sharp.nuspec index 99c326536..141733478 100644 --- a/nuget.package/LibGit2Sharp.nuspec +++ b/nuget.package/LibGit2Sharp.nuspec @@ -22,7 +22,8 @@ - + + diff --git a/nuget.package/Tools/GetLibGit2SharpPostBuildCmd.ps1 b/nuget.package/Tools/GetLibGit2SharpPostBuildCmd.ps1 deleted file mode 100644 index e1847e610..000000000 --- a/nuget.package/Tools/GetLibGit2SharpPostBuildCmd.ps1 +++ /dev/null @@ -1,13 +0,0 @@ -$solutionDir = [System.IO.Path]::GetDirectoryName($dte.Solution.FullName) + "\" -$path = $installPath.Replace($solutionDir, "`$(SolutionDir)") - -$NativeAssembliesDir = Join-Path $path "lib\net40\NativeBinaries" -$x86 = $(Join-Path $NativeAssembliesDir "x86\*.*") -$x64 = $(Join-Path $NativeAssembliesDir "amd64\*.*") - -$LibGit2SharpPostBuildCmd = " -if not exist `"`$(TargetDir)NativeBinaries`" md `"`$(TargetDir)NativeBinaries`" -if not exist `"`$(TargetDir)NativeBinaries\x86`" md `"`$(TargetDir)NativeBinaries\x86`" -xcopy /s /y /d `"$x86`" `"`$(TargetDir)NativeBinaries\x86`" -if not exist `"`$(TargetDir)NativeBinaries\amd64`" md `"`$(TargetDir)NativeBinaries\amd64`" -xcopy /s /y /d `"$x64`" `"`$(TargetDir)NativeBinaries\amd64`"" diff --git a/nuget.package/Tools/install.ps1 b/nuget.package/Tools/install.ps1 deleted file mode 100644 index bc403c27b..000000000 --- a/nuget.package/Tools/install.ps1 +++ /dev/null @@ -1,11 +0,0 @@ -param($installPath, $toolsPath, $package, $project) - -. (Join-Path $toolsPath "GetLibGit2SharpPostBuildCmd.ps1") - -# Get the current Post Build Event cmd -$currentPostBuildCmd = $project.Properties.Item("PostBuildEvent").Value - -# Append our post build command if it's not already there -if (!$currentPostBuildCmd.Contains($LibGit2SharpPostBuildCmd)) { - $project.Properties.Item("PostBuildEvent").Value += $LibGit2SharpPostBuildCmd -} \ No newline at end of file diff --git a/nuget.package/Tools/uninstall.ps1 b/nuget.package/Tools/uninstall.ps1 deleted file mode 100644 index a1854cb32..000000000 --- a/nuget.package/Tools/uninstall.ps1 +++ /dev/null @@ -1,9 +0,0 @@ -param($installPath, $toolsPath, $package, $project) - -. (Join-Path $toolsPath "GetLibGit2SharpPostBuildCmd.ps1") - -# Get the current Post Build Event cmd -$currentPostBuildCmd = $project.Properties.Item("PostBuildEvent").Value - -# Remove our post build command from it (if it's there) -$project.Properties.Item("PostBuildEvent").Value = $currentPostBuildCmd.Replace($LibGit2SharpPostBuildCmd, "") \ No newline at end of file diff --git a/nuget.package/build/LibGit2Sharp.props b/nuget.package/build/LibGit2Sharp.props new file mode 100644 index 000000000..8216f816f --- /dev/null +++ b/nuget.package/build/LibGit2Sharp.props @@ -0,0 +1,9 @@ + + + + + CollectLibGitNativeBinaries; + $(PipelineCollectFilesPhaseDependsOn); + + + diff --git a/nuget.package/build/LibGit2Sharp.targets b/nuget.package/build/LibGit2Sharp.targets new file mode 100644 index 000000000..c4594c576 --- /dev/null +++ b/nuget.package/build/LibGit2Sharp.targets @@ -0,0 +1,27 @@ + + + + + + + + <_LibGitFiles Include="$(MSBuildThisFileDirectory)..\lib\net40\NativeBinaries\**\*" Condition="'%(_LibGit2SharpReference.FullPath)' != ''" /> + + ..\$(OutDir)NativeBinaries\%(RecursiveDir)%(Filename)%(Extension) + PreserveNewest + + + NativeBinaries\%(RecursiveDir)%(Filename)%(Extension) + PreserveNewest + + + + + + <_LibGitFiles Include="bin\NativeBinaries\**\*" /> + + bin\NativeBinaries\%(RecursiveDir)%(Filename)%(Extension) + + + +