Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI builds for C# solution #21

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
094055b
Add CI builds for C# solution
xplicit Jan 27, 2015
23d05f9
Add rudimentary Sublime Text 3 syntax highlighting
Jan 28, 2015
75d356c
Remove possible underflow in string buffer encoder
dnmiller Jan 31, 2015
a881241
Remove unnecessary semicolons
dnmiller Feb 1, 2015
ae6c73a
Move cabal install from ps script to cmd
sapek Feb 4, 2015
dcebe2c
Document setting the initial size of OutputBuffer
sapek Feb 4, 2015
7071344
Relax cabal version requirement to 1.18+
sapek Feb 4, 2015
e4facf2
Add to mingw\bin to PATH during AppVeyor build
sapek Feb 4, 2015
07688ed
Add missing double-quote to appveyor.yml
sapek Feb 4, 2015
7b4a828
Fix clone of MemoryStream on Mono
xplicit Feb 3, 2015
71d175c
Update appveyor.yml for the open source plan
sapek Feb 5, 2015
c34654b
Disable extracting Boost in AppVeyor CI
sapek Feb 6, 2015
5785007
Cache NuGet packages between AppVeyor builds
sapek Feb 6, 2015
9fe8b8a
Quote include directories in C# targets
chwarr Feb 5, 2015
6788acd
Whitespace cleanup
chwarr Feb 6, 2015
9e67ea5
Add unit test for files with spaces in their paths
chwarr Feb 6, 2015
adeee02
Fix import directories with trailing slashes
chwarr Feb 7, 2015
8963fb4
Add example showing how import can be used
chwarr Feb 6, 2015
bbab14a
Split tests by framework version
sapek Feb 7, 2015
2358f30
Add syntax highlighting support for Notepad++
rambho Feb 7, 2015
92b26cc
Use a smaller buffer when marshaling bonded<T>
sapek Feb 10, 2015
04ba5a5
Disable Boost download in appveyor.yml
sapek Feb 10, 2015
8869f9f
Use Array.Resize to grow OutputBuffer
sapek Feb 10, 2015
cbba732
Combine unit tests into fewer assemblies
sapek Feb 11, 2015
da69a47
Remove CollectionInterfaces config from appveyor
sapek Feb 11, 2015
cb4b45c
Convert unit tests from MSTest to NUnit
xplicit Feb 12, 2015
18a1cc7
Add unit tests run to Travis
xplicit Feb 12, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
53 changes: 43 additions & 10 deletions .travis.yml
@@ -1,13 +1,46 @@
language: cpp
compiler: clang
language: csharp
os:
- linux
- osx

before_install:
- brew update
- brew install ghc cabal-install
- cabal update
- echo $TRAVIS_OS_NAME
- export CC=clang
#linux prereqisite packages
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo add-apt-repository ppa:smspillaz/cmake-2.8.12 -y; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo add-apt-repository ppa:boost-latest/ppa -y; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo add-apt-repository ppa:hvr/ghc -y; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get update -qq; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -y cmake cmake-data make libboost1.55-all-dev cabal-install-1.22 ghc; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then export CABAL_PATH=/opt/cabal/1.22/bin; fi
#OS X prerequisite packages
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install ghc cabal-install; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then curl -s -o mono.pkg http://download.mono-project.com/archive/3.12.0/macos-10-x86/MonoFramework-MDK-3.12.0.macos10.xamarin.x86.pkg; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then sudo installer -pkg "mono.pkg" -target /; fi
#show versions of cmake and clang
- cmake --version && clang --version
#nuget installation
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install nuget && export NUGET=nuget; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then curl -s -o "cs/nuget/nuget.exe" -L "http://www.nuget.org/nuget.exe" && export NUGET="mono cs/nuget/nuget.exe"; fi
#nunit installation
- $NUGET install NUnit.Runners -version 2.6.4
#cabal-install from ppa is installed into /opt
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then /opt/cabal/1.22/bin/cabal update; else cabal update; fi

before_script:
#restore nuget packages for solution
- $NUGET restore cs/cs.sln

script:
- mkdir build
- cd build
- mkdir build && cd build
- cmake ..
- make --jobs 2 check
os: osx
osx_image: xcode61
#linux build is throwed out by out of memory or travis timeout with "make check" so do only make
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then make; else make --jobs 2 check; fi
- sudo make install
- cd ..
- xbuild /p:Configuration=Debug cs/cs.sln
- xbuild /p:Configuration=Fields cs/cs.sln
after_script:
#do unit-testing only on linux platform, due to secript execution time limits
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then mono NUnit.Runners.2.6.4/tools/nunit-console.exe -framework=mono-4.5 -labels cs/test/core/bin/debug/net45/Properties/Bond.UnitTest.dll cs/test/core/bin/debug/net45/Fields/Bond.UnitTest.dll cs/test/internal/bin/debug/net45/Bond.InternalTest.dll; fi
9 changes: 2 additions & 7 deletions README.md
Expand Up @@ -24,7 +24,7 @@ The Bond repository uses Git submodules and should be cloned with the
git clone --recursive https://github.com/Microsoft/bond.git

