-
Notifications
You must be signed in to change notification settings - Fork 94
/
build.gradle
116 lines (101 loc) · 3.43 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
/*
* Copyright (C) 2021, Alashov Berkeli
* All rights reserved.
*/
import tm.alashow.buildSrc.Deps
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
maven { url 'https://maven.fabric.io/public' }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
mavenCentral()
}
dependencies {
classpath Deps.Android.gradle
classpath Deps.Kotlin.gradle
classpath Deps.Kotlin.serialization
classpath Deps.Gradle.googleServices
classpath Deps.Gradle.playPublisher
classpath Deps.Firebase.crashlyticsGradle
classpath Deps.Android.navigationSafeArgs
classpath Deps.Dagger.hiltGradle
}
}
plugins {
id "com.diffplug.spotless" version "6.1.0"
id "com.github.ben-manes.versions" version "0.42.0"
id "com.kncept.junit.reporter" version "2.1.0"
}
allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://androidx.dev/snapshots/builds/8020137/artifacts/repository' }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url 'https://jitpack.io' }
jcenter()
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs += "-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi"
freeCompilerArgs += "-Xopt-in=kotlinx.coroutines.FlowPreview"
freeCompilerArgs += "-Xopt-in=kotlin.Experimental"
freeCompilerArgs += "-Xopt-in=coil.annotation.ExperimentalCoilApi"
freeCompilerArgs += "-Xopt-in=com.google.accompanist.pager.ExperimentalPagerApi"
}
}
}
subprojects {
configurations.configureEach {
exclude group: 'androidx.appcompat'
exclude group: 'com.google.android.material', module: 'material'
}
apply plugin: 'com.diffplug.spotless'
spotless {
kotlin {
licenseHeaderFile project.rootProject.file('spotless/copyright.kt')
target "**/*.kt"
ktlint("0.41.0").userData([
'android' : 'true',
'max_line_length': '200',
'disabled_rules' : 'no-wildcard-imports'
])
}
format 'misc', {
target '**/*.gradle', '**/*.md', '**/.gitignore'
trimTrailingWhitespace()
indentWithTabs()
}
}
afterEvaluate { project ->
if (project.hasProperty("android")) {
android {
defaultConfig {
testInstrumentationRunner "tm.alashow.base.testing.AndroidTestRunner"
}
testOptions {
unitTests {
includeAndroidResources = true
}
}
}
}
}
}
Object prop(String propertyName, Object defaultValue) {
def propertyValue = project.properties[propertyName]
def envValue = System.getenv(propertyName)
return propertyValue != null ? propertyValue : (envValue != null ? envValue : defaultValue)
}
def getFile(String... fileNames) {
for (fileName in fileNames) {
File file = rootProject.file(fileName)
if (file.exists()) {
return file
}
}
return null
}
apply from: file('gradle/projectDependencyGraph.gradle')