File tree Expand file tree Collapse file tree 4 files changed +19
-25
lines changed Expand file tree Collapse file tree 4 files changed +19
-25
lines changed Original file line number Diff line number Diff line change @@ -36,10 +36,9 @@ install:
3636script :
3737 # Only run code generation tests on OSX -- linux requires sudo to install OpenCV dependencies, and that environment
3838 # will not be able to run MainWindowTest.testDragOperationFromPaletteToPipeline
39- - ./gradlew check jacocoTestReport jacocoRootReport --stacktrace -Pheadless=true -PlogTests;
39+ - ./gradlew check --stacktrace -Pheadless=true -PlogTests;
4040
4141after_success :
42- - if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then codecov ; fi
4342 - .travis-scripts/push-javadoc-to-gh-pages.sh
4443 - .travis-scripts/before-deploy.sh
4544
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ build_script:
66
77# to run your custom scripts instead of automatic tests
88test_script :
9- - gradlew.bat check jacocoTestReport jacocoRootReport --stacktrace -Pheadless=true -PlogTests -Dscan
9+ - gradlew.bat check --stacktrace -Pheadless=true -PlogTests -Dscan
1010
1111platform :
1212 - x64
Original file line number Diff line number Diff line change @@ -31,14 +31,11 @@ jobs:
3131 publishJUnitResults : false
3232 tasks : ' check jacocoTestReport jacocoRootReport jfxNative -Pgeneration -PjniLocation=build/OpenCVJNI -Pheadless=true -PlogTests --stacktrace'
3333
34- # Publish JaCoCo code coverage results from the build
35- - task : PublishCodeCoverageResults@1
36- inputs :
37- codeCoverageTool : ' JaCoCo'
38- summaryFileLocation : ' $(System.DefaultWorkingDirectory)/**/reports/jacoco/test/jacocoTestReport.xml'
39- reportDirectory : ' $(System.DefaultWorkingDirectory)/**/reports/jacoco/test/jacocoTestReport.html'
40- additionalCodeCoverageFiles : ' $(System.DefaultWorkingDirectory)/**/build/jacoco/text.exec'
41- failIfCoverageEmpty : false
34+ - script : |
35+ curl -s https://codecov.io/bash > .codecov
36+ chmod +x .codecov
37+ ./.codecov -t $(CODECOV_TOKEN)
38+ displayName: 'Upload jacoco reports to codecov'
4239
4340 - task : CopyFiles@2
4441 inputs :
Original file line number Diff line number Diff line change @@ -159,22 +159,20 @@ tasks.register<JacocoReport>("jacocoRootReport") {
159159 group = " Coverage reports"
160160 description = " Generates an aggregate report from all subprojects"
161161
162- reports {
163- html.isEnabled = true
164- xml.isEnabled = true
165- }
162+ // Based on the codecov Gradle example: https://github.com/codecov/example-gradle
166163
167164 javaSubprojects {
168- val sourceSets = (this as ExtensionAware ).extensions.getByName(" sourceSets" ) as SourceSetContainer
169- dependsOn(tasks[" test" ])
170- val srcFiles = files(sourceSets[" main" ].allSource.srcDirs)
171- additionalSourceDirs(srcFiles)
172- sourceDirectories.from(srcFiles)
173- classDirectories.from(files(sourceSets[" main" ].output))
174- executionData.from(tasks.named<JacocoReport >(" jacocoTestReport" ).map { it.executionData })
175- }
176- doFirst {
177- executionData.setFrom(files(executionData.files.filter { it.exists() }))
165+ this @register.sourceSets(sourceSets[" main" ])
166+ this @register.dependsOn(tasks.named<JacocoReport >(" jacocoTestReport" ))
167+ }
168+
169+ executionData(fileTree(rootDir.absolutePath).include(" **/build/jacoco/*.exec" ))
170+
171+ reports {
172+ xml.isEnabled = true
173+ xml.destination = buildDir.resolve(" reports/jacoco/report.xml" )
174+ html.isEnabled = false
175+ csv.isEnabled = false
178176 }
179177}
180178
You can’t perform that action at this time.
0 commit comments