Skip to content
Snippets Groups Projects
Commit 5b7a55af authored by Jawnnypoo's avatar Jawnnypoo
Browse files

Multidex since it is faster than ProGuard on incremental builds post 21

parent 6e8d5192
No related branches found
No related tags found
No related merge requests found
Pipeline #
Loading
Loading
@@ -21,4 +21,4 @@ stages:
build:
stage: build
script:
- ./gradlew testFdroidDebug
\ No newline at end of file
- ./gradlew testFdroidDevDebug
\ No newline at end of file
Loading
Loading
@@ -4,7 +4,7 @@ buildscript {
}
 
dependencies {
classpath 'io.fabric.tools:gradle:1.22.0'
classpath 'io.fabric.tools:gradle:1.22.1'
}
}
 
Loading
Loading
@@ -28,6 +28,7 @@ android {
project.ext {
LABCOAT_FABRIC_KEY = project.hasProperty("LABCOAT_FABRIC_KEY") ? project.LABCOAT_FABRIC_KEY : "";
}
defaultConfig {
applicationId "com.commit451.gitlab"
minSdkVersion 16
Loading
Loading
@@ -37,25 +38,41 @@ android {
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
manifestPlaceholders = [fabric_key: project.ext.LABCOAT_FABRIC_KEY]
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
}
 
flavorDimensions "TYPE", "API"
productFlavors {
// https://developer.android.com/tools/building/multidex.html#dev-build
dev {
dimension "API"
minSdkVersion 21
}
prod {
dimension "API"
}
normal {
dimension "TYPE"
}
 
fdroid {
dimension "TYPE"
}
}
 
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
ext.enableCrashlytics = true
shrinkResources true
}
debug {
minifyEnabled true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
ext.enableCrashlytics = false
}
Loading
Loading
@@ -68,19 +85,21 @@ android {
}
}
 
ext.supportLibVersion = '25.1.0'
ext.retrofitVersion = '2.1.0'
ext.okHttpVersion = '3.5.0'
ext.butterknifeVersion = '8.4.0'
ext.loganSquareVersion = '1.3.7'
ext.parcelerVersion = '1.1.6'
ext.reptarVersion = '2.1.0'
ext.adapterLayout = '1.1.0'
ext.materialDialogsVersion = '0.9.2.2'
ext {
supportLibVersion = '25.1.0'
retrofitVersion = '2.1.0'
okHttpVersion = '3.5.0'
butterknifeVersion = '8.5.0'
loganSquareVersion = '1.3.7'
parcelerVersion = '1.1.6'
reptarVersion = '2.2.1'
adapterLayout = '1.1.0'
materialDialogsVersion = '0.9.2.3'
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
 
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
 
compile "com.android.support:appcompat-v7:$supportLibVersion"
compile "com.android.support:design:$supportLibVersion"
Loading
Loading
@@ -88,6 +107,7 @@ dependencies {
compile "com.android.support:cardview-v7:$supportLibVersion"
compile "com.android.support:palette-v7:$supportLibVersion"
compile "com.android.support:customtabs:$supportLibVersion"
compile 'com.android.support:multidex:1.0.1'
 
compile "com.squareup.retrofit2:retrofit:$retrofitVersion"
compile("com.squareup.retrofit2:converter-simplexml:$retrofitVersion") {
Loading
Loading
@@ -109,7 +129,7 @@ dependencies {
compile 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'
compile "com.jakewharton:butterknife:$butterknifeVersion"
kapt "com.jakewharton:butterknife-compiler:$butterknifeVersion"
compile 'com.jakewharton.timber:timber:4.4.0'
compile 'com.jakewharton.timber:timber:4.5.1'
 
compile 'org.greenrobot:eventbus:3.0.0'
 
Loading
Loading
@@ -136,7 +156,7 @@ dependencies {
compile 'com.github.Commit451:Jounce:1.0.1'
compile 'com.github.Commit451:ForegroundViews:2.3.1'
compile 'com.github.Commit451:MorphTransitions:2.0.0'
compile 'com.github.Commit451:Alakazam:0.0.1'
compile 'com.github.Commit451.Alakazam:alakazam:1.0.0@aar'
compile 'com.github.Commit451:Lift:1.2.0'
compile 'com.github.Commit451:OkioProGuardRules:1.11.0.0'
compile 'com.github.Commit451:RetrofitProguardRules:2.1.0.0'
Loading
Loading
@@ -155,7 +175,7 @@ dependencies {
 
compile 'com.github.alorma:diff-textview:1.3.0'
 
compile 'com.wdullaer:materialdatetimepicker:3.0.0'
compile 'com.wdullaer:materialdatetimepicker:3.1.0'
 
compile 'com.wefika:flowlayout:0.4.1'
 
Loading
Loading
@@ -176,7 +196,7 @@ dependencies {
transitive = true;
}
 
normalCompile('com.crashlytics.sdk.android:crashlytics:2.6.5@aar') {
normalCompile('com.crashlytics.sdk.android:crashlytics:2.6.6@aar') {
transitive = true;
}
 
Loading
Loading
@@ -185,5 +205,5 @@ dependencies {
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
 
testCompile 'junit:junit:4.12'
testCompile 'org.robolectric:robolectric:3.2.1'
testCompile 'org.robolectric:robolectric:3.2.2'
}
package com.commit451.gitlab
 
import android.app.Application
import android.content.Context
import android.content.res.Resources
import android.net.Uri
import android.support.annotation.VisibleForTesting
import android.support.multidex.MultiDex
import com.bluelinelabs.logansquare.LoganSquare
import com.commit451.gitlab.api.*
import com.commit451.gitlab.api.converter.UriTypeConverter
Loading
Loading
@@ -83,6 +85,11 @@ open class App : Application() {
Lift.track(this)
}
 
override fun attachBaseContext(base: Context) {
super.attachBaseContext(base)
setupMultidex()
}
fun setAccount(account: Account) {
currentAccount = account
//This is kinda weird, but basically, I don't want to see all the annoying logs from bitmap
Loading
Loading
@@ -106,6 +113,11 @@ open class App : Application() {
return currentAccount
}
 
@VisibleForTesting
protected open fun setupMultidex() {
MultiDex.install(this)
}
@VisibleForTesting
protected open fun setupCrashReporting() {
FabricUtil.init(this)
Loading
Loading
Loading
Loading
@@ -33,4 +33,9 @@ public class TestApp extends App implements TestLifecycleApplication {
protected void setupLeakCanary() {
//Intentionally left blank
}
@Override
protected void setupMultidex() {
//Intentionally left blank
}
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply plugin: 'com.github.ben-manes.versions'
buildscript {
ext.kotlin_version = '1.0.6'
ext.kotlinVersion = '1.0.6'
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
//check with ./gradlew dependencyUpdates
classpath 'com.github.ben-manes:gradle-versions-plugin:0.13.0'
}
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment