Skip to content
Snippets Groups Projects
Commit dc0981a3 authored by Robin Oppermann's avatar Robin Oppermann
Browse files

Add missing source folders to gradle script and include sonarqube task/plugin

Up to now, the gradle script only used src/main as source and src/test as testing directory (default settings). I added the missing source folders into the source set. When starting the build, gradle is missing the package "fi.tkk.netlab.dtn.ecla", so the script fails.
I also added the sonarqube task to the build script, so as soon as the build is running, the sonarqube analysis should be working as well.
parent 6be3d6ce
No related branches found
No related tags found
1 merge request!3Ci setup
Pipeline #
......@@ -15,3 +15,6 @@ doc/package-list
.project
/target/
.settings/org.eclipse.*
.idea/
.gradle/
build/
......@@ -15,6 +15,37 @@ before_script:
# cleaning removes reminants of any cached builds.
# The assemble task actually builds the project.
# If it fails here, the tests can't run.
stages:
- analyze
- build
- test
sonarqube:
stage: analyze
only:
- master
variables:
GIT_STRATEGY: clone
script:
- ./gradlew sonarqube -Dsonar.projectVersion=$CI_BUILD_REF
sonarqube_manual:
stage: analyze
when: manual
variables:
GIT_STRATEGY: clone
script:
- ./gradlew sonarqube -Dsonar.branch=$CI_BUILD_REF_NAME -Dsonar.projectVersion=$CI_BUILD_REF -Dsonar.profile=ANDI_Simulator
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
allow_failure: true
build:
stage: build
script:
......
File deleted
File deleted
File deleted
File deleted
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
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"
}
apply plugin: 'java'
apply plugin: "org.sonarqube"
allprojects {
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
maven {
url "https://plugins.gradle.org/m2/"
}
jcenter()
}
}
sourceSets {
main {
java {
srcDirs = ["src/applications", "src/core", "src/gui", "src/input", "src/interfaces", "src/main", "src/movement", "src/report", "src/routing", "src/ui", "src/util"]
}
}
test {
java {
srcDirs = ["src/test"]
}
}
}
dependencies {
// The production code uses Guava
......@@ -13,4 +49,3 @@ dependencies {
// Use JUnit test framework
testCompile 'junit:junit:4.12'
}
\ No newline at end of file
systemProp.sonar.host.url=http://pg-andi-redmine.cs.upb.de:9000
systemProp.sonar.verbose=true
systemProp.sonar.login=cd4b5ee1fc6a8dfe089c350184fdd715d6cfb28b
systemProp.sonar.projectName=ANDI Simulator
systemProp.sonar.projectKey=de.upb.cs.andi.simulator
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment