From 8a674181be1c8c710c699e9ea46c5490ab59869f Mon Sep 17 00:00:00 2001 From: Leonardo Galli Date: Mon, 12 Feb 2018 17:31:18 +0100 Subject: [PATCH] @cosmetic Staged builds & upload artifacts. --- .circleci/config.yml | 23 +++++++++++++++-- build.sh | 59 +++++++++++++++++++++++++++++++++++++------- 2 files changed, 71 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 37c1a9f06..5cfe88cc9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,12 +7,31 @@ jobs: steps: - checkout - run: git submodule update --init --recursive + - run: + name: Prepare Build + command: ./build.sh PrepareBuild - run: name: Build - command: ./build.sh - - run: mkdir _tests/reports + command: ./build.sh Build + - run: + name: Gulp + command: ./build.sh Gulp + - run: + name: Package + command: ./build.sh Package + - run: + name: Preparing Tests + command: mkdir _tests/reports - run: name: Testing command: ./test.sh Linux Unit - store_test_results: path: _tests/reports/ + - store_artifacts: + path: _output + - store_artifacts: + path: _output_mono + - store_artifacts: + path: _output_osx + - store_artifacts: + path: _output_osx_app diff --git a/build.sh b/build.sh index 6d2ab0305..98bda8c41 100755 --- a/build.sh +++ b/build.sh @@ -69,11 +69,21 @@ BuildWithMSBuild() CheckExitCode MSBuild.exe $slnFile //p:Configuration=Release //p:Platform=x86 //t:Build //m //p:AllowedReferenceRelatedFileExtensions=.pdb } -BuildWithXbuild() +RestoreNuget() { export MONO_IOMAP=case - CheckExitCode xbuild /t:Clean $slnFile mono $nuget restore $slnFile +} + +CleanWithXbuild() +{ + export MONO_IOMAP=case + CheckExitCode xbuild /t:Clean $slnFile +} + +BuildWithXbuild() +{ + export MONO_IOMAP=case CheckExitCode xbuild /p:Configuration=Release /p:Platform=x86 /t:Build /p:AllowedReferenceRelatedFileExtensions=.pdb $slnFile } @@ -86,6 +96,8 @@ Build() if [ $runtime = "dotnet" ] ; then BuildWithMSBuild else + CleanWithXbuild + RestoreNuget BuildWithXbuild fi @@ -256,10 +268,39 @@ case "$(uname -s)" in ;; esac -Build -RunGulp -PackageMono -PackageOsx -PackageOsxApp -PackageTests -CleanupWindowsPackage +if [ $# -eq 0 ] + then + Build + RunGulp + PackageMono + PackageOsx + PackageOsxApp + PackageTests + CleanupWindowsPackage + exit 0 +fi + +if [ "$1" -eq "PrepareBuild" ] +then rm -rf $outputFolder + CleanWithXbuild + RestoreNuget +fi + +if [ "$1" -eq "Build" ] +then BuildWithXbuild + CleanFolder $outputFolder false + AddJsonNet + rm $outputFolder/Mono.Posix.dll +fi + +if [ "$1" -eq "Gulp" ] +then RunGulp +fi + +if [ "$1" -eq "Package" ] +then PackageMono + PackageOsx + PackageOsxApp + PackageTests + CleanupWindowsPackage +fi