@@ -12,9 +12,16 @@ buildscript {
1212 }
1313 dependencies {
1414 classpath " com.haulmont.gradle:cuba-plugin:$cubaVersion "
15+
16+
17+ classpath ' net.saliman:gradle-cobertura-plugin:2.5.0'
18+ classpath " org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.2"
1519 }
1620}
1721
22+
23+ apply plugin : " com.github.kt3k.coveralls"
24+
1825def globalModule = project(' :user-inbox-global' )
1926def coreModule = project(' :user-inbox-core' )
2027def guiModule = project(' :user-inbox-gui' )
@@ -26,6 +33,10 @@ def servletApi = 'org.apache.tomcat:tomcat-servlet-api:8.0.26'
2633apply(plugin : ' idea' )
2734apply(plugin : ' cuba' )
2835
36+
37+ def bintrayRepositoryUrl = " https://api.bintray.com/maven/mariodavid/cuba-components/cuba-component-user-inbox/;publish=1"
38+
39+
2940cuba {
3041 artifact {
3142 group = ' de.diedavids.cuba.userinbox'
@@ -35,6 +46,16 @@ cuba {
3546 tomcat {
3647 dir = " $project . rootDir /deploy/tomcat"
3748 }
49+ uploadRepository {
50+ if (cuba. artifact. isSnapshot) {
51+ url = System . properties[' uploadRepositorySnapshot' ] ?: System . env. UPLOAD_REPOSITORY_SNAPSHOT
52+ } else {
53+ url = System . properties[' uploadRepositoryRelease' ] ?: System . env. UPLOAD_REPOSITORY_RELEASE ?: bintrayRepositoryUrl
54+ }
55+
56+ user = System . properties[' uploadRepositoryUsername' ] ?: System . env. UPLOAD_REPOSITORY_USERNAME
57+ password = System . properties[' uploadRepositoryPassword' ] ?: System . env. UPLOAD_REPOSITORY_PASSWORD
58+ }
3859 ide {
3960 vcs = ' Git'
4061 }
@@ -47,6 +68,39 @@ dependencies {
4768
4869def hsql = ' org.hsqldb:hsqldb:2.2.9'
4970
71+
72+ allprojects {
73+ apply plugin : ' net.saliman.cobertura'
74+ }
75+
76+
77+ def files = subprojects
78+ .findAll { ! it. name. toLowerCase(). contains(' theme' ) }
79+ .collect { new File (it. projectDir, ' /build/cobertura/cobertura.ser' )}
80+ def sourceDirs = subprojects
81+ .findAll { ! it. name. toLowerCase(). contains(' theme' ) }
82+ .collect { new File (it. projectDir, ' /src' )}
83+
84+ cobertura {
85+ coverageFormats = [' html' , ' xml' ]
86+ coverageMergeDatafiles = files
87+ coverageCheckTotalBranchRate = 0
88+ coverageCheckTotalLineRate = 0
89+ coverageCheckHaltOnFailure = true
90+ coverageSourceDirs = sourceDirs
91+ // coverageCheckLineRate = 1
92+ coverageCheckRegexes = [[regex : ' .*\\ $.*' , branchRate : 0 , lineRate : 0 ]]
93+
94+ }
95+
96+
97+ test. dependsOn(subprojects. collect{ " :${ it.name} :test" } )
98+ test. finalizedBy(project. tasks. cobertura)
99+ test. finalizedBy(project. tasks. coberturaCheck)
100+
101+
102+
103+
50104configure([globalModule, coreModule, guiModule, webModule]) {
51105 apply(plugin : ' java' )
52106 apply(plugin : ' maven' )
@@ -55,6 +109,11 @@ configure([globalModule, coreModule, guiModule, webModule]) {
55109
56110 dependencies {
57111 testCompile(' junit:junit:4.12' )
112+
113+
114+ testCompile(' org.spockframework:spock-core:1.0-groovy-2.4' )
115+ testCompile(' org.springframework:spring-test:4.3.1.RELEASE' )
116+ testRuntime " cglib:cglib-nodep:3.2.4"
58117 }
59118
60119 task sourceJar(type : Jar ) {
@@ -70,6 +129,39 @@ configure([globalModule, coreModule, guiModule, webModule]) {
70129configure([globalModule, coreModule, guiModule, webModule]) {
71130 apply(plugin : ' groovy' )
72131
132+ apply plugin : ' net.saliman.cobertura'
133+ apply plugin : ' codenarc'
134+
135+ codenarc {
136+ toolVersion = " 0.24"
137+ ignoreFailures = false
138+ reportFormat = ' html'
139+ reportsDir = new File (" ./build/reports/codenarc" )
140+ }
141+
142+ codenarcMain {
143+ configFile = rootProject. file(" config/codenarc/rulesMain.groovy" )
144+ }
145+ codenarcTest {
146+ configFile = rootProject. file(" config/codenarc/rulesTests.groovy" )
147+ }
148+
149+
150+ cobertura {
151+ coverageFormats = [' html' , ' xml' ]
152+ coverageIgnoreTrivial = true
153+ coverageIgnores = [' org.slf4j.Logger.*' ]
154+ coverageReportDir = new File (" $buildDir /reports/cobertura" )
155+
156+ coverageExcludes = [
157+ ' .*Generator' ,
158+ ' .*Enum' ,
159+ ' .*Hilfe.*' // Hilfe wird vorerst deaktiviert, da die Hilfe noch einem großen Refactoring unterliegt und dies bisher nur ein Proof of Concept ist
160+ ]
161+ }
162+
163+ test. finalizedBy(project. tasks. cobertura)
164+ test. finalizedBy(project. tasks. coberturaCheck)
73165 sourceSets {
74166 main { groovy { srcDirs = [" src" ] } }
75167 test { groovy { srcDirs = [" test" ] } }
@@ -225,3 +317,9 @@ task wrapper(type: Wrapper) {
225317}
226318
227319apply from : ' extra.gradle'
320+
321+
322+
323+ clean {
324+ delete = [' build/libs' , ' build/tmp' ]
325+ }
0 commit comments