From 26973a59deb0f1a11ec5ba0f2a61a362776d8586 Mon Sep 17 00:00:00 2001 From: icedream Date: Sun, 4 Jan 2015 19:43:01 +0100 Subject: [PATCH] Added libgit2sharp as submodule for Linux CI build later. --- .gitignore | 2 + .gitmodules | 4 + CitizenMP Server Updater.sln | 6 ++ deps/libgit2sharp | 1 + .../build/net40/LibGit2Sharp.props | 21 ----- src/updater/CitizenMP Server Updater.csproj | 79 +++++++++++++++---- src/updater/packages.config | 1 - 7 files changed, 78 insertions(+), 36 deletions(-) create mode 100644 .gitmodules create mode 160000 deps/libgit2sharp delete mode 100644 packages/LibGit2Sharp.0.20.1.0/build/net40/LibGit2Sharp.props diff --git a/.gitignore b/.gitignore index ef9d403..d2e4365 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..53c95c7 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "deps/libgit2sharp"] + path = deps/libgit2sharp + url = git://github.com/libgit2/libgit2sharp.git + branch = master diff --git a/CitizenMP Server Updater.sln b/CitizenMP Server Updater.sln index 0b9bcb2..b7a66fa 100644 --- a/CitizenMP Server Updater.sln +++ b/CitizenMP Server Updater.sln @@ -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 diff --git a/deps/libgit2sharp b/deps/libgit2sharp new file mode 160000 index 0000000..e62364d --- /dev/null +++ b/deps/libgit2sharp @@ -0,0 +1 @@ +Subproject commit e62364db80d657247a4ec526f1edb97f621f3cc6 diff --git a/packages/LibGit2Sharp.0.20.1.0/build/net40/LibGit2Sharp.props b/packages/LibGit2Sharp.0.20.1.0/build/net40/LibGit2Sharp.props deleted file mode 100644 index e1fd17c..0000000 --- a/packages/LibGit2Sharp.0.20.1.0/build/net40/LibGit2Sharp.props +++ /dev/null @@ -1,21 +0,0 @@ - - - - - NativeBinaries\amd64\git2-91fa31f.dll - PreserveNewest - - - NativeBinaries\amd64\git2-91fa31f.pdb - PreserveNewest - - - NativeBinaries\x86\git2-91fa31f.dll - PreserveNewest - - - NativeBinaries\x86\git2-91fa31f.pdb - PreserveNewest - - - diff --git a/src/updater/CitizenMP Server Updater.csproj b/src/updater/CitizenMP Server Updater.csproj index 6ff4fae..980ca5d 100644 --- a/src/updater/CitizenMP Server Updater.csproj +++ b/src/updater/CitizenMP Server Updater.csproj @@ -1,6 +1,5 @@ - + - Debug @@ -12,7 +11,7 @@ citimp_upd v4.0 512 - d8335321 + 30c6a65d ..\..\ true @@ -51,9 +50,6 @@ False $(SolutionDir)\packages\CommandLineParser.1.9.71\lib\net40\CommandLine.dll - - $(SolutionDir)\packages\LibGit2Sharp.0.20.1.0\lib\net40\LibGit2Sharp.dll - @@ -79,32 +75,33 @@ - + + Designer + 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}. - - - costura64/%(Filename)%(Extension) - costura64/%(RecursiveDir)%(Filename)%(Extension) - - costura32/%(Filename)%(Extension) - costura32/%(RecursiveDir)%(Filename)%(Extension) + + + {ee6ed99f-cb12-4683-b055-d28fc7357a34} + LibGit2Sharp + + @@ -143,6 +140,60 @@ foreach (var item in filesToCleanup) + + pushd "$(SolutionDir)deps\libgit2sharp\libgit2" + +git rev-parse HEAD > ..\LibGit2Sharp\libgit2_hash.txt +set /p LIBGIT2_HASH=< ..\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 + + + + cd "$(SolutionDir)deps\libgit2sharp\libgit2" + +LIBGIT2_HASH=$( git rev-parse HEAD ) +echo $LIBGIT2_HASH > ../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 .. + + +