Skip to content

Commit

Permalink
add changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gtebrean committed Aug 18, 2023
1 parent 5cda8b0 commit 9766d4d
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build
run: ./gradlew check jacocoRootTestReport
run: ./gradlew jacocoRootReport
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3
30 changes: 15 additions & 15 deletions abi/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ dependencies {

tasks.named("spotlessJava").configure { dependsOn("spotlessGroovyGradle","compileJava","compileTestJava","javadoc","test") }
tasks.named("spotlessKotlin").configure { dependsOn("compileJava","spotlessJava", "spotlessGroovyGradle","compileTestJava","processTestResources","javadoc","test") }
tasks.named("jacocoRootTestReport").configure { dependsOn("compileJava","compileTestJava","javadoc","test", "spotlessGroovyGradle", "spotlessKotlin","spotlessJava") }
tasks.named("jacocoRootTestReport").configure { dependsOn(":besu:compileJava",":besu:compileTestJava",":besu:javadoc",":besu:test", ":besu:spotlessGroovyGradle", ":besu:spotlessJava",":besu:spotlessKotlin") }
tasks.named("jacocoRootTestReport").configure { dependsOn(":test",":spotlessGroovyGradle",":spotlessJava",":spotlessKotlin") }
tasks.named("jacocoRootTestReport").configure { dependsOn(":codegen:compileJava",":codegen:compileTestJava",":codegen:javadoc",":codegen:test",":codegen:processTestResources",":codegen:spotlessGroovyGradle", ":codegen:spotlessJava",":codegen:spotlessKotlin") }
tasks.named("jacocoRootTestReport").configure { dependsOn(":contracts:compileJava",":contracts:javadoc",":contracts:test",":contracts:processResources",":contracts:spotlessGroovyGradle", ":contracts:spotlessJava",":contracts:spotlessKotlin") }
tasks.named("jacocoRootTestReport").configure { dependsOn(":core:javadoc",":core:test",":core:spotlessGroovyGradle", ":core:spotlessJava",":core:spotlessKotlin") }
tasks.named("jacocoRootTestReport").configure { dependsOn(":crypto:javadoc",":crypto:test",":crypto:spotlessGroovyGradle", ":crypto:spotlessJava",":crypto:spotlessKotlin") }
tasks.named("jacocoRootTestReport").configure { dependsOn(":eea:compileTestJava",":eea:javadoc",":eea:test",":eea:spotlessGroovyGradle", ":eea:spotlessJava",":eea:spotlessKotlin") }
tasks.named("jacocoRootTestReport").configure { dependsOn(":geth:compileJava",":geth:compileTestJava",":geth:javadoc",":geth:test",":geth:spotlessGroovyGradle", ":geth:spotlessJava",":geth:spotlessKotlin") }
tasks.named("jacocoRootTestReport").configure { dependsOn(":hosted-providers:compileJava",":hosted-providers:compileTestJava",":hosted-providers:javadoc",":hosted-providers:test",":hosted-providers:spotlessGroovyGradle", ":hosted-providers:spotlessJava",":hosted-providers:spotlessKotlin") }
tasks.named("jacocoRootTestReport").configure { dependsOn(":integration-tests:compileTestJava",":integration-tests:processTestResources",":integration-tests:spotlessGroovyGradle", ":integration-tests:spotlessJava",":integration-tests:spotlessKotlin") }
tasks.named("jacocoRootTestReport").configure { dependsOn(":parity:compileJava",":parity:compileTestJava",":parity:javadoc",":parity:test",":parity:spotlessGroovyGradle", ":parity:spotlessJava",":parity:spotlessKotlin") }
tasks.named("jacocoRootTestReport").configure { dependsOn(":rlp:compileTestJava",":rlp:javadoc",":rlp:test",":rlp:spotlessGroovyGradle", ":rlp:spotlessJava",":rlp:spotlessKotlin") }
tasks.named("jacocoRootTestReport").configure { dependsOn(":tuples:javadoc",":tuples:test",":tuples:spotlessGroovyGradle", ":tuples:spotlessJava",":tuples:spotlessKotlin") }
tasks.named("jacocoRootTestReport").configure { dependsOn(":utils:javadoc",":utils:test",":utils:spotlessGroovyGradle", ":utils:spotlessJava",":utils:spotlessKotlin") }
tasks.named("jacocoRootReport").configure { dependsOn("compileJava","compileTestJava","javadoc","test", "spotlessGroovyGradle", "spotlessKotlin","spotlessJava") }
tasks.named("jacocoRootReport").configure { dependsOn(":besu:compileJava",":besu:compileTestJava",":besu:javadoc",":besu:test", ":besu:spotlessGroovyGradle", ":besu:spotlessJava",":besu:spotlessKotlin") }
tasks.named("jacocoRootReport").configure { dependsOn(":test",":spotlessGroovyGradle",":spotlessJava",":spotlessKotlin") }
tasks.named("jacocoRootReport").configure { dependsOn(":codegen:compileJava",":codegen:compileTestJava",":codegen:javadoc",":codegen:test",":codegen:processTestResources",":codegen:spotlessGroovyGradle", ":codegen:spotlessJava",":codegen:spotlessKotlin") }
tasks.named("jacocoRootReport").configure { dependsOn(":contracts:compileJava",":contracts:javadoc",":contracts:test",":contracts:processResources",":contracts:spotlessGroovyGradle", ":contracts:spotlessJava",":contracts:spotlessKotlin") }
tasks.named("jacocoRootReport").configure { dependsOn(":core:javadoc",":core:test",":core:spotlessGroovyGradle", ":core:spotlessJava",":core:spotlessKotlin") }
tasks.named("jacocoRootReport").configure { dependsOn(":crypto:javadoc",":crypto:test",":crypto:spotlessGroovyGradle", ":crypto:spotlessJava",":crypto:spotlessKotlin") }
tasks.named("jacocoRootReport").configure { dependsOn(":eea:compileTestJava",":eea:javadoc",":eea:test",":eea:spotlessGroovyGradle", ":eea:spotlessJava",":eea:spotlessKotlin") }
tasks.named("jacocoRootReport").configure { dependsOn(":geth:compileJava",":geth:compileTestJava",":geth:javadoc",":geth:test",":geth:spotlessGroovyGradle", ":geth:spotlessJava",":geth:spotlessKotlin") }
tasks.named("jacocoRootReport").configure { dependsOn(":hosted-providers:compileJava",":hosted-providers:compileTestJava",":hosted-providers:javadoc",":hosted-providers:test",":hosted-providers:spotlessGroovyGradle", ":hosted-providers:spotlessJava",":hosted-providers:spotlessKotlin") }
tasks.named("jacocoRootReport").configure { dependsOn(":integration-tests:compileTestJava",":integration-tests:processTestResources",":integration-tests:spotlessGroovyGradle", ":integration-tests:spotlessJava",":integration-tests:spotlessKotlin") }
tasks.named("jacocoRootReport").configure { dependsOn(":parity:compileJava",":parity:compileTestJava",":parity:javadoc",":parity:test",":parity:spotlessGroovyGradle", ":parity:spotlessJava",":parity:spotlessKotlin") }
tasks.named("jacocoRootReport").configure { dependsOn(":rlp:compileTestJava",":rlp:javadoc",":rlp:test",":rlp:spotlessGroovyGradle", ":rlp:spotlessJava",":rlp:spotlessKotlin") }
tasks.named("jacocoRootReport").configure { dependsOn(":tuples:javadoc",":tuples:test",":tuples:spotlessGroovyGradle", ":tuples:spotlessJava",":tuples:spotlessKotlin") }
tasks.named("jacocoRootReport").configure { dependsOn(":utils:javadoc",":utils:test",":utils:spotlessGroovyGradle", ":utils:spotlessJava",":utils:spotlessKotlin") }
71 changes: 45 additions & 26 deletions gradle/jacoco/build.gradle
Original file line number Diff line number Diff line change
@@ -1,34 +1,53 @@
apply plugin: 'jacoco'

task jacocoRootTestReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) {

doFirst {
executionData.fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec")
getExecutionData().from(executionData.findAll { it.exists() })
//task jacocoRootTestReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) {
//
// doFirst {
// executionData.fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec")
// getExecutionData().from(executionData.findAll { it.exists() })
// }
//
// dependsOn(subprojects.test)
//
// getSourceDirectories().from(subprojects.sourceSets.main.allSource.srcDirs)
// getAdditionalSourceDirs().from(subprojects.sourceSets.main.allSource.srcDirs)
// getClassDirectories().from(subprojects.sourceSets.main.output)
// executionData.from(subprojects.jacocoTestReport.executionData)
//
// reports {
// xml.enabled true
// }
//
// afterEvaluate {
// getClassDirectories().from(files(classDirectories.files.collect {
// fileTree(dir: it,
// exclude: [
// 'org/web3j/abi/datatypes/generated/**',
// 'org/web3j/tuples/generated/**',
// 'org/web3j/ens/contracts/generated/**',
// 'org/gradle/**'
// ])
// }))
// }
//}

task jacocoRootReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) {
additionalSourceDirs.from files(subprojects.sourceSets.main.allSource.srcDirs)
sourceDirectories.from files(subprojects.sourceSets.main.allSource.srcDirs)
classDirectories.from files(subprojects.sourceSets.main.output).asFileTree.matching {
exclude 'org/web3j/abi/datatypes/generated/**',
'org/web3j/tuples/generated/**',
'org/web3j/ens/contracts/generated/**',
'org/gradle/**'
}

dependsOn(subprojects.test)

getSourceDirectories().from(subprojects.sourceSets.main.allSource.srcDirs)
getAdditionalSourceDirs().from(subprojects.sourceSets.main.allSource.srcDirs)
getClassDirectories().from(subprojects.sourceSets.main.output)
executionData.from(subprojects.jacocoTestReport.executionData)

executionData.from fileTree(dir: '.', includes: ['**/jacoco/*.exec'])
reports {
xml.enabled true
}

afterEvaluate {
getClassDirectories().from(files(classDirectories.files.collect {
fileTree(dir: it,
exclude: [
'org/web3j/abi/datatypes/generated/**',
'org/web3j/tuples/generated/**',
'org/web3j/ens/contracts/generated/**',
'org/gradle/**'
])
}))
xml.required = true
xml.enabled = true
csv.required = true
html.destination file("build/reports/jacocoHtml")
}
onlyIf = { true }
}

jacoco {
Expand Down

0 comments on commit 9766d4d

Please sign in to comment.