/
build.gradle
152 lines (116 loc) · 5.11 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
apply plugin: 'com.android.application'
apply plugin: 'jacoco-android'
android {
compileSdkVersion rootProject.ext.compileSdkVersion
defaultConfig {
applicationId "com.mirhoseini.marvel"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.compileSdkVersion
versionCode 2
versionName "1.0.1"
vectorDrawables.useSupportLibrary = true
dataBinding {
enabled = true
}
/* replaced with custom MockTestRunner */
// testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "com.mirhoseini.marvel.MarvelTestRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
applicationIdSuffix '.debug'
versionNameSuffix '-debug'
// Run code coverage reports by default on debug builds.
testCoverageEnabled true
}
}
flavorDimensions "mode"
productFlavors {
prod {
dimension "mode"
}
mock {
dimension "mode"
}
}
dataBinding {
enabled = true
}
lintOptions {
abortOnError false
}
/* allows robolectric to access Android resources */
testOptions {
unitTests {
includeAndroidResources = true
}
}
/* allow using java 8 lambda */
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_8
}
}
// Grant animation permissions to avoid test failure because of ui sync.
task grantAnimationPermissions(type: Exec, dependsOn: 'installMock') {
group = 'test'
description = 'Grant permissions for testing.'
def absolutePath = file('..') // Get project absolute path
commandLine "$absolutePath/set_animation_permissions.sh com.mirhoseini.marvel".split(" ")
}
// Source: http://stackoverflow.com/q/29908110/112705
afterEvaluate {
tasks.each { task ->
if (task.name.startsWith('assembleMockAndroidTest')) {
task.dependsOn grantAnimationPermissions
}
}
}
jacocoAndroidUnitTestReport {
// fix jacoco issue with ButterKnife
excludes += ['**/*$ViewBinder*.*']
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':marvel-core')
testImplementation "junit:junit:$junitVersion"
testImplementation "org.robolectric:robolectric:$robolectricVersion"
androidTestImplementation "org.mockito:mockito-core:$mockitoVersion"
androidTestImplementation "com.google.dexmaker:dexmaker:$dexmakerVersion"
androidTestImplementation "com.google.dexmaker:dexmaker-mockito:$dexmakerVersion"
androidTestImplementation "com.android.support:support-annotations:$androidSupportVersion"
androidTestImplementation "com.android.support.test:runner:$supportTestVesion"
androidTestImplementation "com.android.support.test.espresso:espresso-core:$espressoVersion"
androidTestImplementation "com.android.support.test.espresso:espresso-contrib:$espressoVersion"
implementation "com.android.support:appcompat-v7:$androidSupportVersion"
implementation "com.android.support:support-v4:$androidSupportVersion"
implementation "com.android.support:design:$androidSupportVersion"
implementation "com.android.support:support-vector-drawable:$androidSupportVersion"
implementation "com.android.support:recyclerview-v7:$androidSupportVersion"
implementation "com.android.support:cardview-v7:$androidSupportVersion"
implementation "com.android.support:palette-v7:$androidSupportVersion"
implementation "io.reactivex.rxjava2:rxandroid:$rxandroidVersion"
implementation "com.jakewharton.rxbinding2:rxbinding:$rxbindingVersion"
implementation "io.reactivex.rxjava2:rxjava:$rxjavaVersion"
implementation "com.mirhoseini.utils:utils:$utilsVersion"
implementation "com.squareup.picasso:picasso:$picassoVersion"
implementation "com.jakewharton:butterknife:$butterknifeVersion"
annotationProcessor "com.jakewharton:butterknife-compiler:$butterknifeVersion"
implementation "com.squareup.retrofit2:retrofit:$retrofitVersion"
implementation "com.squareup.retrofit2:converter-gson:$retrofitVersion"
implementation "com.jakewharton.retrofit:retrofit2-rxjava2-adapter:$retrofitAdapterVersion"
implementation "com.squareup.okhttp3:okhttp:$okhttpVersion"
implementation "com.squareup.okhttp3:logging-interceptor:$okhttpVersion"
implementation "com.google.dagger:dagger:$daggerVersion"
annotationProcessor "com.google.dagger:dagger-compiler:$daggerVersion"
androidTestAnnotationProcessor "com.google.dagger:dagger-compiler:$daggerVersion"
implementation "com.jakewharton.timber:timber:$timberVersion"
implementation "com.j256.ormlite:ormlite-android:$ormLiteVersion"
implementation "com.google.firebase:firebase-core:$firebaseVersion"
implementation "com.google.firebase:firebase-crash:$firebaseVersion"
}
apply plugin: 'com.google.gms.google-services'