Do not remap framework assembly if it's version is higher than the runtime version
[mono.git] / appveyor.yml
index 58c9a3a60b520efde47de58e55606fe9e3a656a7..8fa713a07ef423ad1015ce7d62dfceb4179f9e0b 100644 (file)
@@ -4,54 +4,41 @@
 # For further details see http://www.appveyor.com
 #
 
-# Use 'unstable' Appveyor build worker image as Appveyor have added Cygwin to this for us
-os: Unstable
-
 #
 # Custom environment variables
 #
 environment:
     global:
-        CYG_ROOT: C:/cygwin
+        CYG_ROOT: C:\cygwin
         CYG_MIRROR: http://cygwin.mirror.constant.com
-        CYG_CACHE: C:/cygwin/var/cache/setup
-        NSIS_ROOT: C:\nsis
-   
+        CYG_CACHE: C:\cygwin\var\cache\setup
+        CYG_BASH: C:\cygwin\bin\bash
+
+#
+# Cache Cygwin files to speed up build
+#
+cache:
+    - '%CYG_CACHE%'
+
+#
+# Do a shallow clone of the repo to speed up build
+#
+clone_depth: 1
+
 #
 # Initialisation prior to pulling the Mono repository
+# Attempt to ensure we don't try to convert line endings to Win32 CRLF as this will cause build to fail
 #
 init:
-    - 'echo Building Mono for Windows'
-    - 'echo System architecture: %PLATFORM%'
-    - 'echo Repo build branch is: %APPVEYOR_REPO_BRANCH%'
-    - 'echo Build folder is: %APPVEYOR_BUILD_FOLDER%'
-# Attempt to ensure we don't try to convert line endings to Win32 CRLF as this will cause build to fail
-    - 'git config --global core.autocrlf input'
+    - git config --global core.autocrlf input
 
 #
 # Install needed build dependencies
 # 
 install:
-# NOTE: Already installed on current Appveyor unstable image
-#    - 'echo Retrieving Cygwin'
-#   - 'appveyor DownloadFile http://cygwin.com/setup-x86.exe -FileName %CYGROOT%/setup-x86.exe'
-    - 'echo Setting up Cygwin dependencies'
-    - '%CYG_ROOT%\setup-x86.exe -qnNdO -R "%CYG_ROOT%" -s "%CYG_MIRROR%" -l "%CYG_CACHE%" -P autoconf -P automake -P bison -P gcc-core -P gcc-g++ -P mingw-runtime -P mingw-binutils -P mingw-gcc-core -P mingw-gcc-g++ -P mingw-pthreads -P mingw-w32api -P libtool -P make -P python -P gettext-devel -P gettext -P intltool -P libiconv -P pkg-config -P git -P wget -P curl > NUL' 
-    - 'echo Check Cygwin setup'
-    - '%CYG_ROOT%/bin/bash -lc "cygcheck -dc cygwin"'
-    - 'echo Done setting up Cygwin'
-    - 'echo Retrieving NSIS'
-    - 'appveyor DownloadFile "http://sunet.dl.sourceforge.net/project/nsis/NSIS 2/2.46/nsis-2.46-setup.exe" -FileName nsissetup.exe'
-    - 'echo Setting up NSIS'
-    - 'nsissetup.exe /S /D=%NSIS_ROOT%'
-    - 'echo Done setting up NSIS'
-
-#
-# NOTE: msbuild doesn't work at present so use Cygwin to build
-#
-#build:
-#    project: C:\projects\mono\msvc\mono.sln 
-#    verbosity: detailed
+    - ps: 'Start-FileDownload "http://cygwin.com/setup-x86.exe" -FileName "setup-x86.exe"'
+    - 'setup-x86.exe --quiet-mode --no-shortcuts --only-site --root "%CYG_ROOT%" --site "%CYG_MIRROR%" --local-package-dir "%CYG_CACHE%" --packages autoconf,automake,bison,gcc-core,gcc-g++,mingw-runtime,mingw-binutils,mingw-gcc-core,mingw-gcc-g++,mingw-pthreads,mingw-w32api,libtool,make,python,gettext-devel,gettext,intltool,libiconv,pkg-config,git,curl,libxslt > NUL 2>&1'
+    - '%CYG_BASH% -lc "cygcheck -dc cygwin"'
 
 # Cygwin build script
 #
@@ -59,35 +46,29 @@ install:
 #
 # The stdin/stdout file descriptor appears not to be valid for the Appveyor
 # build which causes failures as certain functions attempt to redirect 
-# default file handles. Ensure a dummy file descriptor is opened with exec.
+# default file handles. Ensure a dummy file descriptor is opened with 'exec'.
 #
 build_script:
-    - cmd: 'echo Cygwin root is: %CYG_ROOT%'
-    - cmd: 'echo Build folder is: %APPVEYOR_BUILD_FOLDER%'
-    - cmd: 'echo Repo build branch is: %APPVEYOR_REPO_BRANCH%'
-    - cmd: 'echo Repo build commit is: %APPVEYOR_REPO_COMMIT%'
-    - cmd: 'echo Autogen running...'
-    - cmd: '%CYG_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; NOCONFIGURE=1 ./autogen.sh --prefix=/usr/local --with-preview=yes"'
-    - cmd: 'echo Configure running...'
-    - cmd: '%CYG_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; ./configure --host=i686-pc-mingw32"'
-    - cmd: 'echo Pulling monolite latest...'
-    - cmd: '%CYG_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; make get-monolite-latest"'
-    - cmd: 'echo Make running...'
-    - cmd: '%CYG_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; make"'
-    - cmd: 'echo Installing...'
-    - cmd: 'mkdir %APPVEYOR_BUILD_FOLDER%\install'
-    - cmd: '%CYG_ROOT%/bin/bash --login -lc "export CYGWIN=winsymlinks:native; mount \"$APPVEYOR_BUILD_FOLDER\install\" /usr/local; cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; make install; umount /usr/local"'
-#    - cmd: 'echo Building package...'
-#    - cmd: 'cd %APPVEYOR_BUILD_FOLDER%'
-#    - cmd: '%NSIS_ROOT%\makensis /DMILESTONE=%APPVEYOR_REPO_BRANCH% /DSOURCE_INSTALL_DIR=%APPVEYOR_BUILD_FOLDER\install\*.* /DBUILDNUM=%APPVEYOR_BUILD_VERSION% monowiz.win32.nsi'
-#    - cmd: 'Building distribution...'
-#    - cmd: '%CYG_ROOT%/bin/bash -lc "export CYGWIN=winsymlinks:native; cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; make dist"'
+    - 'echo Building...'
+    - '%CYG_BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; ./autogen.sh --prefix=/usr/local --host=i686-pc-mingw32"'
+    - '%CYG_BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; make get-monolite-latest"'
+    - '%CYG_BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; make -j2"'
+    - 'echo Installing...'
+    - 'mkdir %APPVEYOR_BUILD_FOLDER%\install'
+    - '%CYG_BASH% -lc "export CYGWIN=winsymlinks:native; mount \"$APPVEYOR_BUILD_FOLDER\install\" /usr/local; cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; make install; umount /usr/local"'
 
 #
 # Disable tests for now
 # 
 test: off
 
+#
+# Only build the master branch
+#
+branches:
+  only:
+    - master
+
 #
 # NOTE: Currently this is the Mono installation tree. In future we will create an installation package artifact.
 #       It has to be relative to the project path. Thus we have installed to within the build tree.