In order to build Bond you will need CMake (2.8.12+), Haskell (ghc 7.4+ and
cabal-install 1.20+) and Boost (1.54+). The core Bond C++ library can be used
cabal-install 1.18+) and Boost (1.54+). The core Bond C++ library can be used
with C++03 compilers, although Python support, unit tests and various examples
require some C++11 features.

Expand Down Expand Up @@ -131,12 +131,7 @@ Install the following tools:
- CMake ([http://www.cmake.org/download/](http://www.cmake.org/download/))
- Haskell Platform ([http://haskell.org/platform/](http://haskell.org/platform/))


Update cabal to the latest version (if behind a proxy, set environment variable
`HTTP_PROXY=http://proxy:port` before running cabal):

cabal update
cabal install cabal-install
If behind a proxy, set environment variable `HTTP_PROXY=http://proxy:port`.

Now you are ready to build the C# version of Bond. Open the solution file
`cs\cs.sln` in Visual Studio 2013 and build as usual. The C# unit tests can
Expand Down
70 changes: 36 additions & 34 deletions appveyor.yml
@@ -1,39 +1,45 @@
version: 1.0.{build}
branches:
only:
- master
- fsharp
clone_depth: 15
install:
- cmd: git submodule update --init
- ps: >-
if ($env:APPVEYOR_REPO_BRANCH -ne "fsharp") {

echo "Downloading Boost 1.57 ..."
#choco install 7zip

Start-FileDownload "http://softlayer-dal.dl.sourceforge.net/project/boost/boost/1.57.0/boost_1_57_0.zip"
#$env:Path += ";${env:ProgramFiles}\7-Zip"

echo "Extracting Boost..."
#if (!(Test-Path boost_1_57_0.7z)) {

$shell = New-Object -ComObject Shell.Application
# echo "Downloading Boost 1.57 ..."

$item = $shell.NameSpace("${env:APPVEYOR_BUILD_FOLDER}\boost_1_57_0.zip\boost_1_57_0\boost")
# appveyor DownloadFile "http://softlayer-dal.dl.sourceforge.net/project/boost/boost/1.57.0/boost_1_57_0.7z" -Timeout 1200000

$shell.NameSpace("${env:APPVEYOR_BUILD_FOLDER}").CopyHere($item)
#}

#echo "Extracting Boost..."

#7z x boost_1_57_0.7z -y -o"${env:APPVEYOR_BUILD_FOLDER}" boost_1_57_0\boost > $null

#$env:BOOST_ROOT = "${env:APPVEYOR_BUILD_FOLDER}\boost_1_57_0"

choco install haskellplatform -version 2014.2.0.0

# Haskell Platfrom package doesn't update PATH for the current shell instance

$env:Path += ";${env:ProgramFiles}\Haskell Platform\2014.2.0.0\bin"

$env:Path += ";${env:ProgramFiles}\Haskell Platform\2014.2.0.0\lib\extralibs\bin"

cabal update
$env:Path += ";${env:ProgramFiles}\Haskell Platform\2014.2.0.0\mingw\bin"

cabal install cabal-install
cabal update

}
cache:
- cs\packages
- compiler\.cabal-sandbox
- boost_1_57_0.7z
# Majority of build time is spent installing dependencies and then building
# cabal and the sandbox. Using build matrix support we would have to do this
# for every configuration. Instead we manually build the configurations we want
Expand All @@ -45,40 +51,34 @@ build_script:
nuget restore cs\cs.sln

# default codegen with properties

msbuild cs\cs.sln /verbosity:minimal /p:Configuration=Debug /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"

if (-not $?) { throw "build failed" }

# codegen with public fields
# codegen with public fields and interfaces used to represent collections

msbuild cs\cs.sln /verbosity:minimal /p:Configuration=Fields /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"

if (-not $?) { throw "build failed" }

# codegen with interfaces used to represent collections
# AppVeyor open source plan runs on very slow VMs, disable C++ until VC14 is fully supported

msbuild cs\cs.sln /verbosity:minimal /p:Configuration=CollectionInterfaces /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
#mkdir build

if (-not $?) { throw "build failed" }
#cd build

$env:BOOST_ROOT = "${env:APPVEYOR_BUILD_FOLDER}"
#cmake ..

mkdir build

cd build

cmake ..

$env:PreferredToolArchitecture = "x64"
#$env:PreferredToolArchitecture = "x64"

# Building Release configuration to prevent assert message boxes

msbuild bond.sln /verbosity:minimal /p:Configuration=Release /p:Optimization=Disabled /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
if (-not $?) { throw "build failed" }
# msbuild bond.sln /verbosity:minimal /p:Configuration=Release /p:Optimization=Disabled /target:bond_compatibility_test /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"

#if (-not $?) { throw "build failed" }

cd ..
#cd ..

} else {

Expand All @@ -93,13 +93,15 @@ test_script:

if ($env:APPVEYOR_REPO_BRANCH -ne "fsharp") {

vstest.console /logger:Appveyor cs\test\core\bin\debug\net40\Properties\Bond.UnitTest.dll cs\test\core\bin\debug\net45\Properties\Bond.UnitTest.dll cs\test\core\bin\debug\net40\Fields\Bond.UnitTest.dll cs\test\core\bin\debug\net45\Fields\Bond.UnitTest.dll cs\test\core\bin\debug\net40\CollectionInterfaces\Bond.UnitTest.dll cs\test\core\bin\debug\net45\CollectionInterfaces\Bond.UnitTest.dll cs\test\internal\bin\debug\net40\Bond.InternalTest.dll cs\test\internal\bin\debug\net45\Bond.InternalTest.dll
nunit-console-x86 /framework:net-4.0 /labels cs\test\core\bin\debug\net40\Properties\Bond.UnitTest.dll cs\test\core\bin\debug\net40\Fields\Bond.UnitTest.dll cs\test\internal\bin\debug\net40\Bond.InternalTest.dll

nunit-console-x86 /framework:net-4.5 /labels cs\test\core\bin\debug\net45\Properties\Bond.UnitTest.dll cs\test\core\bin\debug\net45\Fields\Bond.UnitTest.dll cs\test\internal\bin\debug\net45\Bond.InternalTest.dll

cd build
#cd build

ctest -C Release --output-on-failure
#ctest -C Release -R compatibility --output-on-failure

cd ..
#cd ..

} else {

Expand Down
2 changes: 1 addition & 1 deletion compiler/CMakeLists.txt
Expand Up @@ -4,7 +4,7 @@ set (CMAKE_MODULE_PATH
${CMAKE_CURRENT_SOURCE_DIR}/../cmake)

# required Haskell components
find_package (Cabal 1.20.0.0 REQUIRED)
find_package (Cabal 1.18.0.0 REQUIRED)
find_package (GHC 7.4.1.0 REQUIRED)

set (sources
Expand Down
1 change: 0 additions & 1 deletion compiler/cabal.config

This file was deleted.

18 changes: 13 additions & 5 deletions compiler/cabal_build.cmake
Expand Up @@ -6,8 +6,16 @@
# default cabal install uses directory under %APPDATA% which contains user name.
# As a workaround we execute this .cmake script as a custom command and use CMake
# cache to get access to variables set during configuration.

cmake_policy (SET CMP0012 NEW)

if ($ENV{APPVEYOR})
# AppVeyor Azure VMs have limited memory, limit ghc heap to 192 MB
set (GHC_OPTIONS --ghc-option=+RTS --ghc-option=-M192m --ghc-option=-RTS)
endif()

execute_process (
COMMAND ${Haskell_CABAL_EXECUTABLE} --require-sandbox install --with-compiler=${Haskell_GHC_EXECUTABLE} --only-dependencies --jobs
COMMAND ${Haskell_CABAL_EXECUTABLE} install --with-compiler=${Haskell_GHC_EXECUTABLE} --only-dependencies --jobs ${GHC_OPTIONS}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
RESULT_VARIABLE error)

Expand All @@ -16,20 +24,20 @@ if (error)
endif()

execute_process (
COMMAND ${Haskell_CABAL_EXECUTABLE} --require-sandbox configure --with-compiler=${Haskell_GHC_EXECUTABLE} --builddir=${output_dir}
COMMAND ${Haskell_CABAL_EXECUTABLE} configure --with-compiler=${Haskell_GHC_EXECUTABLE} --builddir=${output_dir}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
RESULT_VARIABLE error)

if (error)
message (FATAL_ERROR)
endif()

execute_process (
COMMAND ${Haskell_CABAL_EXECUTABLE} --require-sandbox build --with-ghc=${Haskell_GHC_EXECUTABLE} --ghc-option=-O2 --jobs --builddir=${output_dir}
COMMAND ${Haskell_CABAL_EXECUTABLE} build --with-ghc=${Haskell_GHC_EXECUTABLE} --ghc-option=-O2 --jobs --builddir=${output_dir}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
RESULT_VARIABLE error)

if (error)
message (FATAL_ERROR)
endif()

2 changes: 1 addition & 1 deletion cpp/inc/bond/core/blob.h
Expand Up @@ -381,5 +381,5 @@ inline T blob_cast(const blob& from)
}
}

}; // bond namespace
} // namespace bond

2 changes: 1 addition & 1 deletion cpp/inc/bond/core/bonded.h
Expand Up @@ -276,4 +276,4 @@ class bonded

#pragma warning(pop)

};
} // namespace bond
2 changes: 1 addition & 1 deletion cpp/inc/bond/core/bonded_void.h
Expand Up @@ -183,4 +183,4 @@ class bonded<void, Reader>
const bool _base;
};

};
} // namespace bond
2 changes: 1 addition & 1 deletion cpp/inc/bond/core/container_interface.h
Expand Up @@ -121,4 +121,4 @@ template<typename T>
void resize_string(T& str, uint32_t size);
#endif

};
} // namespace bond
4 changes: 2 additions & 2 deletions cpp/inc/bond/core/detail/inheritance.h
Expand Up @@ -186,6 +186,6 @@ class ParserInheritance
const bool _base;
};

}; // namespace detail
} // namespace detail

}; // namespace bond
} // namespace bond
5 changes: 2 additions & 3 deletions cpp/inc/bond/core/detail/protocol_visitors.h
Expand Up @@ -261,7 +261,6 @@ inline void Merge(const T& var, ProtocolReader<Buffer>& reader)
}


}; // namespace detail
} // namespace detail


}; // namespace bond
} // namespace bond
2 changes: 1 addition & 1 deletion cpp/inc/bond/core/detail/tags.h
Expand Up @@ -87,4 +87,4 @@ is_modifying_transform
: is_base_of<ModifyingTransform, T> {};


};
} // namespace bond
5 changes: 2 additions & 3 deletions cpp/inc/bond/core/detail/typeid_value.h
Expand Up @@ -800,7 +800,6 @@ inline MatchingMapByElement(T& var, BondDataType keyType, BondDataType elementTy
}


} // namespace detail

}; // namespace detail

}; // namespace bond
} // namespace bond
2 changes: 1 addition & 1 deletion cpp/inc/bond/core/nullable.h
Expand Up @@ -651,5 +651,5 @@ is_list_container<nullable<T, Allocator, useValue> >
: true_type {};


}; // namespace bond
} // namespace bond

