Skip to content

Commit

Permalink
Set up travis build.
Browse files Browse the repository at this point in the history
  • Loading branch information
spraints committed Sep 3, 2012
1 parent bf0bd09 commit d0597f7
Show file tree
Hide file tree
Showing 8 changed files with 234 additions and 161 deletions.
21 changes: 12 additions & 9 deletions .gitignore
@@ -1,14 +1,17 @@

.*.swp
# Local-only VS/Re#/etc files
*.suo
bin
*.user
*.gpState
_ReSharper.*
.*.swp

#

# Build outputs
bin
obj
*.gpState
*.user
TestResults
GitTfs/GitVersionInfo
pkg
GitTfs.sln.*
*.dotCover

# 3rd-party stuff copied during build
packages/
GitTfs/git2.*
4 changes: 2 additions & 2 deletions .nuget/NuGet.targets
Expand Up @@ -44,7 +44,7 @@
<PackageSources Condition=" $(PackageSources) == '' ">@(PackageSource)</PackageSources>

<NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(NuGetExePath)</NuGetCommand>
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">$(NuGetToolsPath)/fake-nuget</NuGetCommand>

<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>

Expand Down Expand Up @@ -140,4 +140,4 @@
</Code>
</Task>
</UsingTask>
</Project>
</Project>
52 changes: 52 additions & 0 deletions .nuget/fake-nuget
@@ -0,0 +1,52 @@
#!/bin/bash

command=$1
manifest=$2
dest=$7

ERR_COMMAND=1
ERR_DOWNLOAD=2
ERR_EXTRACT=3

if [ "$command" != "install" ]
then
echo "Only install is supported. (command was $command)"
exit $ERR_COMMAND
fi

# http://stackoverflow.com/questions/893585/how-to-parse-xml-in-bash
read_dom() {
local IFS=\>
read -d \< ENTITY CONTENT
}

parse_dom() {
echo $ENTITY
TAG_NAME=${ENTITY%% *}
ATTRIBUTES=${ENTITY#* }
if [ "$TAG_NAME" == "package" ]
then
eval local $ATTRIBUTES
pkgdest="$dest/$id.$version"
pkg="$id.$version.nupkg"
downloaded="$pkgdest/$pkg"
if [ ! -d "$pkgdest" ]
then
mkdir -p "$pkgdest"
fi
if [ ! -f "$downloaded" ]
then
curl -L -o "$downloaded" "https://nuget.org/api/v2/package/$id/$version" || exit $ERR_DOWNLOAD
fi
unzip -o -d $pkgdest $downloaded || exit $ERR_EXTRACT
fi
}

install_packages() {
while read_dom
do
parse_dom
done
}

cat $manifest | install_packages
4 changes: 4 additions & 0 deletions .nuget/packages.config
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="xunit.runners" version="1.9.1" />
</packages>
12 changes: 12 additions & 0 deletions .travis.yml
@@ -0,0 +1,12 @@
language: c

install:
- sudo apt-get install mono-devel mono-gmcs

script:
- git submodule update --init
- xbuild GitTfs.sln /p:Configuration=Debug /t:GitTfsTest

after_script:
- ./.nuget/fake-nuget install .nuget/packages.config -source "" -RequireConsent -o ./packages
- mono packages/xunit.runners.1.9.1/tools/xunit.console.clr4.exe GitTfsTest/bin/Debug/GitTfsTest.dll
5 changes: 3 additions & 2 deletions GitTfs.VsFake/GitTfs.VsFake.csproj
Expand Up @@ -126,7 +126,8 @@
</Target>
-->
<PropertyGroup>
<PostBuildEvent>xcopy /y "$(TargetDir)*.dll" "$(SolutionDir)GitTfs\$(OutDir)"</PostBuildEvent>
<PostBuildEvent Condition="'$(OS)' == 'Windows_NT'">xcopy /y "$(TargetDir)*.dll" "$(SolutionDir)GitTfs\$(OutDir)"</PostBuildEvent>
<PostBuildEvent Condition="'$(OS)' != 'Windows_NT'">cp "$(TargetDir)"*.dll "$(SolutionDir)GitTfs\$(OutDir)"</PostBuildEvent>
</PropertyGroup>
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
</Project>
</Project>
5 changes: 3 additions & 2 deletions GitTfs/GitTfs.csproj
Expand Up @@ -244,11 +244,12 @@
</Target>
-->
<PropertyGroup>
<PreBuildEvent>xcopy /Y "$(SolutionDir)\lib\libgit2sharp\Lib\NativeBinaries\$(PlatformName)\*.*" "$(ProjectDir)"</PreBuildEvent>
<PreBuildEvent Condition="'$(OS)' == 'Windows_NT'">xcopy /Y "$(SolutionDir)\lib\libgit2sharp\Lib\NativeBinaries\$(PlatformName)\*.*" "$(ProjectDir)"</PreBuildEvent>
<PreBuildEvent Condition="'$(OS)' != 'Windows_NT'">cp "$(SolutionDir)/lib/libgit2sharp/Lib/NativeBinaries/$(PlatformName)/"* "$(ProjectDir)"</PreBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
</Project>
</Project>

0 comments on commit d0597f7

Please sign in to comment.