1
0

splitting up build.gradle - step 1

This commit is contained in:
Michael Hoennig
2019-04-30 07:52:37 +02:00
parent de6c7c5d4a
commit 29a2178a48
6 changed files with 150 additions and 147 deletions

84
build-jacoco.gradle Normal file
View File

@@ -0,0 +1,84 @@
// Checks code coverage of JUnit based tests.
apply plugin: 'jacoco'
jacoco {
toolVersion = "0.8.3a"
}
test.finalizedBy jacocoTestReport
check.dependsOn jacocoTestCoverageVerification
// Only for purely JHipster/MapStruct generated classes.
// Please do NOT add any self coded classes!
// Keep in mind, git will blame you ;-)
def jhipsterGeneratedClassesWithDecentCoverage = [
'org.hostsharing.hsadminng.repository.CustomAuditEventRepository',
'org.hostsharing.hsadminng.service.ContactQueryService',
'org.hostsharing.hsadminng.service.UserService',
'org.hostsharing.hsadminng.service.CustomerContactQueryService'
]
// Only for purely JHipster/MapStruct generated classes.
// Please do NOT add any self coded classes!
// Keep in mind, git will blame you ;-)
def jhipsterGeneratedClassesWithLowCoverage = [
'org.hostsharing.hsadminng.service.MailService',
'org.hostsharing.hsadminng.security.SecurityUtils',
'org.hostsharing.hsadminng.config.DefaultProfileUtil',
'org.hostsharing.hsadminng.config.WebConfigurer',
'org.hostsharing.hsadminng.web.rest.AccountResource',
'org.hostsharing.hsadminng.web.rest.errors.ExceptionTranslator',
'org.hostsharing.hsadminng.web.rest.errors.CustomParameterizedException',
'org.hostsharing.hsadminng.config.audit.AuditEventConverter',
'org.hostsharing.hsadminng.security.jwt.TokenProvider',
'org.hostsharing.hsadminng.aop.logging.LoggingAspect',
'org.hostsharing.hsadminng.HsadminNgApp',
'*.*QueryService',
'*.*Configuration',
'*MapperImpl',
'*Criteria',
'*_'
]
def specialExceptions = [
// lots of unreachable code due to error handling / verifications
'org.hostsharing.hsadminng.service.accessfilter.JSonAccessFilter',
'org.hostsharing.hsadminng.service.util.ReflectionUtil'
]
jacocoTestCoverageVerification {
violationRules {
rule {
element = 'CLASS'
limit {
counter = 'BRANCH'
value = 'COVEREDRATIO'
// Increasing the threshold is fine, decreasing is not.
// Keep in mind, git will blame you ;-)
minimum = 0.95
}
excludes = jhipsterGeneratedClassesWithDecentCoverage + jhipsterGeneratedClassesWithLowCoverage + specialExceptions
}
rule {
element = 'CLASS'
limit {
counter = 'BRANCH'
value = 'COVEREDRATIO'
minimum = 0.80
}
includes = jhipsterGeneratedClassesWithDecentCoverage
}
rule {
element = 'CLASS'
limit {
counter = 'LINE'
value = 'COVEREDRATIO'
minimum = 0.85
}
includes = specialExceptions
}
}
}