2 changes: 1 addition & 1 deletion cpp/inc/bond/core/protocol.h
Expand Up @@ -214,4 +214,4 @@ struct ProtocolReader
};


};
} // namespace bond
4 changes: 2 additions & 2 deletions cpp/inc/bond/core/reflection.h
Expand Up @@ -251,7 +251,7 @@ bond::Metadata MetadataInit(const char* name, const char* qualified_name, const
}


}; // namespace reflection
} // namespace reflection


const reflection::nothing nothing = {};
Expand Down Expand Up @@ -809,4 +809,4 @@ class PrimitiveTypes
}
};

};
} // namespace bond
2 changes: 1 addition & 1 deletion cpp/inc/bond/core/schema.h
Expand Up @@ -352,4 +352,4 @@ inline const std::map<std::string, T>& GetEnumNames()
}


}; // namespace bond
} // namespace bond
4 changes: 2 additions & 2 deletions cpp/inc/bond/core/transforms.h
Expand Up @@ -687,7 +687,7 @@ class MapTo
{
return AssignToField(typename boost::mpl::next<Fields>::type(), var, id, value);
}
};
}


template <typename V, typename X>
Expand Down Expand Up @@ -775,4 +775,4 @@ class MapTo
const Mappings& _mappings;
};

}
} // namespace bond
2 changes: 1 addition & 1 deletion cpp/inc/bond/core/value.h
Expand Up @@ -1002,5 +1002,5 @@ inline DeserializeMap(X& var, BondDataType keyType, const T& element, Reader& in
input.ReadContainerEnd();
}

};
} // namespace bond

2 changes: 1 addition & 1 deletion cpp/inc/bond/protocol/compact_binary.h
Expand Up @@ -778,4 +778,4 @@ bool is_protocol_version_same(const bond::CompactBinaryReader<Input>& reader,
return reader._version == writer._version;
}

}; // namespace bond
} // namespace bond