This repository has been archived by the owner on Jun 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ✨ Adds jacoco Signed-off-by: Hernand Azevedo <[email protected]> * ✨ Adds jacoco for backend Signed-off-by: Hernand Azevedo <[email protected]> * 🔧 Improve configuration for jacoco android * 🐛 Fixes coverage zero by removing the testCoverageEnabled property Signed-off-by: Hernand Azevedo <[email protected]> * 🔧 Improves time for testing workflow Signed-off-by: Hernand Azevedo <[email protected]> * 🔧 Adds jdk8 action Signed-off-by: Hernand Azevedo <[email protected]> * 🔧 Adds jdk8 action Signed-off-by: Hernand Azevedo <[email protected]> * 🔧 Adds jdk8 action Signed-off-by: Hernand Azevedo <[email protected]> * 🔧 Fixing performance for tests Signed-off-by: Hernand Azevedo <[email protected]> * 🔧 Fixing performance for tests Signed-off-by: Hernand Azevedo <[email protected]> * 🔧 Fixing performance for tests Signed-off-by: Hernand Azevedo <[email protected]> * 🔧 TESTING FALSE TEST Signed-off-by: Hernand Azevedo <[email protected]> * 🔧 TESTING FALSE TEST Signed-off-by: Hernand Azevedo <[email protected]> * 🔧 Testing success Signed-off-by: Hernand Azevedo <[email protected]> * 🔧 Rename coverage task Signed-off-by: Hernand Azevedo <[email protected]> * 🔧 Rename coverage task Signed-off-by: Hernand Azevedo <[email protected]>
- Loading branch information
1 parent
aef6da0
commit 0bb271a
Showing
17 changed files
with
120 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright 2020 ZUP IT SERVICOS EM TECNOLOGIA E INOVACAO SA | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
apply plugin: 'com.hiya.jacoco-android' | ||
|
||
jacoco { | ||
toolVersion = '0.8.7' | ||
} | ||
|
||
jacocoAndroidUnitTestReport { | ||
|
||
csv.enabled false | ||
html.enabled true | ||
xml.enabled true | ||
} | ||
|
||
tasks.withType(Test) { | ||
useJUnitPlatform() | ||
jacoco.includeNoLocationClasses = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
* Copyright 2020 ZUP IT SERVICOS EM TECNOLOGIA E INOVACAO SA | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
apply plugin: 'jacoco' | ||
|
||
jacoco { | ||
toolVersion = '0.8.7' | ||
} | ||
|
||
def fileFilter = ['**/R.class', | ||
'**/R$*x.class', | ||
'**/BuildConfig.*', | ||
'**/Manifest*.*', | ||
'**/*Test*.*', | ||
'**/*$*', | ||
'android/**/*.*', | ||
'**/*Function*', | ||
'**/*_impl*', | ||
'**/*.DefaultImpls.*', | ||
'**/beagle/view/*.class'] | ||
|
||
task jacocoTestReportDebug(type: JacocoReport) { | ||
|
||
def kotlinSrc = "$project.projectDir/src/main/kotlin" | ||
def javaSrc = "$project.projectDir/src/main/java" | ||
def javaClasses = fileTree(dir: "$project.buildDir/intermediates/javac/debug", excludes: fileFilter) | ||
def kotlinClasses = fileTree(dir: "$project.buildDir/tmp/kotlin-classes/debug", excludes: fileFilter) | ||
def kotlinLibClasses = fileTree(dir: "$project.buildDir/classes/kotlin/main", excludes: fileFilter) | ||
|
||
def dependencyTasks | ||
if (project.plugins.hasPlugin('com.android.application')) { | ||
dependencyTasks = ['testDebugUnitTest'] | ||
//FIXME uncomment below this if you want instrumented tests on your report | ||
// dependencyTasks = ['testDebugUnitTest', 'createDebugCoverageReport'] | ||
} else if (project.plugins.hasPlugin("com.android.library")) { | ||
dependencyTasks = ['testDebugUnitTest'] | ||
} else { | ||
dependencyTasks = ['test'] | ||
} | ||
|
||
dependsOn { | ||
dependencyTasks | ||
} | ||
|
||
reports { | ||
xml.enabled = true | ||
html.enabled = true | ||
} | ||
|
||
getSourceDirectories().setFrom([javaSrc, kotlinSrc]) | ||
getClassDirectories().setFrom([javaClasses, kotlinClasses, kotlinLibClasses]) | ||
getExecutionData().setFrom([fileTree(dir: project.buildDir, includes: [ | ||
'jacoco/testDebugUnitTest.exec', 'jacoco/test.exec', 'outputs/code-coverage/connected/**/*.ec' | ||
])], [fileTree(dir: "${System.env.VDTESTING_DOWNLOADED_FILES_DIR}", includes: [ | ||
'*sdcard_coverage.ec' | ||
])]) | ||
|
||
} |