/
build.gradle
120 lines (107 loc) · 3.65 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.versions = [
kotlin : '1.3.72',
coroutines : '1.3.7',
constraint_layout : '2.0.0-beta6',
dagger : '2.28',
lifecycle : '2.2.0',
timber : "4.7.1",
junit : '4.13',
espresso : '3.2.0',
mockito : '3.3.3',
nstack : '3.2.5',
nodes_arch : '2.3.5',
retrofit : '2.9.0',
okhttp : '4.6.0',
ktx : '1.3.0',
material : '1.2.0-beta01',
archCore : '2.1.0',
navigation : '2.2.2',
nodes_utils : '1.0.0',
nodes_utils_okhttp : '0.12.2',
preferences : '1.1.1',
chucker : '3.2.0',
leak_canary : '2.3',
desugaring : '1.0.5'
]
ext.keys = [
appId : 'bOdrNuZd4syxuAz6gyCb3xwBCjA8U4h4IcQI',
apiKey : 'X0ENl5QpKI51tS9CzKSt1PGwfZeq2gBMTU58',
acceptHeader: "da-DK"
]
ext.sdks = [
compileSdkVersion: 29,
buildToolsVersion: '29.0.0',
minSdkVersion : 21,
targetSdkVersion : 29
]
repositories {
mavenCentral()
google()
jcenter()
mavenLocal()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
classpath "dk.nodes.nstack:translation:${versions.nstack}"
classpath "com.github.gfx.ribbonizer:ribbonizer-plugin:2.1.0"
}
}
plugins {
id "com.diffplug.gradle.spotless" version "3.27.2"
id 'com.github.ben-manes.versions' version "0.28.0"
}
allprojects {
repositories {
mavenCentral()
maven { url 'https://maven.google.com' }
jcenter()
mavenLocal()
}
}
subprojects {
apply plugin: 'com.diffplug.gradle.spotless'
spotless {
format 'misc', {
target '**/*.gradle'
trimTrailingWhitespace()
indentWithSpaces(4) // or spaces. Takes an integer argument if you don't like 4
endWithNewline()
}
kotlin {
target "**/*.kt"
ktlint('0.33.0')
targetExclude("**/RateReminderActions.kt")
}
java {
target "**/*.java"
targetExclude '**/Translation.java'
googleJavaFormat('1.1').aosp()
}
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
// Treat all Kotlin warnings as errors, don't go full retarded
// allWarningsAsErrors = true
// Enable experimental coroutines APIs, including Flow
freeCompilerArgs += "-Xuse-experimental=kotlinx.coroutines.ExperimentalCoroutinesApi"
freeCompilerArgs += "-Xuse-experimental=kotlinx.coroutines.FlowPreview"
// Set JVM target to 1.8
jvmTarget = "1.8"
}
}
}
dependencyUpdates.resolutionStrategy {
componentSelection { rules ->
rules.all { ComponentSelection selection ->
boolean rejected = ['alpha', 'beta', 'cr', 'm', 'preview'].any { qualifier ->
selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
}
if (rejected) {
selection.reject('Release candidate')
}
}
}
}