]> source.dussan.org Git - sonar-scanner-cli.git/commitdiff
SQSCANNER-8 Execute ITs on Windows using AppVeyor
authorDuarte Meneses <duarte.meneses@sonarsource.com>
Wed, 18 Nov 2015 10:52:28 +0000 (11:52 +0100)
committerDuarte Meneses <duarte.meneses@sonarsource.com>
Wed, 18 Nov 2015 10:52:28 +0000 (11:52 +0100)
appveyor.ps1 [new file with mode: 0644]
appveyor.yml [new file with mode: 0644]

diff --git a/appveyor.ps1 b/appveyor.ps1
new file mode 100644 (file)
index 0000000..d7ce18e
--- /dev/null
@@ -0,0 +1,29 @@
+$ErrorActionPreference = "Stop"
+
+function CheckLastExitCode
+{
+    param ([int[]]$SuccessCodes = @(0))
+
+    if ($SuccessCodes -notcontains $LastExitCode)
+       {
+        $msg = @"
+EXE RETURNED EXIT CODE $LastExitCode
+CALLSTACK:$(Get-PSCallStack | Out-String)
+"@
+        throw $msg
+    }
+}
+
+switch ($env:RUN)
+{
+       "ci"
+       {
+               mvn package "--batch-mode" "-B" "-e" "-V"
+               CheckLastExitCode
+       }
+
+       default
+       {
+               throw "Unexpected test mode: ""$env:RUN"""
+       }
+}
diff --git a/appveyor.yml b/appveyor.yml
new file mode 100644 (file)
index 0000000..87f9785
--- /dev/null
@@ -0,0 +1,22 @@
+version: 1.0.{build}
+
+branches:
+  only:
+  - master
+
+cache:
+  - C:\Users\appveyor\.m2 -> **\pom.xml
+
+install:
+  - set MAVEN_VERSION=3.2.5
+  - choco install maven -version %MAVEN_VERSION%
+  - set PATH=%PATH%;C:\bin\apache-maven-%MAVEN_VERSION%\bin
+  - echo %JAVA_HOME%
+
+environment:
+  matrix:
+  - RUN: ci
+    JAVA_HOME: C:\Program Files\Java\jdk1.7.0
+
+build_script:
+  - ps: ./appveyor.ps1