forked from CodandoTV/Netflix-Android
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
102 lines (84 loc) · 2.59 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
102 lines (84 loc) · 2.59 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
import Dependencies.modules
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath(Dependencies.Gradle.kotlinPlugin)
classpath(Dependencies.Gradle.kotlinGradlePlugin)
classpath(Dependencies.Gradle.androidTools)
classpath(kotlin(Dependencies.Gradle.gradlePlugin, Versions.kotlin_version))
}
}
allprojects {
repositories {
google()
mavenCentral()
maven(url = uri("https://oss.sonatype.org/content/repositories/snapshots/"))
}
configureAndroid()
}
fun Project.configureAndroid() {
val isAppModule = name == "app"
when {
isAppModule -> configureAppAndroid()
modules.contains(name) -> configureAndroidLibrary()
else -> return
}
apply(plugin = "kotlin-android")
apply(plugin = "kotlin-kapt")
apply(plugin = "kotlin-parcelize")
configure<com.android.build.gradle.BaseExtension> {
compileSdkVersion(Config.compileSdkVersion)
buildToolsVersion(Config.buildToolsVersion)
namespace = Config.applicationId
defaultConfig {
minSdk = Config.minSdkVersion
targetSdk = Config.targetSdkVersion
versionCode = Config.versionCode
versionName = Config.versionName
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
multiDexEnabled = true
}
lintOptions {
isCheckReleaseBuilds = false
isCheckDependencies = true
isCheckAllWarnings = true
isWarningsAsErrors = true
isIgnoreWarnings = true
isAbortOnError = false
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
}
fun Project.configureAppAndroid() {
apply(plugin = "com.android.application")
configure<com.android.build.gradle.BaseExtension> {
defaultConfig {
applicationId = Config.applicationId
}
testOptions {
animationsDisabled = true
}
buildTypes {
getByName("release") {
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
}
}
fun Project.configureAndroidLibrary() {
apply(plugin = "com.android.library")
}
tasks.register("clean").configure {
delete("build")
}