Permalink
Browse files

Set up travis build.

  • Loading branch information...
1 parent bf0bd09 commit d0597f7311286e817efd5a5dedcab31ce0aae425 @spraints spraints committed Sep 2, 2012
Showing with 234 additions and 161 deletions.
  1. +12 −9 .gitignore
  2. +2 −2 .nuget/NuGet.targets
  3. +52 −0 .nuget/fake-nuget
  4. +4 −0 .nuget/packages.config
  5. +12 −0 .travis.yml
  6. +3 −2 GitTfs.VsFake/GitTfs.VsFake.csproj
  7. +3 −2 GitTfs/GitTfs.csproj
  8. +146 −146 GitTfsTest/GitTfsTest.csproj
View
@@ -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.*
View
@@ -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>
@@ -140,4 +140,4 @@
</Code>
</Task>
</UsingTask>
-</Project>
+</Project>
View
@@ -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
View
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="xunit.runners" version="1.9.1" />
+</packages>
View
@@ -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
@@ -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>
View
@@ -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>
Oops, something went wrong.

0 comments on commit d0597f7

Please sign in to comment.