Skip to content

Commit

Permalink
Fix the exit()
Browse files Browse the repository at this point in the history
  • Loading branch information
Suszyński Krzysztof authored and cardil committed Mar 29, 2016
1 parent 1297157 commit aeec87e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
12 changes: 7 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ notifications:
matrix:
include:
- jdk: openjdk6
env: JACOCO=true COVERALLS=true
env: JACOCO=true
- jdk: openjdk7
env: JACOCO=true COVERALLS=true
- jdk: oraclejdk7
env: JACOCO=true COVERALLS=true
env: JACOCO=true
- jdk: oraclejdk8
env: JACOCO=true COVERALLS=true
env: JACOCO=true
- jdk: openjdk7
env: JACOCO=true GDMSESSION=sonar
- jdk: openjdk7
env: JACOCO=true GDMSESSION=sonar SONAR_ANALYSIS_MODE=publish
script: mvn clean install -Dsonar.analysis.mode=publish --fail-at-end
env: JACOCO=true SONAR=publish
script: mvn clean install sonar:sonar --fail-at-end
- jdk: openjdk6
env: JACOCO=false
- jdk: openjdk7
Expand Down
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@

<profiles>
<profile>
<id>ci</id>
<id>jacoco</id>
<activation>
<property>
<name>env.JACOCO</name>
Expand Down Expand Up @@ -389,6 +389,7 @@
<defaults>
<sonar.issues.file>${sonar.working.directory}/${sonar.report.export.path}
</sonar.issues.file>
<sonar.skip>${sonar.skip}</sonar.skip>
</defaults>
<source>${project.basedir}/src/test/groovy/verify-sonar-issues.groovy</source>
</configuration>
Expand Down
18 changes: 9 additions & 9 deletions src/test/groovy/verify-sonar-issues.groovy
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import groovy.json.JsonSlurper

propertyName = 'sonar.issues.file'
filepath = new File(properties.getAt(propertyName))
log.info('Sonar Issues file: ' + filepath)
if (!filepath.canRead()) {
log.warn('Cant read issues file: ' + filepath)
exit(0)
String skip = properties.getAt('sonar.skip')
if (skip == 'true') {
log.info('sonar.skip = true: Skipping Sonar issues file analysis.')
return;
}

def slurper = new JsonSlurper()
def contents = filepath.getText('UTF-8')
String issueFile = properties.getAt('sonar.issues.file')
filepath = new File(issueFile)
log.info('Sonar Issues file: ' + filepath)
JsonSlurper slurper = new JsonSlurper()
String contents = filepath.getText('UTF-8')
def json = slurper.parseText(contents)

def major = 0
Expand Down

0 comments on commit aeec87e

Please sign in to comment.