Skip to content

Commit

Permalink
Runner with Multidex
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesa2 committed Dec 11, 2020
1 parent 0f0160b commit 8878044
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
1 change: 1 addition & 0 deletions LogcatCoreLib/consumer-proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-keep class timber.log.Timber { *; }
5 changes: 3 additions & 2 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ android {
versionCode 1
versionName "1.0"

minSdkVersion 16
minSdkVersion 21
targetSdkVersion 30

compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "info.hannes.logcat.sample.CustomTestRunner"
}

buildTypes {
Expand Down Expand Up @@ -53,6 +53,7 @@ dependencies {
androidTestImplementation "androidx.test.ext:junit:$extJUnitVersion"
androidTestImplementation "androidx.test.ext:truth:1.3.0"
androidTestImplementation "com.google.truth:truth:1.1"
androidTestImplementation "androidx.multidex:multidex:2.0.1"
}

def adbDirectory = '/storage/emulated/0/Download'
Expand Down
4 changes: 1 addition & 3 deletions sample/src/androidTest/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="info.mx.tracks"
android:versionCode="1"
android:versionName="1.0">
package="info.mx.tracks">

<application
android:label="MxTest"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package info.hannes.logcat.sample;

import android.os.Bundle;

import androidx.multidex.MultiDex;
import androidx.test.runner.AndroidJUnitRunner;


public class CustomTestRunner extends AndroidJUnitRunner {
@Override
public void onCreate(Bundle arguments) {
MultiDex.install(getTargetContext());
super.onCreate(arguments);
}
}
1 change: 1 addition & 0 deletions sample/src/multidex-config.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-keep class timber.log.** { *; }

0 comments on commit 8878044

Please sign in to comment.