Twidere-App-Android-Twitter.../twidere/build.gradle

333 lines
14 KiB
Groovy
Raw Normal View History

2014-07-03 07:48:39 +02:00
apply plugin: 'com.android.application'
2016-06-29 15:47:52 +02:00
apply plugin: 'kotlin-android'
2017-01-09 06:16:23 +01:00
apply plugin: 'kotlin-kapt'
2016-06-29 15:47:52 +02:00
apply plugin: 'kotlin-android-extensions'
2019-10-24 11:19:37 +02:00
apply plugin: 'imgenie'
2014-07-03 07:48:39 +02:00
2016-01-07 05:17:03 +01:00
buildscript {
2019-10-25 10:50:10 +02:00
ext {
enableGoogleVariant = project.file('google-services.json').exists()
}
2016-01-07 05:17:03 +01:00
repositories {
maven { url "https://jitpack.io" }
2016-06-29 15:47:52 +02:00
jcenter()
2020-02-24 06:09:03 +01:00
if (enableGoogleVariant) {
// START Non-FOSS component
google()
// END Non-FOSS component
}
2016-01-07 05:17:03 +01:00
}
dependencies {
2017-06-20 03:42:36 +02:00
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
classpath "org.jetbrains.kotlin:kotlin-android-extensions:${kotlinVersion}"
classpath 'com.github.mariotaku:imgenie-plugin:0.2.6'
2017-06-20 03:42:36 +02:00
2019-10-25 10:50:10 +02:00
if (enableGoogleVariant) {
// START Non-FOSS component
2020-05-31 03:12:29 +02:00
classpath 'com.google.gms:google-services:4.3.3'
2019-10-25 10:50:10 +02:00
// END Non-FOSS component
}
2016-01-07 05:17:03 +01:00
}
}
repositories {
mavenLocal()
maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
flatDir { dirs "$projectDir/lib" }
}
2014-07-03 07:48:39 +02:00
android {
2017-09-05 11:00:01 +02:00
compileSdkVersion globalCompileSdkVersion
buildToolsVersion globalBuildToolsVersion
2014-07-03 07:48:39 +02:00
defaultConfig {
applicationId "org.mariotaku.twidere"
2020-01-26 08:35:15 +01:00
minSdkVersion globalMinSdkVersion
targetSdkVersion globalTargetSdkVersion
versionCode projectVersionCode
versionName projectVersionName
multiDexEnabled true
2015-11-25 01:47:30 +01:00
2017-09-08 17:17:10 +02:00
buildConfigField 'boolean', 'LEAK_CANARY_ENABLED', 'Boolean.parseBoolean("false")'
2016-03-04 04:54:27 +01:00
buildConfigField 'boolean', 'SHOW_CUSTOM_TOKEN_DIALOG', 'Boolean.parseBoolean("false")'
2016-01-01 11:57:18 +01:00
2020-01-26 08:35:15 +01:00
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2014-07-03 07:48:39 +02:00
}
2017-08-27 18:37:40 +02:00
2017-08-13 18:29:20 +02:00
flavorDimensions 'channel'
productFlavors {
2019-10-25 10:50:10 +02:00
if (enableGoogleVariant) {
// START Non-FOSS component
google {
dimension 'channel'
}
// END Non-FOSS component
2017-08-13 18:29:20 +02:00
}
fdroid {
dimension 'channel'
}
}
2017-08-27 18:37:40 +02:00
2017-09-15 07:27:09 +02:00
def file = rootProject.file('private/signing.properties')
def hasSigningProps = file.exists()
2017-09-05 11:00:01 +02:00
signingConfigs {
2017-09-15 07:27:09 +02:00
if (hasSigningProps) {
twidere {
Properties signingProp = new Properties()
signingProp.load(file.newInputStream())
storeFile = rootProject.file(signingProp.get('storeFile'))
storePassword = (String) signingProp.get('storePassword')
keyAlias = (String) signingProp.get('keyAlias')
keyPassword = (String) signingProp.get('keyPassword')
}
2017-09-05 11:00:01 +02:00
}
}
buildTypes {
debug {
2017-09-15 07:27:09 +02:00
if (hasSigningProps) {
signingConfig signingConfigs.twidere
}
2017-09-05 11:00:01 +02:00
2015-12-29 13:25:16 +01:00
resValue("bool", "debug", "true")
}
2015-03-29 09:36:51 +02:00
release {
2017-09-15 07:27:09 +02:00
if (hasSigningProps) {
signingConfig signingConfigs.twidere
}
2017-09-05 11:00:01 +02:00
2015-11-22 15:55:29 +01:00
minifyEnabled false
shrinkResources false
2015-11-22 15:55:29 +01:00
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2015-12-29 13:25:16 +01:00
resValue("bool", "debug", "false")
2015-03-29 09:36:51 +02:00
}
}
2017-08-27 18:37:40 +02:00
2016-07-06 15:21:34 +02:00
sourceSets.each {
it.res.srcDirs += project.files("src/${it.name}/res-localized")
it.java.srcDirs += "src/${it.name}/kotlin"
2015-03-29 13:06:55 +02:00
}
compileOptions {
encoding = 'UTF-8'
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
aaptOptions {
additionalParameters "--no-version-vectors"
}
testOptions {
unitTests.returnDefaultValues = true
}
2016-04-04 11:22:36 +02:00
2017-09-05 11:00:01 +02:00
lintOptions {
2019-06-26 08:56:22 +02:00
checkReleaseBuilds false
2017-09-05 11:00:01 +02:00
abortOnError false
2020-06-28 23:27:50 +02:00
disable 'MissingTranslation', 'PluralsCandidate'
2017-09-05 11:00:01 +02:00
}
packagingOptions {
exclude 'META-INF/*'
2017-09-22 09:00:12 +02:00
exclude 'kotlin/**.kotlin_builtins'
2017-09-20 14:39:11 +02:00
exclude 'org/osmdroid/**.png'
2017-09-22 09:00:12 +02:00
exclude 'javax/annotation/**.java'
2017-09-20 14:39:11 +02:00
exclude 'generated-sources/**'
2017-09-22 09:00:12 +02:00
exclude 'jsr305_annotations/**'
2017-09-25 15:05:58 +02:00
exclude 'error_prone/**'
exclude 'third_party/java_src/**'
exclude 'sdk-version.txt'
2017-09-20 14:39:11 +02:00
exclude 'build-data.properties'
2017-09-05 11:00:01 +02:00
}
2014-07-03 07:48:39 +02:00
}
2020-05-25 07:51:22 +02:00
task buildTranslationArray {
def foundLocales = new StringBuilder()
foundLocales.append("new String[]{")
fileTree("src/main/res-localized").visit { FileVisitDetails details ->
2020-05-31 03:12:29 +02:00
if (details.file.path.endsWith("strings.xml")) {
def languageCode = details.file.parentFile.name.replaceAll('values-', '').replaceAll('-r', '-')
languageCode = (languageCode == "values") ? "en" : languageCode
2020-05-25 07:51:22 +02:00
foundLocales.append("\"").append(languageCode).append("\"").append(",")
}
}
foundLocales.append("}")
//Don't forget to remove the trailing comma
2020-05-31 03:12:29 +02:00
def foundLocalesString = foundLocales.toString().replaceAll(',}', '}')
2020-05-25 07:51:22 +02:00
android.defaultConfig.buildConfigField "String[]", "TRANSLATION_ARRAY", foundLocalesString
}
preBuild.dependsOn buildTranslationArray
2020-05-12 09:20:12 +02:00
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "1.8"
}
}
2020-05-31 03:12:29 +02:00
ext {
libVersions = [
Kovenant : '3.3.0',
Mime4J : '0.7.2',
2020-06-27 22:39:31 +02:00
Dagger : '2.28.1',
2020-07-14 22:46:57 +02:00
Exoplayer : '2.11.7',
2020-05-31 03:12:29 +02:00
Glide : '4.11.0',
MediaViewerLibrary: '0.9.23',
2020-05-31 06:28:24 +02:00
Stetho : '1.5.1',
2020-05-31 03:12:29 +02:00
]
}
2014-07-03 07:48:39 +02:00
dependencies {
2017-08-13 18:29:20 +02:00
implementation project(':twidere.component.common')
implementation project(':twidere.component.nyan')
/** Kotlin **/
2020-06-27 22:39:31 +02:00
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${sharedVersions['Kotlin']}"
implementation "nl.komponents.kovenant:kovenant:${libVersions['Kovenant']}"
implementation "nl.komponents.kovenant:kovenant-android:${libVersions['Kovenant']}"
implementation "nl.komponents.kovenant:kovenant-combine:${libVersions['Kovenant']}"
implementation "nl.komponents.kovenant:kovenant-functional:${libVersions['Kovenant']}"
2017-08-13 18:29:20 +02:00
2020-01-26 08:35:15 +01:00
/** Android support **/
2020-01-26 08:35:15 +01:00
implementation 'androidx.annotation:annotation:1.1.0'
2020-05-26 11:15:09 +02:00
implementation 'androidx.appcompat:appcompat:1.3.0-alpha01'
2020-01-26 08:35:15 +01:00
implementation 'androidx.browser:browser:1.2.0'
implementation 'androidx.cardview:cardview:1.0.0'
2020-06-27 22:39:31 +02:00
implementation 'androidx.core:core:1.3.0'
implementation 'androidx.core:core-ktx:1.3.0'
2020-06-01 07:28:27 +02:00
implementation 'androidx.drawerlayout:drawerlayout:1.1.0-alpha01'
2020-05-31 06:28:24 +02:00
implementation 'androidx.exifinterface:exifinterface:1.2.0'
implementation 'androidx.legacy:legacy-support-core-ui:1.0.0'
implementation 'androidx.multidex:multidex:2.0.1'
2020-05-31 06:28:24 +02:00
implementation 'androidx.palette:palette-ktx:1.0.0'
2020-05-31 03:12:29 +02:00
implementation 'androidx.preference:preference:1.1.1'
2020-06-27 22:39:31 +02:00
implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
/** Third-party dependencies **/
compileOnly 'javax.annotation:jsr250-api:1.0'
2020-06-27 22:43:38 +02:00
implementation 'com.twitter.twittertext:twitter-text:3.1.0'
implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.10.0'
2017-08-13 18:29:20 +02:00
implementation 'com.squareup:otto:1.3.8'
2020-07-14 22:46:57 +02:00
implementation 'dnsjava:dnsjava:3.2.2'
2020-05-31 06:28:24 +02:00
implementation 'com.commonsware.cwac:layouts:0.4.5'
2017-08-13 18:29:20 +02:00
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
implementation 'com.pnikosis:materialish-progress:1.7'
implementation 'com.github.uucky:ColorPicker-Android:0.9.7@aar'
2020-05-31 06:28:24 +02:00
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.15'
2017-08-13 18:29:20 +02:00
implementation 'com.sprylab.android.texturevideoview:texturevideoview:1.2.1'
implementation 'com.squareup:pollexor:2.0.4'
implementation 'org.apache.commons:commons-lang3:3.10'
implementation 'org.apache.commons:commons-text:1.8'
2017-08-13 18:29:20 +02:00
implementation "org.apache.james:apache-mime4j-core:${libVersions['Mime4J']}"
implementation "org.apache.james:apache-mime4j-storage:${libVersions['Mime4J']}"
2020-05-31 03:12:29 +02:00
implementation "com.bluelinelabs:logansquare:${sharedVersions['LoganSquare']}"
kapt "com.bluelinelabs:logansquare-compiler:${sharedVersions['LoganSquare']}"
implementation "com.fasterxml.jackson.core:jackson-core:${sharedVersions['Jackson']}"
implementation "com.hannesdorfmann.parcelableplease:annotation:${sharedVersions['ParcelablePlease']}"
kapt "com.hannesdorfmann.parcelableplease:processor:${sharedVersions['ParcelablePlease']}"
2020-05-31 06:28:24 +02:00
implementation 'com.squareup.okhttp3:okhttp:3.12.12'
implementation 'com.squareup.okio:okio:2.6.0'
2017-08-13 18:29:20 +02:00
implementation 'com.lnikkila:extendedtouchview:0.1.1'
implementation "com.google.dagger:dagger:${libVersions['Dagger']}"
kapt "com.google.dagger:dagger-compiler:${libVersions['Dagger']}"
2020-05-31 06:28:24 +02:00
implementation 'org.attoparser:attoparser:2.0.5.RELEASE'
implementation 'com.getkeepsafe.taptargetview:taptargetview:1.13.0'
implementation 'net.ypresto.androidtranscoder:android-transcoder:0.3.0'
2020-06-02 11:15:34 +02:00
implementation 'org.jsoup:jsoup:1.13.1'
2020-05-01 17:01:34 +02:00
implementation "com.google.android.exoplayer:exoplayer-core:${libVersions['Exoplayer']}"
implementation "com.google.android.exoplayer:exoplayer-ui:${libVersions['Exoplayer']}"
2017-08-13 18:29:20 +02:00
implementation "com.google.android.exoplayer:extension-okhttp:${libVersions['Exoplayer']}"
implementation "com.github.bumptech.glide:glide:${libVersions['Glide']}"
2020-05-31 03:12:29 +02:00
implementation "com.github.bumptech.glide:okhttp3-integration:${libVersions['Glide']}@aar"
kapt "com.github.bumptech.glide:compiler:${libVersions['Glide']}"
2020-05-31 03:12:29 +02:00
implementation 'jp.wasabeef:glide-transformations:4.1.0'
2020-05-31 06:28:24 +02:00
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
implementation 'io.nayuki:qrcodegen:1.6.0'
2017-08-13 18:29:20 +02:00
/** Custom dependencies **/
2020-06-29 05:11:50 +02:00
implementation 'com.github.mariotaku:AbstractTask:0.9.7'
2020-04-23 08:42:28 +02:00
implementation 'com.github.mariotaku:DragSortListView:0.6.1'
2020-05-31 03:12:29 +02:00
implementation "com.github.mariotaku.ExportablePreferences:core:${sharedVersions['ExportablePreferences']}"
implementation("com.github.mariotaku.CommonsLibrary:emojione-android:${sharedVersions['MariotakuCommons']}") {
2017-09-25 08:04:37 +02:00
exclude group: 'org.apache.commons', module: 'commons-text'
}
2020-05-31 03:12:29 +02:00
implementation "com.github.mariotaku.CommonsLibrary:io:${sharedVersions['MariotakuCommons']}"
implementation "com.github.mariotaku.CommonsLibrary:logansquare:${sharedVersions['MariotakuCommons']}"
implementation "com.github.mariotaku.CommonsLibrary:objectcursor:${sharedVersions['MariotakuCommons']}"
implementation "com.github.mariotaku.CommonsLibrary:parcel:${sharedVersions['MariotakuCommons']}"
implementation "com.github.mariotaku.CommonsLibrary:text:${sharedVersions['MariotakuCommons']}"
implementation "com.github.mariotaku.CommonsLibrary:text-kotlin:${sharedVersions['MariotakuCommons']}"
2020-05-31 06:28:24 +02:00
implementation 'com.github.mariotaku:KPreferences:0.9.8'
2020-05-31 03:12:29 +02:00
implementation "com.github.mariotaku.MediaViewerLibrary:base:${libVersions['MediaViewerLibrary']}"
implementation "com.github.mariotaku.MediaViewerLibrary:subsample-image-view:${libVersions['MediaViewerLibrary']}"
implementation 'com.github.mariotaku:MessageBubbleView:3.5'
implementation "com.github.mariotaku.ObjectCursor:core:${sharedVersions['ObjectCursor']}"
kapt "com.github.mariotaku.ObjectCursor:processor:${sharedVersions['ObjectCursor']}"
2020-06-29 05:11:50 +02:00
implementation 'com.github.mariotaku:PickNCrop:0.9.29'
2020-05-31 03:12:29 +02:00
implementation "com.github.mariotaku.RestFu:library:${sharedVersions['RestFu']}"
implementation "com.github.mariotaku.RestFu:logansquare:${sharedVersions['RestFu']}"
implementation "com.github.mariotaku.RestFu:oauth:${sharedVersions['RestFu']}"
implementation "com.github.mariotaku.RestFu:oauth2:${sharedVersions['RestFu']}"
implementation "com.github.mariotaku.RestFu:okhttp3:${sharedVersions['RestFu']}"
implementation 'com.github.mariotaku:SQLiteQB:0.9.15'
2020-06-29 05:11:50 +02:00
implementation 'com.github.mariotaku.UniqR:android:0.9.10'
2020-05-31 03:12:29 +02:00
implementation 'com.github.Tlaster:Chameleon:0.9.28'
2017-08-13 18:29:20 +02:00
/** Flavor dependencies **/
2020-05-31 03:12:29 +02:00
fdroidImplementation 'org.osmdroid:osmdroid-android:5.6.5'
2020-05-31 06:28:24 +02:00
fdroidImplementation 'ch.acra:acra:4.11'
if (enableGoogleVariant) {
// START Non-FOSS component
2020-06-29 05:11:50 +02:00
googleImplementation 'com.google.android.gms:play-services-ads:17.0.0'
googleImplementation 'com.google.android.gms:play-services-auth:17.0.0'
googleImplementation 'com.google.android.gms:play-services-maps:17.0.0'
2020-05-31 03:12:29 +02:00
googleImplementation 'com.google.maps.android:android-maps-utils:0.6.2'
googleImplementation 'com.anjlab.android.iab.v3:library:1.1.0'
googleImplementation 'com.dropbox.core:dropbox-core-sdk:3.1.3'
2020-05-31 06:28:24 +02:00
googleImplementation('com.google.apis:google-api-services-drive:v3-rev195-1.25.0') {
exclude group: 'org.apache.httpcomponents'
}
implementation 'com.google.guava:guava:28.2-android'
// END Non-FOSS component
}
debugImplementation "com.facebook.stetho:stetho:${libVersions['Stetho']}"
debugImplementation "com.facebook.stetho:stetho-okhttp3:${libVersions['Stetho']}"
2020-05-31 06:28:24 +02:00
debugImplementation 'com.github.mariotaku:StethoBeanShellREPL:0.5'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.3'
debugImplementation('com.jayway.jsonpath:json-path:2.4.0') {
exclude group: 'net.minidev', module: 'json-smart'
}
// Stetho dependency, see https://g.co/androidstudio/app-test-app-conflict
debugImplementation 'com.google.code.findbugs:jsr305:3.0.2'
/** Testing **/
2020-06-27 22:39:31 +02:00
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.annotation:annotation:1.1.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test:rules:1.2.0'
// https://g.co/androidstudio/app-test-app-conflict
androidTestImplementation 'com.google.code.findbugs:jsr305:3.0.2'
2015-05-04 17:53:52 +02:00
}
2019-10-25 10:50:10 +02:00
if (enableGoogleVariant) {
2017-09-23 16:12:12 +02:00
// START Non-FOSS component
2019-10-25 10:50:10 +02:00
apply plugin: 'com.google.gms.google-services'
// END Non-FOSS component
}