From f4475012a5e16aa36ec13d9171f5d7bdb7d77f08 Mon Sep 17 00:00:00 2001 From: Nikita Tsukanov Date: Fri, 26 Aug 2016 05:21:38 +0300 Subject: [PATCH 1/3] Updated gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 16afffe74a..a510c4e49f 100644 --- a/.gitignore +++ b/.gitignore @@ -159,3 +159,4 @@ $RECYCLE.BIN/ tools/ .nuget artifacts/ +nuget From 172cdb60bead16f4c6252e48b84636294c34f724 Mon Sep 17 00:00:00 2001 From: Nikita Tsukanov Date: Fri, 26 Aug 2016 05:28:33 +0300 Subject: [PATCH 2/3] Don't depend on git binary to be present in PATH --- build.cake | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/build.cake b/build.cake index e1e8cbb426..9b132ea5a9 100644 --- a/build.cake +++ b/build.cake @@ -129,16 +129,11 @@ var buildDirs = Information("Getting git modules:"); IEnumerable subModules; -var gitSettings = new ProcessSettings { Arguments = "config --file .gitmodules --get-regexp path", RedirectStandardOutput = true }; -var exitCode = StartProcess("git", gitSettings, out subModules); -if (exitCode != 0) -{ - throw new Exception("Failed to retrieve git submodule paths."); -} +var gitSettings = System.IO.File.ReadAllLines(".git/config"); -var ignoredSubModulesPaths = subModules.Select(m => +var ignoredSubModulesPaths = gitSettings.Where(m=>m.StartsWith("[submodule ")).Select(m => { - var path = m.Split(' ')[1]; + var path = m.Split(' ')[1].Trim("\"[] \t".ToArray()); Information(path); return ((DirectoryPath)Directory(path)).FullPath; }).ToList(); From 07a8e2f98739a5f53ec31a889f0205dfb85a416d Mon Sep 17 00:00:00 2001 From: Nikita Tsukanov Date: Fri, 26 Aug 2016 05:40:15 +0300 Subject: [PATCH 3/3] Allow to skip unit tests from cake build --- build.cake | 7 ++++++- build.ps1 | 10 +++++++++- build.sh | 4 +++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/build.cake b/build.cake index 9b132ea5a9..bda4663ec1 100644 --- a/build.cake +++ b/build.cake @@ -29,7 +29,7 @@ using NuGet; var target = Argument("target", "Default"); var platform = Argument("platform", "Any CPU"); var configuration = Argument("configuration", "Release"); - +var skipTests = HasArgument("skip-tests"); /////////////////////////////////////////////////////////////////////////////// // CONFIGURATION /////////////////////////////////////////////////////////////////////////////// @@ -623,6 +623,11 @@ Task("Run-Unit-Tests") .IsDependentOn("Build") .Does(() => { + if(skipTests) + { + Information("Skipping unit tests because of -skip-tests"); + return; + } var pattern = "./tests/Avalonia.*.UnitTests/bin/" + dirSuffix + "/Avalonia.*.UnitTests.dll"; Func ExcludeWindowsTests = i => { diff --git a/build.ps1 b/build.ps1 index c0f9714b91..0c5ab81334 100644 --- a/build.ps1 +++ b/build.ps1 @@ -32,6 +32,8 @@ No tasks will be executed. Tells Cake to use the Mono scripting engine. .PARAMETER SkipToolPackageRestore Skips restoring of packages. +.PARAMETER SkipTests +Skips unit tests .PARAMETER ScriptArgs Remaining arguments are added here. @@ -117,6 +119,12 @@ if($WhatIf.IsPresent) { $UseDryRun = "-dryrun" } +# Is this a dry run? +$UseSkipTests = ""; +if($SkipTests.IsPresent) { + $UseSkipTests = "-skip-tests" +} + # Make sure tools folder exists if ((Test-Path $PSScriptRoot) -and !(Test-Path $TOOLS_DIR)) { Write-Verbose -Message "Creating tools directory..." @@ -189,5 +197,5 @@ if (!(Test-Path $CAKE_EXE)) { # Start Cake Write-Host "Running build script..." -Invoke-Expression "& `"$CAKE_EXE`" `"$Script`" -target=`"$Target`" -platform=`"$Platform`" -configuration=`"$Configuration`" -verbosity=`"$Verbosity`" $UseMono $UseDryRun $UseExperimental $ScriptArgs" +Invoke-Expression "& `"$CAKE_EXE`" `"$Script`" -target=`"$Target`" -platform=`"$Platform`" -configuration=`"$Configuration`" -verbosity=`"$Verbosity`" $UseSkipTests $UseMono $UseDryRun $UseExperimental $ScriptArgs" exit $LASTEXITCODE \ No newline at end of file diff --git a/build.sh b/build.sh index c9c9637e1f..9447781b55 100755 --- a/build.sh +++ b/build.sh @@ -29,6 +29,7 @@ CONFIGURATION="Release" PLATFORM="Any CPU" VERBOSITY="verbose" DRYRUN= +SKIP_TESTS= SHOW_VERSION=false SCRIPT_ARGUMENTS=() @@ -39,6 +40,7 @@ for i in "$@"; do -t|--target) TARGET="$2"; shift ;; -p|--platform) PLATFORM="$2"; shift ;; -c|--configuration) CONFIGURATION="$2"; shift ;; + --skip-tests) SKIP_TESTS="-skip-tests"; shift ;; -v|--verbosity) VERBOSITY="$2"; shift ;; -d|--dryrun) DRYRUN="-dryrun" ;; --version) SHOW_VERSION=true ;; @@ -99,5 +101,5 @@ fi if $SHOW_VERSION; then exec mono "$CAKE_EXE" -version else - exec mono "$CAKE_EXE" $SCRIPT -verbosity=$VERBOSITY -platform="$PLATFORM" -configuration="$CONFIGURATION" -target=$TARGET $DRYRUN "${SCRIPT_ARGUMENTS[@]}" + exec mono "$CAKE_EXE" $SCRIPT -verbosity=$VERBOSITY -platform="$PLATFORM" -configuration="$CONFIGURATION" -target=$TARGET $DRYRUN SKIP_TESTS "${SCRIPT_ARGUMENTS[@]}" fi