-
Notifications
You must be signed in to change notification settings - Fork 20
/
build.gradle
170 lines (133 loc) · 5.72 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: "androidx.navigation.safeargs.kotlin"
apply plugin: 'kotlin-kapt'
apply plugin: "de.undercouch.download"
configurations {
detekt
}
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
// Added NDK version to fix build issue in Android Gradle Plugin
// See https://github.com/Co-Epi/app-android/pull/261 for more details
ndkVersion "21.3.6528147"
defaultConfig {
applicationId "org.coepi.android"
minSdkVersion 23
targetSdkVersion 29
versionCode 3
versionName "0.3"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
buildFeatures {
dataBinding true
viewBinding true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
}
ext {
koin_version = "2.1.5"
work_version = "2.3.4"
core_version = "0.1.36"
binaries_target_dir = "$rootDir/coreBinariesCache/"
binaries_zip_name = "coreBinaries${core_version}.zip"
binaries_zip_path = "$binaries_target_dir/$binaries_zip_name"
}
task prepareDownloadBinaries() {
def directory = file(binaries_target_dir)
if (!directory.exists()) {
directory.mkdir()
}
// TODO delete zips that don't match this version
}
task downloadCoreBinaries(dependsOn: prepareDownloadBinaries, type: Download) {
src "https://github.com/co-epi/app-backend-rust/releases/download/$core_version/jniLibs.zip"
dest binaries_zip_path
overwrite false
doLast { println("Finished downloading core binaries") }
}
task installCoreBinaries(dependsOn: downloadCoreBinaries, type: Copy) {
def targetDirectory = "$rootDir/app/src/main"
doFirst { println("Unzipping core binaries to: $targetDirectory") }
def zipFile = file(binaries_zip_path)
def outputDir = file(targetDirectory)
from zipTree(zipFile)
into outputDir
doLast { println("Finished unzipping core binaries") }
}
task detekt(type: JavaExec) {
main = "io.gitlab.arturbosch.detekt.cli.Main"
classpath = configurations.detekt
def config = "$rootDir/tools/detekt.yml"
def input = "$projectDir/src/main/java"
def filters = ".*test.*,.*/resources/.*,.*/tmp/.*"
def output = "$projectDir/build/reports/detekt/results"
def params = ['-c', config,
'-i', input,
'-o', output,
'-f', filters]
println("PARAMS = $params") //to make sure the path is right
args(params)
}
preBuild.dependsOn installCoreBinaries
dependencies {
/* For local development: build https://github.com/Co-Epi/app-backend-rust/tree/master/android/core and copy .aar to app/libs
and use fileTree insted of "com.github.Co-Epi:app-backend-rust:$core_version":
implementation fileTree(dir: 'libs', include: ['*.aar']) */
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
testImplementation 'junit:junit:4.13'
testImplementation "com.google.truth:truth:1.0.1"
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.3.7'
implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
implementation "androidx.navigation:navigation-ui-ktx:$nav_version"
implementation "androidx.cardview:cardview:1.0.0"
implementation "org.koin:koin-androidx-scope:$koin_version"
implementation "org.koin:koin-androidx-viewmodel:$koin_version"
implementation "io.reactivex.rxjava2:rxkotlin:2.4.0"
implementation "io.reactivex.rxjava2:rxandroid:2.1.1"
implementation "androidx.lifecycle:lifecycle-reactivestreams-ktx:2.2.0"
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation "com.github.quickpermissions:quickpermissions-kotlin:0.4.0"
implementation 'com.google.code.gson:gson:2.8.6'
def appCenterSdkVersion = '3.1.0'
implementation "com.microsoft.appcenter:appcenter-analytics:${appCenterSdkVersion}"
implementation "com.microsoft.appcenter:appcenter-crashes:${appCenterSdkVersion}"
// used for KeyPair Generation (RSA+ECDSA+ED25519) / JSON Web Key + Signatures
implementation "com.nimbusds:nimbus-jose-jwt:7.8.1"
// used for GeoHash
implementation 'com.github.drfonfon:android-kotlin-geohash:1.0'
// UI notifications
implementation 'com.tapadoo.android:alerter:5.1.2'
// HTTP logging
implementation("com.squareup.okhttp3:logging-interceptor:4.3.1")
// Worker
implementation "androidx.work:work-runtime-ktx:$work_version"
implementation "androidx.work:work-rxjava2:$work_version"
implementation "androidx.viewpager2:viewpager2:1.0.0"
implementation "com.google.android.material:material:1.1.0"
implementation 'com.github.TCNCoalition:tcn-client-android:0.0.7'
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
implementation 'com.jakewharton.threetenabp:threetenabp:1.2.4'
implementation "com.github.Co-Epi:app-backend-rust:$core_version"
detekt 'io.gitlab.arturbosch.detekt:detekt-cli:1.0.0.RC8'
}