apply plugin: 'com.android.application' apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' apply plugin: 'io.fabric' apply plugin: 'jacoco' def keystoreProperties = new Properties() try { def keystorePropertiesFile = rootProject.file("keystore.properties") keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) } catch (FileNotFoundException e) { logger.warn("Unable to load keystore properties. Automatic signing won't be available") keystoreProperties['keyAlias'] = "" keystoreProperties['keyPassword'] = "" keystoreProperties['storeFile'] = File.createTempFile("temp", ".tmp").absolutePath keystoreProperties['storePassword'] = "" } android { configurations.all { resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.1' } packagingOptions { exclude 'META-INF/LICENSE-LGPL-2.1.txt' exclude 'META-INF/LICENSE-LGPL-3.txt' exclude 'META-INF/LICENSE-W3C-TEST' exclude 'META-INF/LICENSE' exclude 'META-INF/DEPENDENCIES' } compileSdkVersion 28 buildToolsVersion '28.0.3' compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } defaultConfig { applicationId "com.wbrawner.simplemarkdown" minSdkVersion 21 targetSdkVersion 28 versionCode 20 versionName "0.7.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" buildConfigField "boolean", "ENABLE_CUSTOM_CSS", "false" } signingConfigs { release { keyAlias keystoreProperties['keyAlias'] keyPassword keystoreProperties['keyPassword'] storeFile file(keystoreProperties['storeFile']) storePassword keystoreProperties['storePassword'] } } buildTypes { debug { testCoverageEnabled true } release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' signingConfig signingConfigs.release buildConfigField "boolean", "ENABLE_CUSTOM_CSS", "false" } } dexOptions { jumboMode true } testOptions { unitTests { includeAndroidResources = true } } } dependencies { testImplementation 'junit:junit:4.12' testImplementation 'org.robolectric:robolectric:4.2' implementation fileTree(include: ['*.jar'], dir: 'libs') androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', { exclude group: 'com.android.support', module: 'support-annotations' }) androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' androidTestImplementation 'androidx.test:runner:1.2.0' androidTestImplementation 'androidx.test:rules:1.2.0' androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0' implementation 'androidx.appcompat:appcompat:1.1.0-rc01' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation 'com.google.android.material:material:1.0.0' implementation 'androidx.legacy:legacy-support-v13:1.0.0' implementation 'com.commonsware.cwac:anddown:0.3.0' implementation 'com.google.dagger:dagger:2.22.1' annotationProcessor 'com.google.dagger:dagger-compiler:2.22.1' kapt 'com.google.dagger:dagger-android-processor:2.22.1' kapt 'com.google.dagger:dagger-compiler:2.22.1' implementation 'com.google.firebase:firebase-core:17.0.1' implementation 'com.android.billingclient:billing:1.2' implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1' implementation "androidx.core:core-ktx:1.0.2" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" def coroutines_version = "1.3.0-RC2" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version" implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0' implementation 'eu.crydee:syllable-counter:4.0.2' } apply plugin: 'com.google.gms.google-services' repositories { mavenCentral() } jacoco { toolVersion = '0.8.0' } tasks.withType(Test) { jacoco.includeNoLocationClasses = true } task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest']) { reports { xml.enabled = true html.enabled = true } def fileFilter = [ '**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*' ] def javaDebugTree = fileTree(dir: "$project.buildDir/intermediates/javac/debug/compileDebugJavaWithJavac/classes", excludes: fileFilter) def kotlinDebugTree = fileTree(dir: "$project.buildDir/tmp/kotlin-classes/debug", excludes: fileFilter) def mainSrc = "$project.projectDir/src/main/java" sourceDirectories = files([mainSrc]) classDirectories = files([javaDebugTree, kotlinDebugTree]) executionData = fileTree(dir: project.buildDir, includes: [ 'jacoco/testDebugUnitTest.exec', 'outputs/code-coverage/connected/*coverage.ec' ]) }