-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbuild.gradle
More file actions
173 lines (153 loc) · 5.56 KB
/
build.gradle
File metadata and controls
173 lines (153 loc) · 5.56 KB
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.google.services)
alias(libs.plugins.firebase.crashlytics)
id 'jacoco'
id 'kotlin-parcelize'
}
android {
namespace 'com.pennapps.labs.pennmobile'
buildFeatures {
buildConfig = true
}
buildTypes {
debug {
matchingFallbacks = ['qa', 'release']
enableUnitTestCoverage true
enableAndroidTestCoverage true
}
release {}
}
compileSdk 34
buildFeatures {
viewBinding true
compose true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.14"
}
kotlinOptions {
jvmTarget = "1.8"
}
defaultConfig {
minSdkVersion 26
targetSdkVersion 34
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
buildConfigField ("String", "PLATFORM_REDIRECT_URI", getPlatformRedirectUri())
buildConfigField ("String", "PLATFORM_CLIENT_ID", getPlatformClientID())
}
packagingOptions {
resources {
excludes += ['META-INF/rxjava.properties']
pickFirsts += ['META-INF/LICENSE.txt', 'META-INF/NOTICE.txt']
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation libs.androidx.espresso.core
androidTestImplementation libs.androidx.junit
androidTestImplementation libs.kaspresso
androidTestImplementation libs.testng
annotationProcessor libs.compiler
debugImplementation libs.leakcanary.android
implementation libs.rxandroid
implementation libs.androidx.annotation
implementation (libs.androidx.lifecycle.extensions) {
transitive = true
}
implementation libs.androidx.browser
implementation libs.androidx.cardview
implementation libs.androidx.constraintlayout
implementation libs.androidx.coordinatorlayout
implementation libs.androidx.exifinterface
implementation libs.androidx.legacy.support.v4
implementation libs.androidx.lifecycle.runtime.ktx
implementation libs.androidx.multidex
implementation libs.androidx.palette.ktx
implementation libs.androidx.percentlayout
implementation libs.androidx.preference.ktx
implementation libs.androidx.recyclerview
implementation libs.lottie
implementation libs.library
implementation libs.blurview
implementation libs.mpandroidchart
implementation libs.android.rss
implementation libs.glide
implementation(libs.customalertviewdialogue){
exclude group: 'com.github.Dimezis.BlurView', module: 'blurview'
}
implementation libs.logging.interceptor
implementation libs.okhttp
implementation libs.picasso
implementation libs.adapter.rxjava2
implementation libs.squareup.retrofit
implementation libs.reactivex.rxandroid
implementation libs.joda.time
implementation libs.commons.lang3
implementation libs.kotlinx.coroutines.core
implementation libs.jsoup
implementation platform(libs.androidx.compose.bom)
testImplementation platform(libs.androidx.compose.bom)
androidTestImplementation platform(libs.androidx.compose.bom)
implementation platform(libs.firebase.bom)
implementation(libs.firebase.messaging)
implementation libs.bundles.compose
implementation libs.bundles.material
implementation libs.bundles.firebase
implementation libs.bundles.runtime
implementation libs.bundles.retrofit2
implementation libs.bundles.ui
implementation libs.bundles.google
testImplementation libs.junit
}
String getPlatformClientID() {
def propFile = rootProject.file("./local.properties")
def properties = new Properties()
properties.load(new FileInputStream(propFile))
System.out.println(properties.toString())
return properties['PLATFORM_CLIENT_ID']
}
String getPlatformRedirectUri() {
def propFile = rootProject.file("./local.properties")
def properties = new Properties()
properties.load(new FileInputStream(propFile))
System.out.println(properties.toString())
return properties['PLATFORM_REDIRECT_URI']
}
// Code Coverage: https://www.raywenderlich.com/10562143-continuous-integration-for-android#toc-anchor-014
jacoco {
toolVersion = "0.8.11"
}
// https://stackoverflow.com/questions/68065743/cannot-run-gradle-test-tasks-because-of-java-lang-noclassdeffounderror-jdk-inte
tasks.withType(Test).configureEach {
jacoco.includeNoLocationClasses = true
jacoco.excludes = ['jdk.internal.*']
}
// Files with such regex patterns are to be excluded
def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*',
'**/Manifest*.*', '**/*Test*.*', 'android/**/*.*']
// Location of generated output classes
def debugTree = fileTree(dir: "$project.layout.buildDirectory/tmp/kotlin-classes/debug",
excludes: fileFilter)
// Source code directory
def mainSrc = "$project.projectDir/src/main/java"
// Task declaration
tasks.register('jacocoTestReport', JacocoReport) {
// Runs only after the dependencies are executed
dependsOn = ['testDebugUnitTest', 'createDebugCoverageReport']
// Export formats
/*reports {
xml.enabled = true
html.enabled = true
}*/
sourceDirectories.setFrom(files([mainSrc]))
classDirectories.setFrom(files([debugTree]))
// Inform Gradle where the files generated by test cases - are located
executionData.from = fileTree(dir: project.layout.buildDirectory, includes: [
'jacoco/testDebugUnitTest.exec'
// 'outputs/code_coverage/debugAndroidTest/connected/*.ec'
])
}