Skip to content

Commit 087fdb1

Browse files
committed
Runner with Multidex
1 parent c012cd1 commit 087fdb1

File tree

5 files changed

+21
-5
lines changed

5 files changed

+21
-5
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-keep class timber.log.Timber { *; }

sample/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ android {
1111
versionCode 1
1212
versionName "1.0"
1313

14-
minSdkVersion 16
14+
minSdkVersion 21
1515
targetSdkVersion 30
1616

1717
compileOptions {
1818
sourceCompatibility 1.8
1919
targetCompatibility 1.8
2020
}
2121

22-
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
22+
testInstrumentationRunner "info.hannes.logcat.sample.CustomTestRunner"
2323
}
2424

2525
buildTypes {
@@ -53,6 +53,7 @@ dependencies {
5353
androidTestImplementation "androidx.test.ext:junit:$extJUnitVersion"
5454
androidTestImplementation "androidx.test.ext:truth:1.3.0"
5555
androidTestImplementation "com.google.truth:truth:1.1.2"
56+
androidTestImplementation "androidx.multidex:multidex:2.0.1"
5657
}
5758

5859
def adbDirectory = '/storage/emulated/0/Download'

sample/src/androidTest/AndroidManifest.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:tools="http://schemas.android.com/tools"
4-
package="info.mx.tracks"
5-
android:versionCode="1"
6-
android:versionName="1.0">
4+
package="info.mx.tracks">
75

86
<application
97
android:label="MxTest"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package info.hannes.logcat.sample;
2+
3+
import android.os.Bundle;
4+
5+
import androidx.multidex.MultiDex;
6+
import androidx.test.runner.AndroidJUnitRunner;
7+
8+
9+
public class CustomTestRunner extends AndroidJUnitRunner {
10+
@Override
11+
public void onCreate(Bundle arguments) {
12+
MultiDex.install(getTargetContext());
13+
super.onCreate(arguments);
14+
}
15+
}

sample/src/multidex-config.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-keep class timber.log.** { *; }

0 commit comments

Comments
 (0)