Added libgit2sharp as submodule for Linux CI build later.

release-1.0.0
Icedream 2015-01-04 19:43:01 +01:00
parent e0e9fd5287
commit 26973a59de
7 changed files with 78 additions and 36 deletions

2
.gitignore vendored
View File

@ -65,6 +65,7 @@ DocProject/Help/html
publish/
# NuGet Packages
packages/*.config
packages/*/*
!packages/*/build
@ -100,3 +101,4 @@ UpgradeLog*.htm
# Microsoft Fakes
FakesAssemblies/
src/updater/costura??/git2-???????.dll

4
.gitmodules vendored Normal file
View File

@ -0,0 +1,4 @@
[submodule "deps/libgit2sharp"]
path = deps/libgit2sharp
url = git://github.com/libgit2/libgit2sharp.git
branch = master

View File

@ -12,6 +12,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{DBC750
.nuget\NuGet.targets = .nuget\NuGet.targets
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibGit2Sharp", "deps\libgit2sharp\LibGit2Sharp\LibGit2Sharp.csproj", "{EE6ED99F-CB12-4683-B055-D28FC7357A34}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -22,6 +24,10 @@ Global
{DDF5040E-9C6C-4686-800B-D4563C289F01}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DDF5040E-9C6C-4686-800B-D4563C289F01}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DDF5040E-9C6C-4686-800B-D4563C289F01}.Release|Any CPU.Build.0 = Release|Any CPU
{EE6ED99F-CB12-4683-B055-D28FC7357A34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EE6ED99F-CB12-4683-B055-D28FC7357A34}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EE6ED99F-CB12-4683-B055-D28FC7357A34}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EE6ED99F-CB12-4683-B055-D28FC7357A34}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

1
deps/libgit2sharp vendored Submodule

@ -0,0 +1 @@
Subproject commit e62364db80d657247a4ec526f1edb97f621f3cc6

View File

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)\..\..\lib\net40\NativeBinaries\amd64\git2-91fa31f.dll">
<Link>NativeBinaries\amd64\git2-91fa31f.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="$(MSBuildThisFileDirectory)\..\..\lib\net40\NativeBinaries\amd64\git2-91fa31f.pdb">
<Link>NativeBinaries\amd64\git2-91fa31f.pdb</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="$(MSBuildThisFileDirectory)\..\..\lib\net40\NativeBinaries\x86\git2-91fa31f.dll">
<Link>NativeBinaries\x86\git2-91fa31f.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="$(MSBuildThisFileDirectory)\..\..\lib\net40\NativeBinaries\x86\git2-91fa31f.pdb">
<Link>NativeBinaries\x86\git2-91fa31f.pdb</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\LibGit2Sharp.0.20.1.0\build\net40\LibGit2Sharp.props" Condition="Exists('..\packages\LibGit2Sharp.0.20.1.0\build\net40\LibGit2Sharp.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@ -12,7 +11,7 @@
<AssemblyName>citimp_upd</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>d8335321</NuGetPackageImportStamp>
<NuGetPackageImportStamp>30c6a65d</NuGetPackageImportStamp>
<TargetFrameworkProfile />
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<RestorePackages>true</RestorePackages>
@ -51,9 +50,6 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>$(SolutionDir)\packages\CommandLineParser.1.9.71\lib\net40\CommandLine.dll</HintPath>
</Reference>
<Reference Include="LibGit2Sharp">
<HintPath>$(SolutionDir)\packages\LibGit2Sharp.0.20.1.0\lib\net40\LibGit2Sharp.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Build" />
<Reference Include="Microsoft.Build.Conversion.v4.0" />
<Reference Include="Microsoft.Build.Engine" />
@ -79,32 +75,33 @@
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<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>
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\packages\LibGit2Sharp.0.20.1.0\build\net40\LibGit2Sharp.props')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\LibGit2Sharp.0.20.1.0\build\net40\LibGit2Sharp.props'))" />
<Error Condition="!Exists('..\..\packages\Fody.1.26.1\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Fody.1.26.1\build\Fody.targets'))" />
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</Target>
<ItemGroup>
<EmbeddedResource Include="$(SolutionDir)\packages\LibGit2Sharp.0.20.1.0\lib\net40\NativeBinaries\amd64\git2-91fa31f.dll">
<Link>costura64/%(Filename)%(Extension)</Link>
</EmbeddedResource>
<EmbeddedResource Include="$(ProjectDir)\costura64\**\*">
<Link>costura64/%(RecursiveDir)%(Filename)%(Extension)</Link>
</EmbeddedResource>
<EmbeddedResource Include="$(SolutionDir)\packages\LibGit2Sharp.0.20.1.0\lib\net40\NativeBinaries\x86\git2-91fa31f.dll">
<Link>costura32/%(Filename)%(Extension)</Link>
</EmbeddedResource>
<EmbeddedResource Include="$(ProjectDir)\costura32\**\*">
<Link>costura32/%(RecursiveDir)%(Filename)%(Extension)</Link>
</EmbeddedResource>
<Content Include="FodyWeavers.xml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\deps\libgit2sharp\LibGit2Sharp\LibGit2Sharp.csproj">
<Project>{ee6ed99f-cb12-4683-b055-d28fc7357a34}</Project>
<Name>LibGit2Sharp</Name>
</ProjectReference>
</ItemGroup>
<Import Project="..\..\packages\Fody.1.26.1\build\Fody.targets" Condition="Exists('..\..\packages\Fody.1.26.1\build\Fody.targets')" />
<UsingTask TaskName="CosturaCleanup" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" TaskFactory="CodeTaskFactory">
<ParameterGroup>
@ -143,6 +140,60 @@ foreach (var item in filesToCleanup)
<CosturaCleanup Config="FodyWeavers.xml" Files="@(ReferenceCopyLocalPaths->'$(OutDir)%(DestinationSubDirectory)%(Filename)%(Extension)')" />
</Target>
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT'">
<PreBuildEvent>pushd "$(SolutionDir)deps\libgit2sharp\libgit2"
git rev-parse HEAD &gt; ..\LibGit2Sharp\libgit2_hash.txt
set /p LIBGIT2_HASH=&lt; ..\LibGit2Sharp\libgit2_hash.txt
set LIBGIT2_HASH=%25LIBGIT2_HASH:~0,7%25
del /q /s "$(SolutionDir)src\updater\costura32\git*.dll"
del /q /s "$(SolutionDir)src\updater\costura64\git*.dll"
rmdir /q /s Build
mkdir Build
pushd Build
mkdir x64
pushd x64
cmake ../.. "-DCMAKE_INSTALL_PREFIX=%25cd%25" "-DBIN_INSTALL_DIR=$(SolutionDir)src\updater\costura64" -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DBUILD_CLAR:BOOL=OFF -Ax64 -DUSE_SSH=OFF -DENABLE_TRACE=ON -DLIBGIT2_FILENAME=git2-%25LIBGIT2_HASH%25 -DCMAKE_OSX_ARCHITECTURES="x86_64"
cmake --build . --target install
popd
mkdir x86
pushd x86
cmake ../.. "-DCMAKE_INSTALL_PREFIX=%25cd%25" "-DBIN_INSTALL_DIR=$(SolutionDir)src\updater\costura32" -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DBUILD_CLAR:BOOL=OFF -AWin32 -DUSE_SSH=OFF -DENABLE_TRACE=ON -DLIBGIT2_FILENAME=git2-%25LIBGIT2_HASH%25 -DCMAKE_OSX_ARCHITECTURES="i386"
cmake --build . --target install
popd
popd
</PreBuildEvent>
</PropertyGroup>
<PropertyGroup Condition=" '$(OS)' != 'Windows_NT'">
<PreBuildEvent>cd "$(SolutionDir)deps\libgit2sharp\libgit2"
LIBGIT2_HASH=$( git rev-parse HEAD )
echo $LIBGIT2_HASH &gt; ../LibGit2Sharp/libgit2_hash.txt
LIBGIT2_HASH=${LIBGIT2_HASH:0:7}
rm -rf "$(SolutionDir)src/updater/costura32"/git*.so "$(SolutionDir)src/updater/costura64"/git*.so Build
mkdir -p Build/x64 Build/x86
cd Build
cd x64
cmake ../.. "-DCMAKE_INSTALL_PREFIX=%25cd%25" "-DBIN_INSTALL_DIR=$(SolutionDir)src\updater\costura64" -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DBUILD_CLAR:BOOL=OFF -Ax64 -DUSE_SSH=OFF -DENABLE_TRACE=ON -DLIBGIT2_FILENAME=git2-%25LIBGIT2_HASH%25 -DCMAKE_OSX_ARCHITECTURES="x86_64"
cmake --build . --target install
cd ..
cd x86
cmake ../.. "-DCMAKE_INSTALL_PREFIX=%25cd%25" "-DBIN_INSTALL_DIR=$(SolutionDir)src\updater\costura32" -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DBUILD_CLAR:BOOL=OFF -AWin32 -DUSE_SSH=OFF -DENABLE_TRACE=ON -DLIBGIT2_FILENAME=git2-%25LIBGIT2_HASH%25 -DCMAKE_OSX_ARCHITECTURES="i386"
cmake --build . --target install
cd ..
</PreBuildEvent>
</PropertyGroup>
<!-- TODO: Post-build event for Mono (linux binaries for git2) -->
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">

View File

@ -3,6 +3,5 @@
<package id="CommandLineParser" version="1.9.71" targetFramework="net40" />
<package id="Costura.Fody" version="1.3.3.0" targetFramework="net40" developmentDependency="true" />
<package id="Fody" version="1.26.1" targetFramework="net40" developmentDependency="true" />
<package id="LibGit2Sharp" version="0.20.1.0" targetFramework="net45" />
<package id="Mono.Posix" version="4.0.0.0" targetFramework="net45" />
</packages>