File tree Expand file tree Collapse file tree 5 files changed +68
-2
lines changed Expand file tree Collapse file tree 5 files changed +68
-2
lines changed Original file line number Diff line number Diff line change 14
14
- uses : gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3.4.2
15
15
with :
16
16
validate-wrappers : true
17
- - run : ./gradlew test jacocoTestReport
17
+ # https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md#android
18
+ - run : cd parcelize-example && ../gradlew test jacocoTestReport
18
19
- uses : actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
19
20
with :
20
21
name : jacoco-report
21
- path : build/reports/jacoco/test/html /
22
+ path : parcelize-example/build /
22
23
if-no-files-found : error
Original file line number Diff line number Diff line change
1
+ plugins {
2
+ id(" com.android.library" ) version " 8.5.0"
3
+ kotlin(" android" ) version " 2.0.0"
4
+ kotlin(" plugin.parcelize" ) version " 2.0.0"
5
+ id(" jacoco" )
6
+ }
7
+
8
+ group = " org.example"
9
+
10
+ repositories {
11
+ mavenCentral()
12
+ }
13
+
14
+ android {
15
+ defaultConfig {
16
+ compileSdk = 33
17
+ }
18
+ namespace = " org.example"
19
+
20
+ // https://developer.android.com/build/jdks
21
+ compileOptions {
22
+ sourceCompatibility = JavaVersion .VERSION_17
23
+ targetCompatibility = JavaVersion .VERSION_17
24
+ }
25
+ kotlinOptions {
26
+ jvmTarget = " 17"
27
+ }
28
+ }
29
+
30
+ dependencies {
31
+ testImplementation(kotlin(" test" ))
32
+ }
33
+
34
+ tasks.register(" jacocoTestReport" , JacocoReport ::class ) {
35
+ dependsOn(" testDebugUnitTest" )
36
+ classDirectories.setFrom(
37
+ fileTree(" $buildDir /tmp/kotlin-classes/debug" )
38
+ )
39
+ executionData.setFrom(file(" $buildDir /jacoco/testDebugUnitTest.exec" ))
40
+ sourceDirectories.setFrom(file(" src/main/kotlin" ))
41
+ }
Original file line number Diff line number Diff line change
1
+ pluginManagement {
2
+ repositories {
3
+ google()
4
+ gradlePluginPortal()
5
+ mavenCentral()
6
+ }
7
+ }
Original file line number Diff line number Diff line change
1
+ package org.example
2
+
3
+ import android.os.Parcelable
4
+ import kotlinx.parcelize.Parcelize
5
+
6
+ @Parcelize
7
+ data class Data (val a : Int ): Parcelable
Original file line number Diff line number Diff line change
1
+ package org.example
2
+
3
+ internal class ExampleTest {
4
+
5
+ @kotlin.test.Test
6
+ fun test () {
7
+ Data (42 ).a
8
+ }
9
+
10
+ }
You can’t perform that action at this time.
0 commit comments