Skip to content

Commit

Permalink
android coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexisChoupault committed Mar 3, 2025
1 parent b4883fa commit 76415b9
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 87 deletions.
41 changes: 38 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:7.3.1'
classpath "com.android.tools.build:gradle:8.8.2"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand All @@ -23,6 +23,7 @@ allprojects {

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'jacoco'

android {
compileSdk 35
Expand Down Expand Up @@ -71,8 +72,42 @@ android {
ndkVersion '27.0.12077973'
}

tasks.register('jacocoTestReport', JacocoReport) {
dependsOn 'testDebugUnitTest'

reports {
xml.required = true
xml.outputLocation.set(file("$project.projectDir/build/reports/jacocoTestCoverage.xml"))
html.required = false
csv.required = false
}

def fileFilter = [
'**/R.class',
'**/R$*.class',
'**/BuildConfig.*',
'**/Manifest*.*',
'**/CalendarApi*',
'**/Calendar.class',
'**/Calendar$Companion.class',
'**/Event*.class',
'**/Account*.class',
] // ignore pigeon generated files
def mainSrc = "${project.projectDir}/src/main/kotlin/sncf/connect/tech/eventide/"

sourceDirectories.setFrom(files(mainSrc))
classDirectories.setFrom(files("${buildDir}/intermediates/runtime_library_classes_dir/debug/sncf/connect/tech/eventide/").asFileTree.matching {
exclude fileFilter
})
executionData.setFrom(files("${buildDir}/jacoco/testDebugUnitTest.exec"))
}

tasks.withType(Test).configureEach {
useJUnitPlatform()
finalizedBy jacocoTestReport
}

dependencies {
implementation("androidx.activity:activity-ktx:1.10.0")
implementation("androidx.activity:activity-ktx:1.10.1")
implementation("androidx.fragment:fragment-ktx:1.8.6")
}

5 changes: 5 additions & 0 deletions example/android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ plugins {
id("kotlin-android")
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id("dev.flutter.flutter-gradle-plugin")
id("jacoco")
}

jacoco {
toolVersion = "0.8.8"
}

android {
Expand Down
55 changes: 0 additions & 55 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.3.2"
file:
dependency: transitive
description:
name: file
sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4
url: "https://pub.dev"
source: hosted
version: "7.0.1"
flutter:
dependency: "direct main"
description: flutter
Expand All @@ -101,11 +93,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "8.1.6"
flutter_driver:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
flutter_lints:
dependency: "direct dev"
description:
Expand All @@ -119,11 +106,6 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
fuchsia_remote_debug_protocol:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
http:
dependency: transitive
description:
Expand All @@ -140,11 +122,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "4.1.2"
integration_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
leak_tracker:
dependency: transitive
description:
Expand Down Expand Up @@ -217,14 +194,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.9.1"
platform:
dependency: transitive
description:
name: platform
sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984"
url: "https://pub.dev"
source: hosted
version: "3.1.6"
plugin_platform_interface:
dependency: transitive
description:
Expand All @@ -233,14 +202,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.8"
process:
dependency: transitive
description:
name: process
sha256: "107d8be718f120bbba9dcd1e95e3bd325b1b4a4f07db64154635ba03f2567a0d"
url: "https://pub.dev"
source: hosted
version: "5.0.3"
provider:
dependency: transitive
description:
Expand Down Expand Up @@ -294,14 +255,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.4.1"
sync_http:
dependency: transitive
description:
name: sync_http
sha256: "7f0cd72eca000d2e026bcd6f990b81d0ca06022ef4e32fb257b30d3d1014a961"
url: "https://pub.dev"
source: hosted
version: "0.3.1"
term_glyph:
dependency: transitive
description:
Expand Down Expand Up @@ -367,14 +320,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.1.0"
webdriver:
dependency: transitive
description:
name: webdriver
sha256: "3d773670966f02a646319410766d3b5e1037efb7f07cc68f844d5e06cd4d61c8"
url: "https://pub.dev"
source: hosted
version: "3.0.4"
sdks:
dart: ">=3.7.0-0 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54"
2 changes: 0 additions & 2 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ dependencies:
timezone: ^0.10.0

dev_dependencies:
integration_test:
sdk: flutter
flutter_test:
sdk: flutter
flutter_lints: ^4.0.0
Expand Down
27 changes: 0 additions & 27 deletions example/test/widget_test.dart

This file was deleted.

0 comments on commit 76415b9

Please sign in to comment.