fedilab-Android-App/app/build.gradle

232 lines
8.6 KiB
Groovy
Raw Normal View History

2021-03-02 11:59:49 +01:00
import java.util.regex.Matcher
import java.util.regex.Pattern
apply plugin: 'com.android.application'
2021-03-01 18:19:08 +01:00
def flavor
android {
2019-08-03 10:35:04 +02:00
compileSdkVersion 29
2020-05-10 11:19:22 +02:00
buildToolsVersion "29.0.3"
defaultConfig {
minSdkVersion 21
2019-08-03 10:35:04 +02:00
targetSdkVersion 29
2021-01-31 17:13:05 +01:00
versionCode 381
versionName "2.38.0-beta-1"
2018-12-11 19:17:14 +01:00
multiDexEnabled true
2019-05-05 19:01:07 +02:00
renderscriptTargetApi 28 as int
renderscriptSupportModeEnabled true
2019-11-08 18:53:57 +01:00
}
2018-12-11 19:27:21 +01:00
dexOptions {
javaMaxHeapSize "4g"
}
2017-10-26 16:19:56 +02:00
flavorDimensions "default"
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
2018-01-03 15:25:35 +01:00
debug {
pseudoLocalesEnabled true
}
}
2020-07-13 17:46:13 +02:00
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
2018-08-22 09:04:43 +02:00
lintOptions {
checkReleaseBuilds false
abortOnError false
}
2017-08-26 17:53:13 +02:00
productFlavors {
2017-08-26 18:47:52 +02:00
fdroid {
2021-02-24 10:33:32 +01:00
applicationId "fr.gouv.etalab.mastodon"
buildConfigField "boolean", "DONATIONS", "true"
2020-05-11 12:00:26 +02:00
buildConfigField "boolean", "lite", "false"
2021-01-20 11:43:57 +01:00
resValue "string", "app_name", "Fedilab"
2021-03-01 18:19:08 +01:00
flavor = "fdroid"
2020-05-11 12:00:26 +02:00
}
lite {
2020-07-12 18:40:10 +02:00
minSdkVersion 21
2020-05-11 12:00:26 +02:00
applicationId "app.fedilab.lite"
buildConfigField "boolean", "DONATIONS", "true"
buildConfigField "boolean", "lite", "true"
2021-01-20 11:43:57 +01:00
resValue "string", "app_name", "Fedilab Lite"
2021-03-01 18:19:08 +01:00
flavor = "lite"
2017-08-26 17:53:13 +02:00
}
2017-12-09 18:16:20 +01:00
playstore {
2019-05-18 11:10:30 +02:00
applicationId "app.fedilab.android"
buildConfigField "boolean", "DONATIONS", "false"
2020-05-11 12:00:26 +02:00
buildConfigField "boolean", "lite", "false"
2021-01-20 11:43:57 +01:00
resValue "string", "app_name", "Fedilab"
2021-03-01 18:19:08 +01:00
flavor = "playstore"
2017-08-26 17:53:13 +02:00
}
}
2021-01-29 18:02:32 +01:00
buildFeatures {
viewBinding = true
}
2020-07-13 17:46:13 +02:00
sourceSets {
playstore {
2021-03-02 11:59:49 +01:00
manifest.srcFile "src/playstore/AndroidManifest.xml"
2020-07-15 18:38:57 +02:00
assets.srcDirs = ['/src/mains/assets', 'src/common/assets']
2020-07-13 19:19:53 +02:00
java.srcDirs = ['src/main/java', 'src/playstore/java','src/common/java']
2020-07-14 17:44:40 +02:00
res.srcDirs = ['src/main/res', 'src/playstore/res','src/common/res']
2020-07-13 17:46:13 +02:00
}
2020-07-14 09:44:16 +02:00
2020-07-13 17:46:13 +02:00
fdroid {
2020-07-14 17:25:10 +02:00
manifest.srcFile "src/common/AndroidManifest.xml"
2020-07-15 18:38:57 +02:00
assets.srcDirs = ['/src/mains/assets', 'src/common/assets']
2021-03-01 18:19:08 +01:00
java.srcDirs = ['src/main/java', 'src/fdroid/java','src/common/java', 'src/fdroidcommon/java']
2020-07-14 17:44:40 +02:00
res.srcDirs = ['src/main/res', 'src/fdroid/res','src/common/res']
2020-07-13 17:46:13 +02:00
}
lite {
2020-07-14 19:26:39 +02:00
manifest.srcFile "src/lite/AndroidManifest.xml"
2020-07-15 18:38:57 +02:00
assets.srcDirs = ['/src/mains/assets']
2021-03-01 18:19:08 +01:00
java.srcDirs = ['src/main/java', 'src/lite/java', 'src/fdroidcommon/java']
2020-07-14 17:44:40 +02:00
res.srcDirs = ['src/main/res', 'src/lite/res']
2020-07-13 17:46:13 +02:00
}
}
2019-01-08 18:11:40 +01:00
packagingOptions {
exclude 'META-INF/proguard/androidx-annotations.pro'
}
2020-04-11 14:43:33 +02:00
viewBinding.enabled = true
}
allprojects {
repositories {
maven { url "https://jitpack.io" }
maven { url "https://maven.google.com"}
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
}
2019-12-14 10:16:10 +01:00
2019-12-14 14:18:46 +01:00
2019-12-14 10:16:10 +01:00
task copyAllReleaseNotes(type: Copy) {
from "$buildDir/../src/main/assets/changelogs/"
include "*.txt"
2021-01-20 11:50:57 +01:00
into "$buildDir/../../src/fdroid/fastlane/metadata/android/en-US/changelogs/"
from "$buildDir/../src/main/assets/changelogs/"
include "*.txt"
into "$buildDir/../../src/lite/fastlane/metadata/android/en-US/changelogs/"
2019-12-14 16:40:04 +01:00
}
task gitPushReleaseNotes(type: Exec, dependsOn: 'copyAllReleaseNotes') {
2021-01-20 11:50:57 +01:00
['sh', '-c', "git add $buildDir/../../src/fdroid/fastlane/metadata/android/en-US/changelogs/*"].execute().text.trim()
['sh', '-c', "git add $buildDir/../../src/lite/fastlane/metadata/android/en-US/changelogs/*"].execute().text.trim()
2019-12-14 14:18:46 +01:00
['sh', '-c', "git commit -m 'copy release notes'"].execute().text.trim()
['sh', '-c', "git push"].execute().text.trim()
}
2019-01-16 15:06:21 +01:00
dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
2020-03-28 11:06:25 +01:00
implementation 'com.google.android.material:material:1.0.0'
2019-06-11 19:38:26 +02:00
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
2020-03-07 15:41:18 +01:00
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.browser:browser:1.3.0'
implementation 'androidx.exifinterface:exifinterface:1.3.2'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
2020-03-07 08:14:15 +01:00
implementation "com.github.bumptech.glide:glide:4.11.0"
implementation ("com.github.bumptech.glide:recyclerview-integration:4.11.0") {
2019-12-15 18:38:24 +01:00
// Excludes the support library because it's already included by Glide.
transitive = false
}
2020-03-07 08:14:15 +01:00
annotationProcessor "com.github.bumptech.glide:compiler:4.11.0"
2019-06-11 19:38:26 +02:00
annotationProcessor 'com.android.support:support-annotations:28.0.0'
2020-05-11 12:00:26 +02:00
2020-03-07 08:14:15 +01:00
implementation "com.evernote:android-job:1.2.6"
2020-06-06 18:42:12 +02:00
implementation "com.google.code.gson:gson:2.8.6"
2020-03-07 08:14:15 +01:00
implementation "com.google.guava:guava:28.2-android"
implementation "com.github.chrisbanes:PhotoView:2.3.0"
2019-10-31 16:15:15 +01:00
implementation 'com.r0adkll:slidableactivity:2.1.0'
2021-01-20 15:20:21 +01:00
implementation 'org.framagit.tom79:android-wysiwyg-editor:3.2.1'
2021-01-20 15:35:14 +01:00
implementation 'org.framagit.tom79:mytransl:3.0.1'
2021-01-20 15:20:21 +01:00
implementation 'org.framagit.tom79:SparkButton:1.0.13'
2021-01-10 18:41:50 +01:00
implementation "com.koushikdutta.async:androidasync:3.+"
2018-11-04 16:00:44 +01:00
implementation 'com.oguzdev:CircularFloatingActionMenu:1.0.2'
2021-01-10 18:41:50 +01:00
implementation 'com.github.franmontiel:LocaleChanger:0.9.2'
2019-08-20 09:55:39 +02:00
implementation 'com.github.GrenderG:Toasty:1.4.2'
2018-12-11 19:17:14 +01:00
implementation 'com.elconfidencial.bubbleshowcase:bubbleshowcase:1.3.1'
2019-06-11 19:38:26 +02:00
implementation 'androidx.multidex:multidex:2.0.1'
2019-10-31 16:15:15 +01:00
implementation 'com.google.android.exoplayer:exoplayer:2.10.6'
2019-01-25 11:41:39 +01:00
implementation 'org.apache.poi:poi:3.16'
2019-01-08 10:50:43 +01:00
implementation 'com.github.mabbas007:TagsEditText:1.0.5'
2019-02-14 17:46:38 +01:00
implementation "com.tonyodev.fetch2:fetch2:2.3.6"
2019-05-05 19:01:07 +02:00
implementation 'jp.wasabeef:glide-transformations:4.0.0'
2020-05-11 12:00:26 +02:00
2020-07-14 17:25:10 +02:00
2019-06-12 08:05:36 +02:00
2020-05-11 12:00:26 +02:00
implementation 'com.jaredrummler:cyanea:1.0.2'
2020-03-07 08:14:15 +01:00
implementation "net.gotev:uploadservice:3.5.2"
implementation "net.gotev:uploadservice-okhttp:3.5.2"
implementation "info.guardianproject.netcipher:netcipher:2.0.0-alpha1"
implementation "info.guardianproject.netcipher:netcipher-okhttp3:2.0.0-alpha1"
2019-06-26 11:00:59 +02:00
implementation 'com.github.adrielcafe:AndroidAudioRecorder:0.3.0'
implementation 'yogesh.firzen:MukkiyaSevaigal:1.0.6'
2019-09-21 10:45:17 +02:00
implementation 'com.iceteck.silicompressorr:silicompressor:2.2.2'
implementation "ch.acra:acra-mail:5.5.0"
implementation "ch.acra:acra-limiter:5.5.0"
implementation "ch.acra:acra-notification:5.5.0"
2019-07-20 17:44:44 +02:00
implementation 'com.github.duanhong169:colorpicker:1.1.6'
2020-04-05 19:26:08 +02:00
implementation 'com.github.penfeizhou.android.animation:glide-plugin:2.2.0'
2021-01-20 15:20:21 +01:00
2020-07-13 19:19:53 +02:00
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
2019-09-28 10:16:47 +02:00
implementation 'com.github.smarteist:autoimageslider:1.3.2'
2020-07-13 17:46:13 +02:00
//debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.2'
2020-08-08 16:07:10 +02:00
implementation 'com.huangyz0918:androidwm-light:0.1.2'
2020-05-11 12:00:26 +02:00
2021-02-26 15:24:57 +01:00
2021-03-02 11:59:49 +01:00
implementation 'com.github.UnifiedPush:android-connector:1.1.0'
2021-02-21 17:18:37 +01:00
implementation "com.madgag.spongycastle:bctls-jdk15on:1.58.0.0"
2021-03-02 16:58:13 +01:00
implementation 'commons-net:commons-net:3.6'
2020-05-11 12:00:26 +02:00
//Flavors
//Playstore
2020-07-14 17:25:10 +02:00
playstoreApi 'com.theartofdev.edmodo:android-image-cropper:2.8.+'
2020-05-11 12:00:26 +02:00
playstoreImplementation "io.github.kobakei:ratethisapp:1.2.0"
playstoreImplementation "org.conscrypt:conscrypt-android:2.4.0"
2021-01-20 15:20:21 +01:00
playstoreImplementation 'org.framagit.tom79:country-picker-android:1.2.0'
2020-05-11 12:00:26 +02:00
playstoreImplementation 'com.vanniktech:emoji-one:0.6.0'
playstoreImplementation 'ja.burhanrashid52:photoeditor:0.4.0'
2021-03-02 11:59:49 +01:00
playstoreImplementation 'com.github.UnifiedPush:android-connector_fcm_added:1.0.0'
2020-05-11 12:00:26 +02:00
//Fdroid
2020-07-14 17:25:10 +02:00
fdroidApi 'com.theartofdev.edmodo:android-image-cropper:2.8.+'
2020-05-11 12:00:26 +02:00
fdroidImplementation "org.conscrypt:conscrypt-android:2.4.0"
2021-01-20 15:20:21 +01:00
fdroidImplementation 'org.framagit.tom79:country-picker-android:1.2.0'
2020-05-11 12:00:26 +02:00
fdroidImplementation 'com.vanniktech:emoji-one:0.6.0'
fdroidImplementation 'ja.burhanrashid52:photoeditor:0.4.0'
2020-07-12 18:40:10 +02:00
2021-03-01 18:19:08 +01:00
}
2021-03-02 11:59:49 +01:00
def getCurrentFlavor() {
Gradle gradle = getGradle()
String tskReqStr = gradle.getStartParameter().getTaskRequests().toString()
Pattern pattern
if( tskReqStr.contains( "assemble" ) )
pattern = Pattern.compile("assemble(\\w+)(Release|Debug)")
else
pattern = Pattern.compile("generate(\\w+)(Release|Debug)")
Matcher matcher = pattern.matcher( tskReqStr )
if( matcher.find() ) {
return matcher.group(1).toLowerCase()
}else
{
println "NO MATCH FOUND"
return ""
}
}
if( getCurrentFlavor() == "playstore") {
apply plugin: 'com.google.gms.google-services'
}