ReaderforSelfoss/app/build.gradle

173 lines
5.9 KiB
Groovy
Raw Normal View History

buildscript {
}
2017-12-04 19:07:30 +00:00
ext {
configuration = [
buildDate: new Date()
]
// This will make me able to build multiple times a day. May break thinks. I may forget it.
todaysBuilds = "1"
2017-12-04 19:07:30 +00:00
}
def gitVersion() {
def process = "git describe --abbrev=0 --tags".execute()
2017-12-04 19:07:30 +00:00
return process.text.substring(1).replaceAll("\\.", "").trim()
}
def versionCodeFromGit() {
println "version code " + gitVersion()
return gitVersion().toInteger()
}
def versionNameFromGit() {
println "version name " + gitVersion()
return gitVersion()
}
2018-10-12 20:04:47 +00:00
apply plugin: 'kotlin-kapt'
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
2017-11-12 16:05:36 +00:00
apply plugin: 'kotlin-android-extensions'
android {
2018-05-21 19:39:23 +00:00
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
2018-05-21 19:39:23 +00:00
}
compileSdkVersion 28
2018-10-12 18:36:18 +00:00
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "apps.amine.bou.readerforselfoss"
minSdkVersion 16
targetSdkVersion 28
versionCode versionCodeFromGit()
versionName versionNameFromGit()
// Enabling multidex support.
multiDexEnabled true
lintOptions {
abortOnError true
disable 'InvalidPackage'
}
vectorDrawables.useSupportLibrary = true
2017-06-11 10:04:39 +00:00
// tests
2018-10-12 18:36:18 +00:00
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
2017-09-10 07:19:28 +00:00
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
2017-06-11 10:04:39 +00:00
debug {
buildConfigField "String", "LOGIN_URL", appLoginUrl
buildConfigField "String", "LOGIN_USERNAME", appLoginUsername
buildConfigField "String", "LOGIN_PASSWORD", appLoginPassword
applicationIdSuffix ".dev"
2017-06-11 10:04:39 +00:00
}
}
flavorDimensions "build"
productFlavors {
githubConfig {
versionNameSuffix '-github'
dimension "build"
}
storeConfig {
// As jenkins publishes to alpha first, this is the default suffix now.
2018-01-16 21:13:00 +00:00
versionNameSuffix '-store'
dimension "build"
}
}
}
dependencies {
2017-06-11 10:04:39 +00:00
// Testing
2018-10-12 18:36:18 +00:00
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-beta02'
androidTestImplementation 'androidx.test:runner:1.1.0-beta02'
2017-06-11 10:04:39 +00:00
// Espresso-contrib for DatePicker, RecyclerView, Drawer actions, Accessibility checks, CountingIdlingResource
2018-10-12 18:36:18 +00:00
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.1.0-beta02'
2017-06-11 10:04:39 +00:00
// Espresso-intents for validation and stubbing of Intents
2018-10-12 18:36:18 +00:00
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.1.0-beta02'
implementation fileTree(include: ['*.jar'], dir: 'libs')
2018-03-27 17:59:34 +00:00
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
// Android Support
2018-10-12 18:51:36 +00:00
implementation "androidx.appcompat:appcompat:$android_version"
implementation "com.google.android.material:material:$android_version"
implementation "androidx.recyclerview:recyclerview:$android_version"
implementation "androidx.legacy:legacy-support-v4:$android_version"
implementation "androidx.vectordrawable:vectordrawable:$android_version"
implementation "androidx.browser:browser:$android_version"
implementation "androidx.cardview:cardview:$android_version"
2018-10-12 18:36:18 +00:00
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2'
//multidex
2018-10-12 18:36:18 +00:00
implementation 'androidx.multidex:multidex:2.0.0'
// About
2018-10-12 18:51:36 +00:00
implementation('com.mikepenz:aboutlibraries:6.2.0@aar') {
transitive = true
}
// Retrofit + http logging + okhttp
2018-03-27 17:59:34 +00:00
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.burgstaller:okhttp-digest:1.12'
// Material-ish things
2018-10-12 18:51:36 +00:00
implementation 'com.ashokvarma.android:bottom-navigation-bar:2.0.5'
implementation 'com.github.jd-alexander:LikeButton:0.2.3'
2018-03-27 17:59:34 +00:00
implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
// glide
2018-03-27 17:59:34 +00:00
implementation 'com.github.bumptech.glide:glide:4.1.1'
implementation 'com.github.bumptech.glide:okhttp3-integration:4.1.1'
// Asking politely users to rate the app
2018-10-12 18:51:36 +00:00
implementation 'com.github.stkent:amplify:2.2.0'
2017-06-04 14:09:42 +00:00
// Drawer
2018-10-12 18:51:36 +00:00
implementation 'co.zsmb:materialdrawer-kt:2.0.1'
2017-06-04 14:09:42 +00:00
// Themes
2018-03-27 17:59:34 +00:00
implementation 'com.52inc:scoops:1.0.0'
2018-10-13 02:52:55 +00:00
implementation 'com.jaredrummler:colorpicker:1.0.2'
2018-03-27 17:59:34 +00:00
implementation 'com.github.rubensousa:floatingtoolbar:1.5.1'
2017-12-03 21:09:58 +00:00
// Pager
2018-10-12 18:51:36 +00:00
implementation 'me.relex:circleindicator:2.0.0@aar'
2017-12-10 19:00:09 +00:00
2018-10-12 18:36:18 +00:00
implementation 'androidx.core:core-ktx:1.0.0'
2018-02-07 20:16:51 +00:00
2018-05-21 19:39:23 +00:00
// Crash
implementation 'ch.acra:acra-http:5.1.3'
implementation 'ch.acra:acra-dialog:5.1.3'
2018-10-12 20:04:47 +00:00
implementation "androidx.lifecycle:lifecycle-livedata:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
implementation "androidx.room:room-runtime:$room_version"
kapt "androidx.room:room-compiler:$room_version"
}
2017-05-29 17:54:35 +00:00
afterEvaluate {
2017-06-11 10:04:39 +00:00
initAppLoginPropertiesIfNeeded()
2017-05-29 17:54:35 +00:00
}
2017-06-11 10:04:39 +00:00
def initAppLoginPropertiesIfNeeded() {
def propertiesFile = file(System.getProperty("user.home") + '/.gradle/gradle.properties')
if (!propertiesFile.exists()) {
def commentMessage = "This is autogenerated local property from system environment to prevent key to be committed to source control."
ant.propertyfile(file: System.getProperty("user.home") + "/.gradle/gradle.properties", comment: commentMessage) {
entry(key: "appLoginUrl", value: System.getProperty("appLoginUrl"))
entry(key: "appLoginUsername", value: System.getProperty("appLoginUsername"))
entry(key: "appLoginPassword", value: System.getProperty("appLoginPassword"))
}
}
}