Created
November 7, 2013 20:42
-
-
Save dragan/7361514 to your computer and use it in GitHub Desktop.
LibGit2Sharp Changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PREVIOUS_DYLD_FALLBACK_LIBRARY_PATH=$DYLD_FALLBACK_LIBRARY_PATH | |
LIBGIT2SHA=`cat ./LibGit2Sharp/libgit2_hash.txt` | |
SHORTSHA=${LIBGIT2SHA:0:7} | |
rm -rf cmake-build | |
mkdir cmake-build && cd cmake-build | |
cmake -DCMAKE_OSX_ARCHITECTURES="i386;x86_64" -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DTHREADSAFE:BOOL=ON -DBUILD_CLAR:BOOL=OFF -DCMAKE_INSTALL_PREFIX=./libgit2-bin -DLIBGIT2_FILENAME=git2-$SHORTSHA ../libgit2 | |
cmake --build . --target install | |
DYLD_FALLBACK_LIBRARY_PATH=$PWD/libgit2-bin/lib:$DYLD_FALLBACK_LIBRARY_PATH | |
export DYLD_FALLBACK_LIBRARY_PATH | |
cd .. | |
LIBGIT_CONFIG="<configuration><dllmap dll=\"git2-${SHORTSHA}\" target=\"libgit2-${SHORTSHA}.dylib\" /></configuration>" | |
echo $LIBGIT_CONFIG > LibGit2Sharp/LibGit2Sharp.config | |
echo $DYLD_FALLBACK_LIBRARY_PATH | |
xbuild mac-build.msbuild /t:Deploy | |
EXIT_CODE=$? | |
rm LibGit2Sharp/LibGit2Sharp.config | |
DYLD_FALLBACK_LIBRARY_PATH=$PREVIOUS_DYLD_FALLBACK_LIBRARY_PATH | |
export DYLD_FALLBACK_LIBRARY_PATH | |
exit $EXIT_CODE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project DefaultTargets="Deploy" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<PropertyGroup> | |
<Configuration Condition="'$(Configuration)' == ''">Release</Configuration> | |
<RootDir>$(MSBuildProjectDirectory)</RootDir> | |
<TestBuildDir>$(RootDir)\LibGit2Sharp.Tests\bin\$(Configuration)</TestBuildDir> | |
<DeployFolder>$(RootDir)\Build</DeployFolder> | |
</PropertyGroup> | |
<UsingTask AssemblyFile="$(MSBuildProjectDirectory)/Lib/xUnit/xunit.runner.msbuild.dll" | |
TaskName="Xunit.Runner.MSBuild.xunit" /> | |
<Target Name="Clean"> | |
<Message Text="Commit SHA = $(CommitSha)" /> | |
<WriteLinesToFile Condition="'$(CommitSha)' != ''" | |
File="$(RootDir)\LibGit2Sharp\libgit2sharp_hash.txt" | |
Lines="$(CommitSha)" | |
Overwrite="true" /> | |
<!-- Workaround for xbuild --> | |
<Exec Condition=" ('$(OS)' != 'Windows_NT') " Command=" rm -r -f $(DeployFolder) " /> | |
<Exec Condition=" ('$(OS)' != 'Windows_NT') " Command=" rm -r -f $(TestBuildDir) " /> | |
<RemoveDir Directories="$(DeployFolder)" Condition="Exists('$(DeployFolder)')" /> | |
<RemoveDir Directories="$(TestBuildDir)" Condition="Exists('$(TestBuildDir)')" /> | |
</Target> | |
<Target Name="Init" DependsOnTargets="Clean"> | |
<MakeDir Directories="$(DeployFolder)" /> | |
</Target> | |
<Target Name="Build" DependsOnTargets="Init"> | |
<MSBuild | |
Projects="LibGit2Sharp.sln" | |
Targets="Build" | |
Properties="Configuration=$(Configuration);TrackFileAccess=false" /> | |
</Target> | |
<Target Name="Test" DependsOnTargets="Build"> | |
<Copy SourceFiles="$(RootDir)\LibGit2Sharp\LibGit2Sharp.config" DestinationFiles="$(TestBuildDir)\LibGit2Sharp.dll.config" /> | |
<xunit Assembly="$(TestBuildDir)/LibGit2Sharp.Tests.dll" Xml="$(DeployFolder)/Test-result.xml" /> | |
</Target> | |
<Target Name="Deploy" DependsOnTargets="Test"> | |
<CreateItem Include="$(TestBuildDir)\LibGit2*.*"> | |
<Output TaskParameter="Include" ItemName="OutputFiles" /> | |
</CreateItem> | |
<Copy SourceFiles="@(OutputFiles)" | |
DestinationFiles="@(OutputFiles->'$(DeployFolder)\%(RecursiveDir)%(Filename)%(Extension)')" /> | |
<Exec Condition=" ('$(OS)' != 'Windows_NT') " Command="cp -R cmake-build/libgit2-bin/lib/libgit2-*.* $(DeployFolder) " /> | |
</Target> | |
</Project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment