-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
85 lines (74 loc) · 2.12 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
buildscript {
ext.mainRootDir = rootProject.projectDir.absolutePath
apply from: file("project_config.gradle")
apply from: file("dependencies.gradle")
apply from: file("dependencies_resolution.gradle")
repositories {
google()
mavenCentral()
maven {
name = "r8"
url = "https://storage.googleapis.com/r8-releases/raw"
content { includeGroup("com.android.tools") }
}
}
dependencies {
classpath dep.r8
classpath dep.androidGradlePlugin
classpath dep.kotlinPlugin
}
configurations.all {
resolutionStrategy.forcedModules = forceDepsBuild
}
}
subprojects {
repositories {
google()
mavenCentral()
}
configurations.all {
resolutionStrategy.forcedModules = forceDepsProjects
excludeDepsProjects(it)
}
//region Projects config
def javaPlugin = "org.gradle.api.plugins.JavaPlugin"
def javaBasePlugin = "org.gradle.api.plugins.JavaBasePlugin"
def javaBasePluginInject = javaBasePlugin + '$' + "Inject"
def kotlinPlugin = "org.jetbrains.kotlin.gradle.plugin.KotlinPluginWrapper"
def kotlinAndroidPlugin = "org.jetbrains.kotlin.gradle.plugin.KotlinAndroidPluginWrapper"
def androidAppPlugin = "com.android.build.gradle.AppPlugin"
project.plugins.whenPluginAdded { plugin ->
switch (plugin.class.name) {
case [javaPlugin, javaBasePlugin, javaBasePluginInject]:
project.apply from: file("$mainRootDir/gradle/plugin_java.gradle")
break
case kotlinPlugin:
project.apply from: file("$mainRootDir/gradle/plugin_kotlin.gradle")
break
case kotlinAndroidPlugin:
project.apply from: file("$mainRootDir/gradle/plugin_kotlin_android.gradle")
break
case androidAppPlugin:
project.apply from: file("$mainRootDir/gradle/plugin_android_app.gradle")
break
}
}
//endregion Projects config
}
allprojects {
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}
if (hasProperty("buildScan")) {
buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
}
}
wrapper {
distributionType = Wrapper.DistributionType.BIN
}
apply from: file("gradle/tasks.gradle")