fedilab-Android-App/app/build.gradle

243 lines
9.3 KiB
Groovy
Raw Normal View History

import java.util.regex.Matcher
import java.util.regex.Pattern
2022-04-27 15:20:42 +02:00
plugins {
id 'com.android.application'
2022-05-23 17:58:37 +02:00
id 'kotlin-android'
2022-08-20 12:50:22 +02:00
id 'androidx.navigation.safeargs.kotlin'
2022-04-27 15:20:42 +02:00
}
def flavor
android {
2023-12-12 15:47:15 +01:00
compileSdk 34
2022-04-27 15:20:42 +02:00
defaultConfig {
minSdk 21
2023-12-12 15:47:15 +01:00
targetSdk 34
2024-03-21 17:57:29 +01:00
versionCode 515
versionName "3.28.2"
2022-04-27 15:20:42 +02:00
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
flavorDimensions "default"
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
applicationIdSuffix '.debug'
pseudoLocalesEnabled true
}
2022-04-27 15:20:42 +02:00
}
compileOptions {
2022-07-30 18:47:30 +02:00
coreLibraryDesugaringEnabled true
2023-12-12 15:47:15 +01:00
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
2022-04-27 15:20:42 +02:00
}
productFlavors {
fdroid {
2022-06-12 11:28:13 +02:00
applicationId "fr.gouv.etalab.mastodon"
2022-04-27 15:20:42 +02:00
buildConfigField "boolean", "DONATIONS", "true"
buildConfigField "boolean", "push", "false"
flavor = "fdroid"
}
playstore {
2022-06-12 11:28:13 +02:00
applicationId "app.fedilab.android"
2022-04-27 15:20:42 +02:00
buildConfigField "boolean", "DONATIONS", "false"
buildConfigField "boolean", "push", "true"
flavor = "playstore"
}
}
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']
}
2023-01-22 15:22:59 +01:00
main {
res.srcDirs = [
'src/main/res/layouts/mastodon',
'src/main/res/layouts/peertube',
2023-01-22 16:48:14 +01:00
'src/main/res/layouts',
2023-02-11 18:28:25 +01:00
2023-01-22 16:48:14 +01:00
'src/main/res/drawables/mastodon',
'src/main/res/drawables/peertube',
'src/main/res/drawables',
2023-02-11 18:28:25 +01:00
2023-01-22 16:48:14 +01:00
'src/main/res/menus/mastodon',
'src/main/res/menus/peertube',
'src/main/res/menus',
2023-02-11 18:28:25 +01:00
2023-02-14 16:21:04 +01:00
'src/main/res/values',
2023-01-22 15:22:59 +01:00
'src/main/res'
]
}
2022-04-27 15:20:42 +02:00
}
configurations {
2023-08-07 17:03:14 +02:00
cleanedAnnotations
implementation.exclude group: 'org.jetbrains', module: 'annotations'
2022-04-27 15:20:42 +02:00
all {
exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel-ktx'
}
}
2023-12-12 15:47:15 +01:00
namespace 'app.fedilab.android'
lint {
abortOnError false
checkReleaseBuilds false
}
2022-04-27 15:20:42 +02:00
}
allprojects {
repositories {
mavenLocal()
maven { url "https://jitpack.io" }
}
}
dependencies {
2023-03-24 15:13:24 +01:00
2023-02-16 17:29:14 +01:00
implementation 'androidx.appcompat:appcompat:1.6.1'
2022-12-08 10:31:58 +01:00
2023-12-12 15:47:15 +01:00
implementation 'com.google.android.material:material:1.10.0'
2022-12-08 10:31:58 +01:00
2022-06-14 19:17:35 +02:00
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
2022-08-20 12:52:47 +02:00
implementation "com.google.code.gson:gson:2.9.1"
2022-04-27 15:20:42 +02:00
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
2022-06-28 19:30:45 +02:00
implementation 'com.squareup.retrofit2:converter-simplexml:2.9.0'
2022-04-27 15:20:42 +02:00
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
2023-12-12 15:47:15 +01:00
implementation 'androidx.preference:preference:1.2.1'
2022-06-14 19:17:35 +02:00
implementation "org.conscrypt:conscrypt-android:2.5.2"
2022-04-27 15:20:42 +02:00
implementation 'com.vanniktech:emoji-one:0.6.0'
implementation 'com.github.GrenderG:Toasty:1.5.2'
2022-11-26 11:20:15 +01:00
implementation "com.github.bumptech.glide:glide:4.14.2"
implementation "com.github.bumptech.glide:okhttp3-integration:4.14.2"
2023-01-11 16:26:31 +01:00
implementation("com.github.bumptech.glide:recyclerview-integration:4.14.2") {
// Excludes the support library because it's already included by Glide.
transitive = false
}
2022-07-13 09:27:10 +02:00
2022-11-10 16:41:34 +01:00
implementation "org.jsoup:jsoup:1.15.1"
2022-04-27 15:20:42 +02:00
implementation 'com.github.mergehez:ArgPlayer:v3.1'
2023-03-24 15:13:24 +01:00
implementation project(':autoimageslider')
2022-04-27 15:20:42 +02:00
implementation project(path: ':mytransl')
implementation project(path: ':ratethisapp')
implementation project(path: ':sparkbutton')
2023-03-24 15:13:24 +01:00
implementation project(path: ':colorPicker')
implementation project(path: ':mathjaxandroid')
2024-01-20 18:10:05 +01:00
implementation project(path: ':doubletapplayerview')
2022-06-05 15:48:58 +02:00
implementation 'com.burhanrashid52:photoeditor:1.5.1'
2022-12-23 11:36:03 +01:00
implementation("com.vanniktech:android-image-cropper:4.3.3")
2022-04-27 15:20:42 +02:00
annotationProcessor "com.github.bumptech.glide:compiler:4.12.0"
implementation 'jp.wasabeef:glide-transformations:4.3.0'
2022-12-28 16:20:14 +01:00
implementation 'com.github.penfeizhou.android.animation:glide-plugin:2.23.0'
2024-01-22 17:16:09 +01:00
implementation 'androidx.media3:media3-exoplayer-hls:1.2.1'
2024-01-20 18:10:05 +01:00
implementation "androidx.media3:media3-exoplayer:1.2.1"
implementation "androidx.media3:media3-exoplayer-dash:1.2.1"
implementation "androidx.media3:media3-ui:1.2.1"
2024-01-22 17:16:09 +01:00
implementation "androidx.media3:media3-session:1.2.1"
2024-01-20 18:10:05 +01:00
2022-06-22 11:01:39 +02:00
implementation "androidx.viewpager2:viewpager2:1.0.0"
2022-04-27 15:20:42 +02:00
implementation 'com.github.piasy:rxandroidaudio:1.7.0'
implementation 'com.github.piasy:AudioProcessor:1.7.0'
2023-12-12 15:47:15 +01:00
implementation "androidx.work:work-runtime:2.9.0"
2022-04-27 15:20:42 +02:00
implementation 'app.futured.hauler:hauler:5.0.0'
implementation "com.github.chrisbanes:PhotoView:2.3.0"
implementation "ch.acra:acra-mail:5.11.3"
implementation "ch.acra:acra-limiter:5.11.3"
implementation "ch.acra:acra-dialog:5.11.3"
2022-04-27 15:20:42 +02:00
implementation "com.madgag.spongycastle:bctls-jdk15on:1.58.0.0"
2023-12-12 15:47:15 +01:00
implementation 'com.github.UnifiedPush:android-connector:2.2.0'
2022-04-27 15:20:42 +02:00
// implementation 'com.github.UnifiedPush:android-foss_embedded_fcm_distributor:1.0.0-beta1'
2023-02-19 19:10:10 +01:00
playstoreImplementation('com.github.UnifiedPush:android-embedded_fcm_distributor:2.2.0') {
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 15:20:42 +02:00
implementation 'com.burhanrashid52:photoeditor:1.5.1'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
2023-12-12 15:47:15 +01:00
implementation 'androidx.lifecycle:lifecycle-livedata:2.6.2'
implementation 'androidx.lifecycle:lifecycle-viewmodel:2.6.2'
implementation 'androidx.navigation:navigation-fragment:2.7.5'
implementation 'androidx.navigation:navigation-ui:2.7.5'
2022-04-27 15:20:42 +02:00
testImplementation 'junit:junit:'
2023-12-12 15:47:15 +01:00
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
2022-11-30 15:27:23 +01:00
// debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.8.1'
2023-01-14 16:21:16 +01:00
implementation 'com.r0adkll:slidableactivity:2.1.0'
2022-07-30 18:47:30 +02:00
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
2023-01-22 16:48:14 +01:00
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
2023-12-12 15:47:15 +01:00
implementation "androidx.fragment:fragment:1.6.2"
2023-01-22 16:48:14 +01:00
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
2023-12-12 15:47:15 +01:00
implementation 'androidx.browser:browser:1.7.0'
2023-01-22 16:48:14 +01:00
implementation 'androidx.documentfile:documentfile:1.0.1'
implementation 'com.github.amoskorir:avatarimagegenerator:1.5.0'
2024-01-20 18:10:05 +01:00
2023-01-22 16:48:14 +01:00
implementation "com.github.mabbas007:TagsEditText:1.0.5"
2023-12-12 15:47:15 +01:00
implementation "net.gotev:uploadservice:4.9.2"
implementation "net.gotev:uploadservice-okhttp:4.9.2"
implementation 'androidx.media:media:1.7.0'
2023-01-22 16:48:14 +01:00
implementation 'com.github.mancj:MaterialSearchBar:0.8.5'
2024-03-21 17:24:28 +01:00
implementation 'com.github.androidmads:QRGenerator:1.0.1'
2023-01-22 16:48:14 +01:00
2023-08-06 18:13:08 +02:00
implementation 'io.noties.markwon:core:4.6.2'
2023-08-07 17:03:14 +02:00
implementation 'io.noties.markwon:ext-tables:4.6.2'
implementation 'io.noties.markwon:syntax-highlight:4.6.2'
implementation 'io.noties.markwon:ext-strikethrough:4.6.2'
implementation 'io.noties.markwon:inline-parser:4.6.2'
2023-08-07 17:03:14 +02:00
annotationProcessor 'io.noties:prism4j-bundler:2.0.0'
2023-08-06 18:13:08 +02:00
2023-01-22 16:48:14 +01:00
//************ CAST **************///
//---> Google libs (google_full)
2023-12-12 15:47:15 +01:00
playstoreImplementation "com.google.android.gms:play-services-cast-tv:21.0.1"
playstoreImplementation "com.google.android.gms:play-services-cast:21.4.0"
playstoreImplementation "androidx.mediarouter:mediarouter:1.6.0"
playstoreImplementation 'com.google.android.gms:play-services-cast-framework:21.4.0'
2023-01-22 16:48:14 +01:00
//----> Other flavors
fdroidImplementation 'su.litvak.chromecast:api-v2:0.11.3'
fdroidImplementation 'com.fasterxml.jackson.core:jackson-core:2.12.0'
fdroidImplementation 'org.slf4j:slf4j-simple:1.7.30'
}
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 15:20:42 +02:00
}