190 lines
6.1 KiB
Groovy
190 lines
6.1 KiB
Groovy
buildscript {
|
|
repositories {
|
|
maven { url 'https://maven.fabric.io/public' }
|
|
}
|
|
|
|
dependencies {
|
|
classpath 'io.fabric.tools:gradle:1.+'
|
|
}
|
|
}
|
|
|
|
def gitVersion() {
|
|
def process = "git describe --abbrev=0 --tags".execute()
|
|
return process.text.substring(1).replaceAll("\\.", "")
|
|
}
|
|
|
|
def versionCodeFromGit() {
|
|
println "version code " + gitVersion().toInteger()
|
|
return gitVersion().toInteger()
|
|
}
|
|
|
|
def versionNameFromGit() {
|
|
println "version code " + gitVersion().trim()
|
|
return gitVersion().trim()
|
|
}
|
|
|
|
apply plugin: 'com.android.application'
|
|
|
|
apply plugin: 'io.fabric'
|
|
|
|
apply plugin: 'kotlin-android'
|
|
|
|
repositories {
|
|
maven { url 'https://maven.fabric.io/public' }
|
|
}
|
|
|
|
android {
|
|
compileSdkVersion 26
|
|
buildToolsVersion "26.0.1"
|
|
defaultConfig {
|
|
applicationId "apps.amine.bou.readerforselfoss"
|
|
minSdkVersion 16
|
|
targetSdkVersion 26
|
|
versionCode versionCodeFromGit()
|
|
versionName versionNameFromGit()
|
|
|
|
// Enabling multidex support.
|
|
multiDexEnabled true
|
|
lintOptions {
|
|
abortOnError true
|
|
disable 'InvalidPackage'
|
|
}
|
|
vectorDrawables.useSupportLibrary = true
|
|
|
|
// tests
|
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
|
}
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled false
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'),
|
|
'proguard-rules.pro'
|
|
}
|
|
debug {
|
|
buildConfigField "String", "LOGIN_URL", appLoginUrl
|
|
buildConfigField "String", "LOGIN_USERNAME", appLoginUsername
|
|
buildConfigField "String", "LOGIN_PASSWORD", appLoginPassword
|
|
}
|
|
}
|
|
flavorDimensions "build"
|
|
productFlavors {
|
|
githubConfig {
|
|
versionNameSuffix '-github'
|
|
dimension "build"
|
|
buildConfigField "boolean", "GITHUB_VERSION", "true"
|
|
}
|
|
storeConfig {
|
|
versionNameSuffix '-store'
|
|
dimension "build"
|
|
buildConfigField "boolean", "GITHUB_VERSION", "false"
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
// Testing
|
|
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
|
|
androidTestCompile 'com.android.support.test:runner:0.5'
|
|
// Espresso-contrib for DatePicker, RecyclerView, Drawer actions, Accessibility checks, CountingIdlingResource
|
|
androidTestCompile 'com.android.support.test.espresso:espresso-contrib:2.2.2'
|
|
// Espresso-intents for validation and stubbing of Intents
|
|
androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.2.2'
|
|
|
|
|
|
compile fileTree(dir: 'libs', include: ['*.jar'])
|
|
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
|
|
|
|
// Android Support
|
|
compile 'com.android.support:appcompat-v7:26.0.1'
|
|
compile 'com.android.support:design:26.0.1'
|
|
compile 'com.android.support:recyclerview-v7:26.0.1'
|
|
compile 'com.android.support:support-v4:26.0.1'
|
|
compile 'com.android.support:support-vector-drawable:26.0.1'
|
|
compile 'com.android.support:customtabs:26.0.1'
|
|
compile 'com.android.support:cardview-v7:26.0.1'
|
|
compile 'com.android.support.constraint:constraint-layout:1.0.2'
|
|
|
|
// Firebase + crashlytics
|
|
compile 'com.google.firebase:firebase-core:11.2.0'
|
|
compile 'com.google.firebase:firebase-config:11.2.0'
|
|
compile 'com.google.firebase:firebase-invites:11.2.0'
|
|
compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
|
|
transitive = true
|
|
}
|
|
|
|
//multidex
|
|
compile 'com.android.support:multidex:1.0.2'
|
|
|
|
// Intro
|
|
compile 'agency.tango.android:material-intro-screen:0.0.5'
|
|
|
|
// About
|
|
compile('com.mikepenz:aboutlibraries:5.9.6@aar') {
|
|
transitive = true
|
|
}
|
|
|
|
// Retrofit + http logging + okhttp
|
|
compile 'com.squareup.retrofit2:retrofit:2.3.0'
|
|
compile 'com.squareup.okhttp3:logging-interceptor:3.8.0'
|
|
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
|
|
compile 'com.burgstaller:okhttp-digest:1.12'
|
|
|
|
// Material-ish things
|
|
compile 'com.ashokvarma.android:bottom-navigation-bar:2.0.2'
|
|
compile 'com.melnykov:floatingactionbutton:1.3.0'
|
|
compile 'com.github.jd-alexander:LikeButton:0.2.1'
|
|
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
|
|
compile 'org.sufficientlysecure:html-textview:3.3'
|
|
|
|
// glide
|
|
compile 'com.github.bumptech.glide:glide:4.1.0'
|
|
compile 'com.github.bumptech.glide:okhttp3-integration:4.0.0'
|
|
|
|
// Asking politely users to rate the app
|
|
compile 'com.github.stkent:amplify:1.5.0'
|
|
|
|
// For the article reader
|
|
compile 'com.klinkerapps:drag-dismiss-activity:1.4.3'
|
|
|
|
// Drawer
|
|
compile('com.mikepenz:materialdrawer:5.9.5@aar') {
|
|
transitive = true
|
|
}
|
|
compile 'com.anupcowkur:reservoir:3.1.0'
|
|
|
|
// Themes
|
|
compile 'com.52inc:scoops:1.0.0'
|
|
|
|
}
|
|
|
|
apply plugin: 'com.google.gms.google-services'
|
|
|
|
|
|
afterEvaluate {
|
|
initFabricPropertiesIfNeeded()
|
|
initAppLoginPropertiesIfNeeded()
|
|
}
|
|
|
|
def initFabricPropertiesIfNeeded() {
|
|
def propertiesFile = file('fabric.properties')
|
|
if (!propertiesFile.exists()) {
|
|
def commentMessage = "This is autogenerated fabric property from system environment to prevent key to be committed to source control."
|
|
ant.propertyfile(file: "fabric.properties", comment: commentMessage) {
|
|
entry(key: "apiSecret", value: crashlyticsdemoApisecret)
|
|
entry(key: "apiKey", value: crashlyticsdemoApikey)
|
|
}
|
|
}
|
|
}
|
|
|
|
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"))
|
|
}
|
|
}
|
|
}
|