app/build.gradle
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'jacoco'
id 'com.google.gms.google-services'
id 'com.google.secrets_gradle_plugin' version '0.5'
id 'kotlin-android-extensions'
}
// include android extensions mainly for eliminating the implementation of the Parcelable interface
// while passing objects as extras between activities
androidExtensions {
experimental = true
}
android {
compileSdkVersion 30
//noinspection GradleDependency
buildToolsVersion "30.0.2"
defaultConfig {
applicationId "com.github.gogetters.letsgo"
minSdkVersion 24
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
testOptions {
unitTests.returnDefaultValues = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
testCoverageEnabled true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
lintOptions {
abortOnError false
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
}
}
dependencies {
//--------------------------------------------------------------
// Firebase
// Import the Firebase BoM
implementation platform('com.google.firebase:firebase-bom:28.1.0')
// When using the BoM, you don't specify versions in Firebase library dependencies
// Declare the dependency for the Firebase SDK for Google Analytics
implementation 'com.google.firebase:firebase-analytics-ktx'
// Declare the dependency for Firebase Authentication
implementation 'com.google.firebase:firebase-auth-ktx'
// Declare the dependency for the Realtime Database library
implementation 'com.google.firebase:firebase-database-ktx'
// Declare the dependency for the Cloud Storage library
implementation 'com.google.firebase:firebase-storage-ktx'
implementation 'com.google.firebase:firebase-firestore-ktx'
//--------------------------------------------------------------
implementation 'com.firebaseui:firebase-ui-auth:7.1.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9'
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.gms:play-services-location:18.0.0'
implementation 'com.scaledrone:scaledrone-java:0.6.0'
implementation 'com.android.volley:volley:1.2.0'
implementation ('io.socket:socket.io-client:2.0.0') {
exclude group: 'org.json', module: 'json'
}
// groupie 3rd party library to facilitate the usage of recyclerview and its bindings
implementation 'com.xwray:groupie:2.1.0'
// design
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'de.hdodenhof:circleimageview:3.0.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.navigation:navigation-fragment-ktx:2.2.2'
implementation 'androidx.navigation:navigation-ui-ktx:2.2.2'
implementation 'androidx.fragment:fragment-ktx:1.2.4'
// test
testImplementation 'junit:junit:4.13.2'
testImplementation 'io.mockk:mockk:1.11.0'
testImplementation 'org.mockito:mockito-core:3.10.0'
testImplementation 'org.json:json:20201115'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.3.0'
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test:rules:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.3.0'
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
androidTestImplementation 'io.mockk:mockk-android:1.11.0'
}
apply plugin: 'com.google.gms.google-services'
secrets {
// Optionally specify a different file name containing your secrets.
// The plugin defaults to "local.properties"
propertiesFileName = "local.properties"
defaultPropertiesFileName = "local.defaults.properties"
// Add keys that the plugin should ignore from the properties file
// ignoreList.add("keyToIgnore")
// ignoreList.add("ignore*")
}
tasks.withType(Test) {
jacoco.includeNoLocationClasses = true
jacoco.excludes = ['jdk.internal.*']
}
task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest', 'createDebugCoverageReport']) {
reports {
xml.enabled = true
html.enabled = true
}
def fileFilter = [
'**/R.class',
'**/R$*.class',
'**/BuildConfig.*',
'**/Manifest*.*',
'**/*Test*.*',
'android/**/*.*',
// Exclude Hilt generated classes
'**/*Hilt*.*',
'hilt_aggregated_deps/**',
'**/*_Factory.class',
'**/*_MembersInjector.class'
]
def debugTree = fileTree(dir: "$project.buildDir/tmp/kotlin-classes/debug", excludes: fileFilter)
def mainSrc = "$project.projectDir/src/main/java"
sourceDirectories.setFrom(files([mainSrc]))
classDirectories.setFrom(files([debugTree]))
executionData.setFrom(fileTree(dir: project.buildDir, includes: [
'jacoco/testDebugUnitTest.exec', 'outputs/code_coverage/debugAndroidTest/connected/*coverage.ec'
]))
}
connectedCheck {
finalizedBy jacocoTestReport
}