2022-09-10 19:30:51 +03:00
|
|
|
import java.util.regex.Matcher
|
|
|
|
import java.util.regex.Pattern
|
|
|
|
|
2022-04-27 16:20:42 +03:00
|
|
|
plugins {
|
|
|
|
id 'com.android.application'
|
2022-05-23 18:58:37 +03:00
|
|
|
id 'kotlin-android'
|
2022-08-20 13:50:22 +03:00
|
|
|
id 'androidx.navigation.safeargs.kotlin'
|
2022-04-27 16:20:42 +03:00
|
|
|
}
|
|
|
|
def flavor
|
|
|
|
android {
|
2022-11-30 16:27:23 +02:00
|
|
|
compileSdk 32
|
2022-04-27 16:20:42 +03:00
|
|
|
|
|
|
|
defaultConfig {
|
|
|
|
minSdk 21
|
2022-11-30 16:27:23 +02:00
|
|
|
targetSdk 32
|
2022-12-07 19:40:15 +02:00
|
|
|
versionCode 442
|
|
|
|
versionName "3.9.7"
|
2022-04-27 16:20:42 +03:00
|
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
|
|
}
|
|
|
|
flavorDimensions "default"
|
|
|
|
buildTypes {
|
|
|
|
release {
|
|
|
|
minifyEnabled false
|
|
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
|
|
}
|
2022-07-26 18:07:39 +03:00
|
|
|
debug {
|
|
|
|
applicationIdSuffix '.debug'
|
|
|
|
}
|
2022-04-27 16:20:42 +03:00
|
|
|
}
|
|
|
|
compileOptions {
|
2022-07-30 19:47:30 +03:00
|
|
|
coreLibraryDesugaringEnabled true
|
2022-04-27 16:20:42 +03:00
|
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
|
|
}
|
|
|
|
productFlavors {
|
|
|
|
fdroid {
|
2022-06-12 12:28:13 +03:00
|
|
|
applicationId "fr.gouv.etalab.mastodon"
|
2022-04-27 16:20:42 +03:00
|
|
|
buildConfigField "boolean", "DONATIONS", "true"
|
|
|
|
buildConfigField "boolean", "push", "false"
|
|
|
|
flavor = "fdroid"
|
|
|
|
}
|
|
|
|
playstore {
|
2022-06-12 12:28:13 +03:00
|
|
|
applicationId "app.fedilab.android"
|
2022-04-27 16:20:42 +03:00
|
|
|
buildConfigField "boolean", "DONATIONS", "false"
|
|
|
|
buildConfigField "boolean", "push", "true"
|
|
|
|
flavor = "playstore"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
lintOptions {
|
|
|
|
checkReleaseBuilds false
|
|
|
|
abortOnError false
|
|
|
|
}
|
|
|
|
buildFeatures {
|
|
|
|
viewBinding true
|
|
|
|
}
|
|
|
|
sourceSets {
|
|
|
|
playstore {
|
|
|
|
manifest.srcFile "src/playstore/AndroidManifest.xml"
|
|
|
|
java.srcDirs = ['src/main/java', 'src/playstore/java']
|
|
|
|
res.srcDirs = ['src/main/res', 'src/playstore/res']
|
|
|
|
}
|
|
|
|
fdroid {
|
|
|
|
java.srcDirs = ['src/main/java', 'src/fdroid/java']
|
|
|
|
res.srcDirs = ['src/main/res', 'src/fdroid/res']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
configurations {
|
|
|
|
all {
|
|
|
|
exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel-ktx'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
allprojects {
|
|
|
|
repositories {
|
|
|
|
mavenLocal()
|
|
|
|
maven { url "https://jitpack.io" }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dependencies {
|
|
|
|
implementation project(':autoimageslider')
|
2022-11-30 16:27:23 +02:00
|
|
|
implementation 'androidx.appcompat:appcompat:1.5.1'
|
|
|
|
implementation 'com.google.android.material:material:1.7.0'
|
2022-06-14 20:17:35 +03:00
|
|
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
2022-08-20 13:52:47 +03:00
|
|
|
implementation "com.google.code.gson:gson:2.9.1"
|
2022-04-27 16:20:42 +03:00
|
|
|
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
|
|
|
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
2022-06-28 20:30:45 +03:00
|
|
|
implementation 'com.squareup.retrofit2:converter-simplexml:2.9.0'
|
2022-04-27 16:20:42 +03:00
|
|
|
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
|
|
|
implementation 'androidx.preference:preference:1.2.0'
|
2022-06-14 20:17:35 +03:00
|
|
|
implementation "org.conscrypt:conscrypt-android:2.5.2"
|
2022-04-27 16:20:42 +03:00
|
|
|
implementation 'com.vanniktech:emoji-one:0.6.0'
|
|
|
|
implementation 'com.github.GrenderG:Toasty:1.5.2'
|
|
|
|
implementation 'org.framagit.tom79:SparkButton:1.0.13'
|
2022-11-26 12:20:15 +02:00
|
|
|
implementation "com.github.bumptech.glide:glide:4.14.2"
|
|
|
|
implementation "com.github.bumptech.glide:okhttp3-integration:4.14.2"
|
2022-07-13 10:27:10 +03:00
|
|
|
|
2022-11-10 17:41:34 +02:00
|
|
|
implementation "org.jsoup:jsoup:1.15.1"
|
|
|
|
|
2022-04-27 16:20:42 +03:00
|
|
|
implementation 'com.github.mergehez:ArgPlayer:v3.1'
|
|
|
|
implementation project(path: ':mytransl')
|
|
|
|
implementation project(path: ':ratethisapp')
|
2022-06-05 16:48:58 +03:00
|
|
|
|
|
|
|
|
|
|
|
implementation 'com.burhanrashid52:photoeditor:1.5.1'
|
|
|
|
implementation project(path: ':cropper')
|
2022-04-27 16:20:42 +03:00
|
|
|
annotationProcessor "com.github.bumptech.glide:compiler:4.12.0"
|
|
|
|
implementation 'jp.wasabeef:glide-transformations:4.3.0'
|
2022-11-26 12:20:15 +02:00
|
|
|
implementation 'com.github.penfeizhou.android.animation:glide-plugin:2.24.0'
|
2022-08-20 13:52:47 +03:00
|
|
|
implementation 'com.google.android.exoplayer:exoplayer:2.18.1'
|
2022-06-22 12:01:39 +03:00
|
|
|
implementation "androidx.viewpager2:viewpager2:1.0.0"
|
2022-04-27 16:20:42 +03:00
|
|
|
implementation 'com.github.piasy:rxandroidaudio:1.7.0'
|
|
|
|
implementation 'com.github.piasy:AudioProcessor:1.7.0'
|
|
|
|
implementation "androidx.work:work-runtime:2.7.1"
|
|
|
|
implementation 'app.futured.hauler:hauler:5.0.0'
|
|
|
|
implementation "com.github.chrisbanes:PhotoView:2.3.0"
|
2022-08-20 13:52:47 +03:00
|
|
|
implementation "ch.acra:acra-mail:5.9.6"
|
2022-05-24 12:15:29 +03:00
|
|
|
implementation "ch.acra:acra-limiter:5.9.3"
|
2022-08-20 13:52:47 +03:00
|
|
|
implementation "ch.acra:acra-dialog:5.9.6"
|
2022-04-27 16:20:42 +03:00
|
|
|
implementation "com.madgag.spongycastle:bctls-jdk15on:1.58.0.0"
|
2022-09-10 15:46:13 +03:00
|
|
|
implementation 'com.github.UnifiedPush:android-connector:2.0.1'
|
2022-04-27 16:20:42 +03:00
|
|
|
// implementation 'com.github.UnifiedPush:android-foss_embedded_fcm_distributor:1.0.0-beta1'
|
2022-11-30 16:27:23 +02:00
|
|
|
playstoreImplementation('com.github.UnifiedPush:android-embedded_fcm_distributor:2.1.3') {
|
2022-09-10 15:46:13 +03:00
|
|
|
exclude group: 'com.google.firebase', module: 'firebase-core'
|
|
|
|
exclude group: 'com.google.firebase', module: 'firebase-analytics'
|
|
|
|
exclude group: 'com.google.firebase', module: 'firebase-measurement-connector'
|
|
|
|
}
|
2022-04-27 16:20:42 +03:00
|
|
|
implementation 'com.burhanrashid52:photoeditor:1.5.1'
|
|
|
|
implementation 'androidx.multidex:multidex:2.0.1'
|
|
|
|
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
|
2022-08-20 13:52:47 +03:00
|
|
|
implementation 'androidx.lifecycle:lifecycle-livedata:2.5.1'
|
|
|
|
implementation 'androidx.lifecycle:lifecycle-viewmodel:2.5.1'
|
2022-11-30 16:27:23 +02:00
|
|
|
implementation 'androidx.navigation:navigation-fragment:2.5.3'
|
|
|
|
implementation 'androidx.navigation:navigation-ui:2.5.3'
|
2022-04-27 16:20:42 +03:00
|
|
|
testImplementation 'junit:junit:'
|
2022-11-30 16:27:23 +02:00
|
|
|
androidTestImplementation 'androidx.test.ext:junit:1.1.4'
|
|
|
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
|
|
|
|
// debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.8.1'
|
2022-05-08 20:12:41 +03:00
|
|
|
|
2022-07-30 19:47:30 +03:00
|
|
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
2022-09-10 19:30:51 +03:00
|
|
|
}
|
|
|
|
def getCurrentFlavor() {
|
|
|
|
Gradle gradle = getGradle()
|
|
|
|
String tskReqStr = gradle.getStartParameter().getTaskRequests().toString()
|
|
|
|
println("tskReqStr:" +tskReqStr)
|
|
|
|
Pattern pattern
|
|
|
|
|
|
|
|
if( tskReqStr.contains( "assemble" ) ) // to run ./gradlew assembleRelease to build APK
|
|
|
|
pattern = Pattern.compile("assemble(\\w+)(Release|Debug)")
|
|
|
|
else if( tskReqStr.contains( "bundle" ) ) // to run ./gradlew bundleRelease to build .aab
|
|
|
|
pattern = Pattern.compile("assemble(\\w+)(Release|Debug)")
|
|
|
|
else
|
|
|
|
pattern = Pattern.compile("generate(\\w+)(Release|Debug)")
|
|
|
|
|
|
|
|
Matcher matcher = pattern.matcher( tskReqStr )
|
|
|
|
println(tskReqStr)
|
|
|
|
if( matcher.find() )
|
|
|
|
return matcher.group(1).toLowerCase()
|
|
|
|
else
|
|
|
|
{
|
|
|
|
println "NO MATCH FOUND"
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
println("Flavor: ${getCurrentFlavor()}")
|
|
|
|
if ( getCurrentFlavor() == "playstore" ){
|
|
|
|
apply plugin: 'com.google.gms.google-services'
|
2022-04-27 16:20:42 +03:00
|
|
|
}
|