2017-05-27 21:05:27 +00:00
|
|
|
buildscript {
|
|
|
|
repositories {
|
|
|
|
maven { url 'https://maven.fabric.io/public' }
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
classpath 'io.fabric.tools:gradle:1.+'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-12-04 19:07:30 +00:00
|
|
|
ext {
|
|
|
|
configuration = [
|
|
|
|
buildDate: new Date()
|
|
|
|
]
|
2018-01-12 04:15:28 +00:00
|
|
|
// This will make me able to build multiple times a day. May break thinks. I may forget it.
|
2018-04-08 11:08:42 +00:00
|
|
|
todaysBuilds = "1"
|
2017-12-04 19:07:30 +00:00
|
|
|
}
|
|
|
|
|
2017-07-28 08:07:12 +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()
|
2017-07-28 08:07:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
def versionCodeFromGit() {
|
2018-04-15 19:32:34 +00:00
|
|
|
def dayInYear = ext.configuration.buildDate.format("D").padLeft(3, '0')
|
2018-03-31 16:25:14 +00:00
|
|
|
def versionCode = gitVersion() + (ext.configuration.buildDate.format("yyMM") + dayInYear + ext.todaysBuilds).toInteger()
|
2017-12-04 19:07:30 +00:00
|
|
|
println "version code " + versionCode
|
|
|
|
return versionCode.toInteger()
|
2017-07-28 08:07:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
def versionNameFromGit() {
|
2018-04-15 19:32:34 +00:00
|
|
|
def dayInYear = ext.configuration.buildDate.format("D").padLeft(3, '0')
|
2018-03-31 16:25:14 +00:00
|
|
|
def versionName = gitVersion() + ext.configuration.buildDate.format('yyMM') + dayInYear + ext.todaysBuilds
|
2017-12-04 19:07:30 +00:00
|
|
|
println "version name " + versionName
|
|
|
|
return versionName
|
2017-07-28 08:07:12 +00:00
|
|
|
}
|
|
|
|
|
2017-05-27 21:05:27 +00:00
|
|
|
apply plugin: 'com.android.application'
|
|
|
|
|
|
|
|
apply plugin: 'io.fabric'
|
|
|
|
|
|
|
|
apply plugin: 'kotlin-android'
|
|
|
|
|
2017-11-12 16:05:36 +00:00
|
|
|
apply plugin: 'kotlin-android-extensions'
|
|
|
|
|
2017-05-27 21:05:27 +00:00
|
|
|
repositories {
|
2017-10-21 18:10:19 +00:00
|
|
|
maven {
|
|
|
|
url 'https://maven.fabric.io/public'
|
|
|
|
}
|
2017-05-27 21:05:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
android {
|
2017-11-11 13:28:06 +00:00
|
|
|
compileSdkVersion 27
|
2018-03-27 17:59:34 +00:00
|
|
|
buildToolsVersion '27.0.3'
|
2017-05-27 21:05:27 +00:00
|
|
|
defaultConfig {
|
2017-05-28 00:29:42 +00:00
|
|
|
applicationId "apps.amine.bou.readerforselfoss"
|
2017-05-27 21:05:27 +00:00
|
|
|
minSdkVersion 16
|
2017-11-11 13:35:13 +00:00
|
|
|
targetSdkVersion 27
|
2017-07-28 08:07:12 +00:00
|
|
|
versionCode versionCodeFromGit()
|
|
|
|
versionName versionNameFromGit()
|
2017-05-27 21:05:27 +00:00
|
|
|
|
|
|
|
// 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"
|
2017-09-06 19:16:20 +00:00
|
|
|
|
|
|
|
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
|
2017-05-27 21:05:27 +00:00
|
|
|
}
|
|
|
|
buildTypes {
|
|
|
|
release {
|
2017-09-10 07:19:28 +00:00
|
|
|
minifyEnabled true
|
|
|
|
shrinkResources true
|
2017-05-27 21:05:27 +00:00
|
|
|
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
|
|
|
|
}
|
2017-05-27 21:05:27 +00:00
|
|
|
}
|
|
|
|
flavorDimensions "build"
|
|
|
|
productFlavors {
|
|
|
|
githubConfig {
|
|
|
|
versionNameSuffix '-github'
|
|
|
|
dimension "build"
|
|
|
|
buildConfigField "boolean", "GITHUB_VERSION", "true"
|
|
|
|
}
|
|
|
|
storeConfig {
|
2018-01-12 04:15:28 +00:00
|
|
|
// As jenkins publishes to alpha first, this is the default suffix now.
|
2018-01-16 21:13:00 +00:00
|
|
|
versionNameSuffix '-store'
|
2017-05-27 21:05:27 +00:00
|
|
|
dimension "build"
|
|
|
|
buildConfigField "boolean", "GITHUB_VERSION", "false"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2017-06-11 10:04:39 +00:00
|
|
|
// Testing
|
2018-03-27 17:59:34 +00:00
|
|
|
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
|
|
|
|
androidTestImplementation '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
|
2018-03-27 17:59:34 +00:00
|
|
|
androidTestImplementation '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
|
2018-03-27 17:59:34 +00:00
|
|
|
androidTestImplementation 'com.android.support.test.espresso:espresso-intents:3.0.1'
|
2017-06-11 10:04:39 +00:00
|
|
|
|
|
|
|
|
2018-03-27 17:59:34 +00:00
|
|
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
2017-05-27 21:05:27 +00:00
|
|
|
|
|
|
|
// Android Support
|
2018-04-07 15:19:41 +00:00
|
|
|
implementation 'com.android.support:appcompat-v7:27.1.1'
|
|
|
|
implementation 'com.android.support:design:27.1.1'
|
|
|
|
implementation 'com.android.support:recyclerview-v7:27.1.1'
|
|
|
|
implementation 'com.android.support:support-v4:27.1.1'
|
|
|
|
implementation 'com.android.support:support-vector-drawable:27.1.1'
|
|
|
|
implementation 'com.android.support:customtabs:27.1.1'
|
|
|
|
implementation 'com.android.support:cardview-v7:27.1.1'
|
2018-05-14 20:02:57 +00:00
|
|
|
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
|
2017-05-27 21:05:27 +00:00
|
|
|
|
|
|
|
// Firebase + crashlytics
|
2018-05-14 20:02:57 +00:00
|
|
|
implementation 'com.google.firebase:firebase-core:15.0.2'
|
|
|
|
implementation 'com.google.firebase:firebase-config:15.0.2'
|
|
|
|
implementation 'com.google.firebase:firebase-invites:15.0.1'
|
2018-04-07 15:19:41 +00:00
|
|
|
implementation('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') {
|
2018-03-25 19:11:47 +00:00
|
|
|
transitive = true
|
2017-05-27 21:05:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//multidex
|
2018-03-27 17:59:34 +00:00
|
|
|
implementation 'com.android.support:multidex:1.0.3'
|
2017-05-28 00:29:42 +00:00
|
|
|
|
|
|
|
// Intro
|
2018-03-27 17:59:34 +00:00
|
|
|
implementation 'agency.tango.android:material-intro-screen:0.0.5'
|
2017-05-28 00:29:42 +00:00
|
|
|
|
|
|
|
// About
|
2018-03-27 17:59:34 +00:00
|
|
|
implementation('com.mikepenz:aboutlibraries:6.0.0@aar') {
|
2017-05-28 00:29:42 +00:00
|
|
|
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'
|
2017-05-28 00:29:42 +00:00
|
|
|
|
|
|
|
// Material-ish things
|
2018-03-27 17:59:34 +00:00
|
|
|
implementation 'com.ashokvarma.android:bottom-navigation-bar:2.0.3'
|
|
|
|
implementation 'com.github.jd-alexander:LikeButton:0.2.1'
|
|
|
|
implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
|
2017-05-28 00:29:42 +00:00
|
|
|
|
|
|
|
// 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'
|
2017-05-28 00:29:42 +00:00
|
|
|
|
|
|
|
// Asking politely users to rate the app
|
2018-03-27 17:59:34 +00:00
|
|
|
implementation 'com.github.stkent:amplify:2.1.0'
|
2017-05-28 00:29:42 +00:00
|
|
|
|
2017-06-04 14:09:42 +00:00
|
|
|
// Drawer
|
2017-11-11 06:58:29 +00:00
|
|
|
implementation 'co.zsmb:materialdrawer-kt:1.2.1'
|
2018-03-27 17:59:34 +00:00
|
|
|
implementation 'com.anupcowkur:reservoir:3.1.0'
|
2017-06-04 14:09:42 +00:00
|
|
|
|
2017-07-02 15:12:02 +00:00
|
|
|
// Themes
|
2018-03-27 17:59:34 +00:00
|
|
|
implementation 'com.52inc:scoops:1.0.0'
|
2018-04-08 11:08:42 +00:00
|
|
|
implementation'com.jrummyapps:colorpicker:2.1.7'
|
2017-07-02 15:12:02 +00:00
|
|
|
|
2017-10-23 16:29:44 +00:00
|
|
|
// Github issues reporter
|
2018-03-27 17:59:34 +00:00
|
|
|
implementation 'com.heinrichreimersoftware:android-issue-reporter:1.3.1'
|
2017-11-11 19:39:56 +00:00
|
|
|
|
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-03-27 17:59:34 +00:00
|
|
|
implementation 'me.relex:circleindicator:1.2.2@aar'
|
2017-12-10 19:00:09 +00:00
|
|
|
|
2018-04-07 15:19:41 +00:00
|
|
|
implementation 'androidx.core:core-ktx:0.3'
|
2018-02-07 20:16:51 +00:00
|
|
|
|
2017-05-27 21:05:27 +00:00
|
|
|
}
|
|
|
|
|
2017-05-29 17:54:35 +00:00
|
|
|
apply plugin: 'com.google.gms.google-services'
|
2017-05-27 21:05:27 +00:00
|
|
|
|
|
|
|
|
2017-05-29 17:54:35 +00:00
|
|
|
afterEvaluate {
|
|
|
|
initFabricPropertiesIfNeeded()
|
2017-06-11 10:04:39 +00:00
|
|
|
initAppLoginPropertiesIfNeeded()
|
2017-09-06 19:16:20 +00:00
|
|
|
initAppForSecretPropertiesIfNeeded()
|
2017-05-29 17:54:35 +00:00
|
|
|
}
|
2017-05-27 21:05:27 +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"))
|
|
|
|
}
|
|
|
|
}
|
2017-07-28 08:07:12 +00:00
|
|
|
}
|
2017-09-06 19:16:20 +00:00
|
|
|
|
|
|
|
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"))
|
2017-09-06 19:16:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|