ReaderforSelfoss/app/build.gradle

218 lines
7.6 KiB
Groovy
Raw Normal View History

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() {
2017-07-30 17:01:05 +00:00
println "version code " + gitVersion().toInteger()
return gitVersion().toInteger()
}
def versionNameFromGit() {
2017-07-30 17:01:05 +00:00
println "version code " + gitVersion().trim()
return gitVersion().trim()
}
2017-10-21 18:10:19 +00:00
apply plugin: 'org.sonarqube'
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'kotlin-android'
repositories {
2017-10-21 18:10:19 +00:00
maven {
url 'https://maven.fabric.io/public'
}
}
android {
2017-11-11 13:28:06 +00:00
compileSdkVersion 27
buildToolsVersion '27.0.0'
defaultConfig {
applicationId "apps.amine.bou.readerforselfoss"
minSdkVersion 16
2017-07-25 19:17:34 +00:00
targetSdkVersion 26
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
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
buildConfigField "String", "MERCURY_KEY", mercuryApiKey
buildConfigField "String", "FEEDBACK_EMAIL", feedbackEmail
buildConfigField "String", "SOURCE_URL", sourceUrl
buildConfigField "String", "TRACKER_URL", trackerUrl
2017-09-16 20:28:20 +00:00
buildConfigField "String", "TRANSLATION_URL", translationUrl
2017-10-23 16:29:44 +00:00
buildConfigField "String", "GITHUB_TOKEN", githubToken
}
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
}
}
flavorDimensions "build"
productFlavors {
githubConfig {
versionNameSuffix '-github'
dimension "build"
buildConfigField "boolean", "GITHUB_VERSION", "true"
}
storeConfig {
versionNameSuffix '-store'
dimension "build"
buildConfigField "boolean", "GITHUB_VERSION", "false"
}
}
}
dependencies {
2017-06-11 10:04:39 +00:00
// Testing
2017-10-27 16:48:22 +00:00
androidTestCompile 'com.android.support.test.espresso:espresso-core:3.0.1'
androidTestCompile 'com.android.support.test:runner:1.0.1'
2017-06-11 10:04:39 +00:00
// Espresso-contrib for DatePicker, RecyclerView, Drawer actions, Accessibility checks, CountingIdlingResource
2017-10-27 16:48:22 +00:00
androidTestCompile 'com.android.support.test.espresso:espresso-contrib:3.0.1'
2017-06-11 10:04:39 +00:00
// Espresso-intents for validation and stubbing of Intents
2017-10-27 16:48:22 +00:00
androidTestCompile 'com.android.support.test.espresso:espresso-intents:3.0.1'
2017-06-11 10:04:39 +00:00
compile fileTree(dir: 'libs', include: ['*.jar'])
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
// Android Support
2017-11-11 13:28:06 +00:00
compile 'com.android.support:appcompat-v7:27.0.0'
compile 'com.android.support:design:27.0.0'
compile 'com.android.support:recyclerview-v7:27.0.0'
compile 'com.android.support:support-v4:27.0.0'
compile 'com.android.support:support-vector-drawable:27.0.0'
compile 'com.android.support:customtabs:27.0.0'
compile 'com.android.support:cardview-v7:27.0.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
// Firebase + crashlytics
2017-10-27 16:48:22 +00:00
compile 'com.google.firebase:firebase-core:11.4.2'
compile 'com.google.firebase:firebase-config:11.4.2'
compile 'com.google.firebase:firebase-invites:11.4.2'
compile('com.crashlytics.sdk.android:crashlytics:2.7.1@aar') {
transitive = true;
}
//multidex
2017-08-16 18:55:34 +00:00
compile 'com.android.support:multidex:1.0.2'
// Intro
compile 'agency.tango.android:material-intro-screen:0.0.5'
// About
2017-11-11 13:28:06 +00:00
compile('com.mikepenz:aboutlibraries:6.0.0@aar') {
transitive = true
}
// Retrofit + http logging + okhttp
compile 'com.squareup.retrofit2:retrofit:2.3.0'
2017-09-10 17:22:07 +00:00
compile 'com.squareup.okhttp3:logging-interceptor:3.9.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.3'
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'
2017-10-27 16:48:22 +00:00
compile 'org.sufficientlysecure:html-textview:3.5'
// glide
2017-09-10 17:22:07 +00:00
compile 'com.github.bumptech.glide:glide:4.1.1'
compile 'com.github.bumptech.glide:okhttp3-integration:4.1.1'
// Asking politely users to rate the app
2017-09-10 10:59:51 +00:00
compile 'com.github.stkent:amplify:2.1.0'
// For the article reader
compile 'com.klinkerapps:drag-dismiss-activity:1.5.0'
2017-06-04 14:09:42 +00:00
// Drawer
implementation 'co.zsmb:materialdrawer-kt:1.2.1'
2017-06-04 14:09:42 +00:00
compile 'com.anupcowkur:reservoir:3.1.0'
// Themes
compile 'com.52inc:scoops:1.0.0'
2017-10-23 16:29:44 +00:00
// Github issues reporter
compile 'com.heinrichreimersoftware:android-issue-reporter:1.3.1'
}
2017-05-29 17:54:35 +00:00
apply plugin: 'com.google.gms.google-services'
2017-05-29 17:54:35 +00:00
afterEvaluate {
initFabricPropertiesIfNeeded()
2017-06-11 10:04:39 +00:00
initAppLoginPropertiesIfNeeded()
initAppForSecretPropertiesIfNeeded()
2017-05-29 17:54:35 +00:00
}
2017-05-29 17:54:35 +00:00
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)
}
}
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"))
}
}
}
def initAppForSecretPropertiesIfNeeded() {
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: "mercuryApiKey", value: System.getProperty("mercuryApiKey"))
entry(key: "feedbackEmail", value: System.getProperty("feedbackEmail"))
entry(key: "sourceUrl", value: System.getProperty("sourceUrl"))
entry(key: "trackerUrl", value: System.getProperty("trackerUrl"))
2017-09-16 20:28:20 +00:00
entry(key: "translationUrl", value: System.getProperty("translationUrl"))
2017-10-23 16:29:44 +00:00
entry(key: "githubToken", value: System.getProperty("githubToken"))
}
}
}