Skip to content

Commit

Permalink
Jacoco report generated from subproject reports
Browse files Browse the repository at this point in the history
  • Loading branch information
Felipe444 committed Apr 9, 2019
1 parent 6395fea commit cc9f68d
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 35 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ cache:

jobs:
include:
- stage: build vaunt-generator with gradle & generate reports
- stage: build vaunt with gradle & generate reports
script:
- ./gradlew clean build jacocoTestReport coveralls
- ./gradlew clean build jacocoRootReport coveralls
59 changes: 47 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ buildscript {
mavenLocal()
mavenCentral()
}
groovyAllVersion = '2.4.13'
spockVersion = '1.1-groovy-2.4'
coverallsVersion = '2.8.2'
}
repositories (repos)
Expand All @@ -13,20 +15,53 @@ buildscript {
}
}

subprojects {
allprojects {
repositories (repos)

apply plugin: 'java'
apply from: '../gradle/codequality.gradle'

buildscript {
ext {
repos = {
gradlePluginPortal()
mavenLocal()
mavenCentral()
}
apply plugin: 'groovy'
apply plugin: 'jacoco'
apply plugin: 'checkstyle'
apply plugin: 'com.github.kt3k.coveralls'

jacoco {
toolVersion = "0.8.1"
}

checkstyle {
toolVersion "8.1"
}
}

subprojects {
dependencies {
testCompile "org.spockframework:spock-core:$spockVersion"
testCompile "org.codehaus.groovy:groovy-all:$groovyAllVersion"
}

jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
repositories (repos)
}
}

repositories(repos)
coveralls {
sourceDirs = subprojects.sourceSets.main.allSource.srcDirs.flatten()
jacocoReportPath = "${buildDir}/reports/jacoco/jacocoRootReport/jacocoRootReport.xml"
}

task jacocoRootReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) {
dependsOn = subprojects.test

additionalSourceDirs = files(subprojects.sourceSets.main.allSource.srcDirs)
sourceDirectories = files(subprojects.sourceSets.main.allSource.srcDirs)
classDirectories = files(subprojects.sourceSets.main.output)
executionData = files(subprojects.jacocoTestReport.executionData)

reports {
xml.enabled = true
html.enabled = true
}
}
20 changes: 0 additions & 20 deletions gradle/codequality.gradle

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@ import spock.lang.Specification

class AppSpec extends Specification {

def 'sample test'() {
expect:
App.main("123")
}

}
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package com.hltech.vaunt.validator

import spock.lang.Specification
import spock.lang.Subject

class AppSpec extends Specification {

def 'sample test'() {
expect:
App.main("123")
}
}

0 comments on commit cc9f68d

Please sign in to comment.