diff --git a/README.md b/README.md index 853b87f32..3310e6987 100644 --- a/README.md +++ b/README.md @@ -56,3 +56,11 @@ two ways to build the various samples: 'Novell\Novell.MonoDroid.Common.targets'. topdir is also used to find the MonoDroid Install directory. + +Contributing +------------ + +Before adding a sample to the repository, please run either install-hook.bat +or install-hook.sh depending on whether you're on Windows or a Posix system. +This will install a Git hook that runs the Xamarin code sample validator before +a commit, to ensure that all samples are good to go. diff --git a/Xamarin.Edu.SampleGallery.Core.dll b/Xamarin.Edu.SampleGallery.Core.dll new file mode 100644 index 000000000..1781126b4 Binary files /dev/null and b/Xamarin.Edu.SampleGallery.Core.dll differ diff --git a/install-hook.bat b/install-hook.bat new file mode 100644 index 000000000..72abfb4bf --- /dev/null +++ b/install-hook.bat @@ -0,0 +1 @@ +copy pre-commit.windows .git\hooks\pre-commit diff --git a/install-hook.sh b/install-hook.sh new file mode 100644 index 000000000..a755d79a9 --- /dev/null +++ b/install-hook.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +cp pre-commit.posix .git/hooks/pre-commit diff --git a/pre-commit.posix b/pre-commit.posix new file mode 100644 index 000000000..cb3c9bc86 --- /dev/null +++ b/pre-commit.posix @@ -0,0 +1,9 @@ +#!/bin/sh + +for dir in `find . -type d -maxdepth 1`; do + mono --debug xcsv.exe $dir; + + if [ $? != 0 ]; then + exit 1; + fi; +done; diff --git a/pre-commit.windows b/pre-commit.windows new file mode 100644 index 000000000..d11dd5cf4 --- /dev/null +++ b/pre-commit.windows @@ -0,0 +1,9 @@ +#!/bin/sh + +for dir in `find . -type d -maxdepth 1`; do + xcsv.exe $dir; + + if [ $? != 0 ]; then + exit 1; + fi; +done; diff --git a/xcsv.exe b/xcsv.exe new file mode 100644 index 000000000..9f34f4007 Binary files /dev/null and b/xcsv.exe differ