import groovy.json.JsonSlurper apply from: 'gradle/grgit.gradle' apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services' apply plugin: 'com.google.firebase.crashlytics' android { compileSdkVersion 33 defaultConfig { applicationId "gr.thmmy.mthmmy" minSdkVersion 23 targetSdkVersion 33 versionCode 32 versionName "2.1.1" archivesBaseName = "mTHMMY-v$versionName" buildConfigField "String", "CURRENT_BRANCH", "\"" + getCurrentBranch() + "\"" buildConfigField "String", "COMMIT_HASH", "\"" + getCommitHash() + "\"" buildConfigField "boolean", "IS_CLEAN", String.valueOf(isClean()) } buildTypes { release { minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } debug { def date = new Date().format('ddMMyy_HHmmss') archivesBaseName = archivesBaseName + "-$date" firebaseCrashlytics { mappingFileUploadEnabled false // Disable mapping file uploading for debug builds } } } sourceSets { test.resources.srcDirs += 'src/main/res/raw' } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } namespace 'gr.thmmy.mthmmy' } def firebaseReleaseProjectId = "mthmmy-release-3aef0" tasks.whenTaskAdded { task -> if (task.name.contains("assembleRelease")) { task.getDependsOn().add({ def googleServicesFile = new File("app/src/release/google-services.json") if (googleServicesFile.exists()) { def json = new JsonSlurper().parseText(googleServicesFile.text) if (json.project_info.project_id != firebaseReleaseProjectId) throw new GradleException('Please supply the correct google-services.json for release in app/src/release/ directory!') } else throw new GradleException('Please add the release google-services.json in app/src/release/ directory!') }) } else if (task.name.contains("assembleDebug")) { task.getDependsOn().add({ def googleServicesFile = new File("app/src/debug/google-services.json") if (googleServicesFile.exists()) { def json = new JsonSlurper().parseText(googleServicesFile.text) if (json.project_info.project_id == firebaseReleaseProjectId) throw new GradleException('Please replace google-services.json in app/src/debug/ with a debug one!') } else throw new GradleException('Please add a debug google-services.json in app/src/debug/ directory!') }) } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation project(":emojis") implementation 'androidx.appcompat:appcompat:1.4.1' implementation 'androidx.preference:preference:1.1.1' implementation 'androidx.legacy:legacy-preference-v14:1.0.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.cardview:cardview:1.0.0' implementation 'androidx.recyclerview:recyclerview:1.2.1' implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.3' implementation 'androidx.exifinterface:exifinterface:1.3.3' implementation 'com.google.android.material:material:1.4.0' implementation platform('com.google.firebase:firebase-bom:28.4.0') implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.firebase:firebase-config' implementation 'com.google.firebase:firebase-crashlytics' implementation 'com.google.firebase:firebase-messaging' implementation 'com.google.code.gson:gson:2.8.8' implementation 'com.snatik:storage:2.1.0' //TODO: Replace (e.g. with https://github.com/anggrayudi/SimpleStorage) implementation 'com.squareup.okhttp3:okhttp:3.14.9' implementation 'org.jsoup:jsoup:1.14.2' implementation 'joda-time:joda-time:2.10.10' implementation 'com.github.franmontiel:PersistentCookieJar:1.0.1' implementation 'com.github.PhilJay:MPAndroidChart:3.0.3' implementation 'com.mikepenz:materialdrawer:6.1.1' implementation 'com.mikepenz:fontawesome-typeface:4.7.0.0@aar' implementation 'com.mikepenz:google-material-typeface:3.0.1.2.original@aar' implementation 'com.bignerdranch.android:expandablerecyclerview:3.0.0-RC1'//TODO: deprecated! implementation 'com.github.chrisbanes:PhotoView:2.3.0' implementation 'me.zhanghai.android.materialprogressbar:library:1.4.2' implementation 'com.jakewharton.timber:timber:4.7.1' implementation 'ru.noties:markwon:2.0.2' implementation 'net.gotev:uploadservice:3.5.2' implementation 'net.gotev:uploadservice-okhttp:3.5.2' implementation 'com.localebro:okhttpprofiler:1.0.8' //Plugin: https://plugins.jetbrains.com/plugin/11249-okhttp-profiler implementation 'com.github.bumptech.glide:glide:4.12.0' annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0' testImplementation 'junit:junit:4.12' testImplementation 'org.powermock:powermock-core:2.0.2' testImplementation 'org.powermock:powermock-module-junit4:2.0.2' testImplementation 'org.powermock:powermock-api-mockito2:2.0.2' testImplementation 'net.lachlanmckee:timber-junit-rule:1.0.1' testImplementation 'org.json:json:20210307' }