benjaminbosko / storage-handler-service

Microservice to handle files stored in Google Drive of the user's account.
1 stars 0 forks source link

Introduce SonarQube #2

Open benjaminbosko opened 5 years ago

benjaminbosko commented 2 years ago
plugins {
    id 'java'
    id 'org.sonarqube' version '2.6.2'
    id 'checkstyle'
    id 'io.qameta.allure' version '2.5'
}

group 'test.testfx'
version '0.1.0'

test {
    dependsOn 'checkstyleTest'
    reports.html.enabled = false
    reports.junitXml.enabled = false
    testLogging.showStandardStreams = true
    if (System.getProperty('headless', true.toString()).toBoolean()) {
        systemProperty('java.awt.headless', 'true')
        systemProperty('testfx.robot', 'glass')
        systemProperty('testfx.headless', 'true')
        systemProperty('prism.order', 'sw')
        systemProperty('prism.text', 't2k')
        systemProperty('glass.platform', 'Monocle')
        systemProperty('monocle.platform', 'Headless')
        systemProperty('headless.geometry', '1920x1080-64')
    }
    useTestNG {
        final def xmlUri = new File("${sourceSets.test.output.resourcesDir}${File.separator}testng.xml").toURI()
        suites(new File("${project.projectDir}").toURI().relativize(xmlUri).path)
        useDefaultListeners = false
    }
    finalizedBy 'allureReport'
}

allure {
    version = '2.7.0'
    autoconfigure = true
    aspectjweaver = true
}

checkstyle {
    toolVersion = '8.11'
    config = resources.text.fromUri('http:/asd.com/checkstyle.xml')
    ignoreFailures = false
    maxWarnings = 0
    maxErrors = 0
}

sonarqube {
    properties {
        property 'sonar.projectKey', 'asd'
        property 'sonar.projectName', 'system-test'
        property 'sonar.sourceEncoding', 'UTF-8'
        property 'sonar.host.url', 'http://sonarqube.com'
        property 'sonar.binaries', '$buildDir/classes'
    }
}

sourceCompatibility = 9
targetCompatibility = 9
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'
final jaxbVersion = '2.3.0'
final jaxwsVersion = '2.3.0'

dependencies {
    compile files("app.jar")
    compile('io.qameta.allure:allure-testng:2.8.1')
    compile('xuggle:xuggle-xuggler:5.4')
    compile('org.testfx:testfx-core:4.0.15-alpha')
    testCompile('org.testng:testng:7.0.0-beta1')
    testRuntime('org.slf4j:slf4j-simple:1.7.25')
    testRuntime('org.aspectj:aspectjweaver:1.9.2')
    testRuntime('javax.annotation:javax.annotation-api:1.3.2')
    testRuntime("javax.xml.bind:jaxb-api:${jaxbVersion}")
    testRuntime("com.sun.xml.bind:jaxb-impl:${jaxbVersion}")
    testRuntime("javax.xml.ws:jaxws-api:${jaxwsVersion}")
    testRuntime("com.sun.xml.ws:jaxws-rt:${jaxwsVersion}")
    testRuntime('org.testfx:openjfx-monocle:jdk-9+181.1')
}
plugins {
    id 'java'
    id 'org.sonarqube' version '2.6.2'
    id 'checkstyle'
    id 'io.qameta.allure' version '2.5'
}

checkstyle {
    toolVersion = '8.11'
    config = resources.text.fromUri('http://asd.com/checkstyle.xml')
    ignoreFailures = false
    maxWarnings = 0
    maxErrors = 0
}

def codeCoverageExcludeFiles = [
    '**/asd/Asd.*',
    '**/asd/Application.*'
]

sonarqube {
    properties {
        property 'sonar.projectKey', 'asd'
        property 'sonar.projectName', 'asd'
        property 'sonar.sourceEncoding', 'UTF-8'
        property 'sonar.host.url', 'http://sonarqube.com'
        property 'sonar.binaries', '$buildDir/classes'
        property 'sonar.cpd.exclusions', 'src/main/java/asd/*.java'
        property 'sonar.coverage.exclusions', codeCoverageExcludeFiles.join(',')
    }
}

sourceSets {
    componentTest {
        java {
            srcDir file('src/component-test/java')
        }
        resources.srcDir file('src/component-test/resources')
    }
}

task componentTest(type: Test) {
    testClassesDirs = sourceSets.componentTest.output.classesDirs
    classpath = sourceSets.componentTest.runtimeClasspath
    outputs.upToDateWhen { false }
    reports.html.enabled = false
    reports.junitXml.enabled = false
    testLogging.showStandardStreams = true
    useTestNG {
        final def xmlUri = new File("${sourceSets.componentTest.output.resourcesDir}${File.separator}testng.xml").toURI()
        suites new File("${project.projectDir}").toURI().relativize(xmlUri).path
        useDefaultListeners = false
    }
    systemProperty('api.host', System.getProperty('api.host'))
    systemProperty('api.port', System.getProperty('api.port'))
    finalizedBy 'allureReport'
}

allure {
    version = '2.7.0'
    autoconfigure = true
    aspectjweaver = true
}

sourceCompatibility = 1.9
targetCompatibility = 1.9
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'
compileComponentTestJava.options.encoding = 'UTF-8'

dependencies {
    componentTestCompile('org.testng:testng:7.0.0-beta1')
    componentTestCompile('io.rest-assured:rest-assured:3.1.1')
    componentTestCompile('io.rest-assured:json-schema-validator:3.1.1')
    componentTestCompile('io.qameta.allure:allure-testng:2.7.0')
    componentTestCompile('com.google.code.gson:gson:2.8.5')
    componentTestCompile('org.json:json:20180813')
    componentTestCompile('org.springframework:spring-web')
    componentTestRuntime('commons-logging:commons-logging:1.2')
    componentTestRuntime('org.slf4j:slf4j-simple:1.7.25')
    componentTestRuntime('org.aspectj:aspectjweaver:1.9.1')
}