Skip to content

Commit

Permalink
try with jacoco
Browse files Browse the repository at this point in the history
Signed-off-by: BAStos525 <[email protected]>
  • Loading branch information
BAStos525 committed Sep 4, 2024
1 parent ce65159 commit 393c215
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/iroha2-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-
- name: Test Sonarqube with Gradle
run: ./gradlew clean test --continue jacocoTestReport sonarqube -Dsonar.token=${{ secrets.SONAR_TOKEN }}
run: ./gradlew --debug clean build sonar -Dsonar.token=${{ secrets.SONAR_TOKEN }}
# - name: SonarQube
# uses: sonarsource/sonarqube-scan-action@master
# env:
Expand Down
50 changes: 15 additions & 35 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ subprojects {
apply plugin: 'org.jetbrains.kotlin.jvm'
apply plugin: 'org.jmailen.kotlinter'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'jacoco'
apply plugin: 'org.sonarqube'

publishing {
publications {
Expand All @@ -57,10 +55,9 @@ subprojects {
group = 'jp.co.soramitsu.iroha2-java'
version = 'git rev-parse --short HEAD'.execute().text.trim()

test {
useJUnitPlatform()
finalizedBy jacocoTestReport
}
// test {
// useJUnitPlatform()
// }

java {
toolchain {
Expand Down Expand Up @@ -101,23 +98,6 @@ subprojects {
// uncomment to produce shadowJar build by default
// it is disabled by default to publish original version by CI, not a fat jar
tasks.shadowJar.enabled = false

// jacocoTestReport {
// dependsOn test
// reports {
// xml.required = true
// csv.required = false
// html.required = false
// xml.outputLocation = file("$project.buildDir/reports/jacoco/coverage.xml")
// }
// }

// sonar {
// properties {
// property "sonar.projectKey", "hyperledger:iroha-java"
// property "sonar.host.url", "https://sonar.soramitsu.co.jp"
// }
// }
}

task allShadowJars {
Expand All @@ -128,24 +108,24 @@ check {
dependsOn "installKotlinterPrePushHook"
}

test {
tasks.test {
useJUnitPlatform()
finalizedBy jacocoTestReport
finalizedBy (tasks.jacocoTestReport)
}

jacocoTestReport {
dependsOn test
tasks.jacocoTestReport {
dependsOn (tasks.test)
reports {
xml.required = true
csv.required = false
html.required = false
xml.outputLocation = file("$project.buildDir/reports/jacoco/coverage.xml")
// csv.required = false
// html.required = false
// xml.outputLocation = file("$project.buildDir/reports/jacoco/coverage.xml")
}
}

sonarqube {
properties {
property "sonar.projectKey", "hyperledger:iroha-java"
property "sonar.host.url", "https://sonar.soramitsu.co.jp"
}
sonar {
properties {
property "sonar.projectKey", "hyperledger:iroha-java"
property "sonar.host.url", "https://sonar.soramitsu.co.jp"
}
}

0 comments on commit 393c215

Please sign in to comment.