app/build.gradle
apply plugin: 'com.android.application'
apply plugin: 'jacoco'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "ch.epfl.sdp.peakar"
minSdkVersion 24
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
testHandleProfiling true
testFunctionalTest true
}
signingConfigs {
debug {
/* This is a temporary keystore in order to make sign API work on every device. In case we decide to publish the app
this must be changed
*/
storeFile file('keystore/google_sign.keystore')
storePassword "Pwq@#!"
keyAlias "google_sign"
keyPassword "w-Qrz##"
}
release {
storeFile file('keystore/google_sign.keystore')
storePassword "Pwq@#!"
keyAlias "google_sign"
keyPassword "w-Qrz##"
}
}
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
}
testOptions {
unitTests.returnDefaultValues = true
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
}
sourceSets {
main {
res {
srcDirs 'src\\main\\res', 'src\\main\\res\\drawable\\countries'
}
}
}
}
dependencies {
implementation 'com.github.bumptech.glide:glide:4.12.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
implementation 'com.google.code.gson:gson:2.8.6'
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.exifinterface:exifinterface:1.3.2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.1'
testImplementation 'org.hamcrest:hamcrest-library:2.2'
implementation "androidx.navigation:navigation-fragment:2.3.5"
implementation "androidx.navigation:navigation-ui:2.3.5"
implementation "androidx.fragment:fragment:1.3.4"
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.camera:camera-camera2:1.1.0-alpha05'
implementation "androidx.camera:camera-core:1.1.0-alpha05"
implementation "androidx.camera:camera-lifecycle:1.1.0-alpha05"
implementation 'androidx.camera:camera-view:1.0.0-alpha25'
implementation 'com.github.MKergall:osmbonuspack:6.6.0'
implementation 'com.google.android.gms:play-services-auth:19.0.0'
implementation 'com.google.firebase:firebase-auth:21.0.1'
implementation 'com.google.firebase:firebase-database:20.0.0'
implementation 'com.google.firebase:firebase-core:19.0.0'
implementation 'com.firebaseui:firebase-ui-auth:6.4.0'
implementation 'androidx.preference:preference:1.1.1'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.karumi:dexter:6.2.2'
implementation 'com.github.bumptech.glide:glide:4.12.0'
implementation 'com.github.bumptech.glide:recyclerview-integration:4.11.0'
implementation 'com.github.halysongoncalves:pugnotification:1.8.1'
implementation 'com.jakewharton:butterknife:10.2.3'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.3'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test:rules:1.3.0'
androidTestImplementation 'androidx.test:core:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.3.0'
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
}
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/intermediates/javac/debug/classes", 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
}