From 03f3e5ec53e987547c4c5be63e0731f6c910c3d5 Mon Sep 17 00:00:00 2001
From: Robin Oppermann <robinopp@mail.uni-paderborn.de>
Date: Thu, 26 Jan 2017 21:01:30 +0100
Subject: [PATCH] Remove execution of tests when executing sonarqube

---
 .gitlab-ci.yml |  6 +++---
 build.gradle   | 14 ++++++++++++++
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c71712e7..ae4e0826 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -27,7 +27,7 @@ sonarqube:
   variables:
     GIT_STRATEGY: clone
   script:
-    - ./gradlew sonarqube -Dsonar.projectVersion=$CI_BUILD_REF
+    - ./gradlew sonarqube -Dsonar.projectVersion=$CI_BUILD_REF -x test
 
 sonarqube_manual:
   stage: analyze
@@ -35,14 +35,14 @@ sonarqube_manual:
   variables:
     GIT_STRATEGY: clone
   script:
-    - ./gradlew sonarqube -Dsonar.branch=$CI_BUILD_REF_NAME -Dsonar.projectVersion=$CI_BUILD_REF -Dsonar.profile=ANDI_Simulator
+    - ./gradlew sonarqube -Dsonar.branch=$CI_BUILD_REF_NAME -Dsonar.projectVersion=$CI_BUILD_REF -Dsonar.profile=ANDI_Simulator -x test
   
 sonarqube_preview:
   stage: analyze
   variables:
     GIT_STRATEGY: clone
   script:
-    - ./gradlew sonarqube -Dsonar.analysis.mode=preview -Dsonar.gitlab.project_id=$CI_PROJECT_ID -Dsonar.issuesReport.console.enable=true -Dsonar.gitlab.commit_sha=$CI_BUILD_REF -Dsonar.gitlab.ref=$CI_BUILD_REF_NAME
+    - ./gradlew sonarqube -Dsonar.analysis.mode=preview -Dsonar.gitlab.project_id=$CI_PROJECT_ID -Dsonar.issuesReport.console.enable=true -Dsonar.gitlab.commit_sha=$CI_BUILD_REF -Dsonar.gitlab.ref=$CI_BUILD_REF_NAME -x test
   allow_failure: true
 
 
diff --git a/build.gradle b/build.gradle
index b75768d7..8ccc8055 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,3 +1,17 @@
+buildscript {
+    repositories {
+        maven {
+            url "https://plugins.gradle.org/m2/"
+        }
+        jcenter()
+    }
+    dependencies {
+        classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.2.1"
+        // NOTE: Do not place your application dependencies here; they belong
+        // in the individual module build.gradle files
+    }
+}
+
 plugins {
     id "org.sonarqube" version "2.2.1"
 }
-- 
GitLab