-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAndroid.kt
More file actions
39 lines (32 loc) · 1.11 KB
/
Android.kt
File metadata and controls
39 lines (32 loc) · 1.11 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
package com.neki.android.buildlogic.extensions
import com.android.build.api.dsl.CommonExtension
import com.neki.android.buildlogic.const.BuildConst
import org.gradle.api.Project
import org.gradle.api.plugins.ExtensionAware
import org.gradle.kotlin.dsl.dependencies
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions
internal fun Project.configureAndroid(
commonExtension: CommonExtension<*, *, *, *, *, *>,
) {
commonExtension.apply {
compileSdk = BuildConst.COMPILE_SDK
defaultConfig {
minSdk = BuildConst.MIN_SDK
}
compileOptions {
sourceCompatibility = BuildConst.JAVA_VERSION
targetCompatibility = BuildConst.JAVA_VERSION
}
configureAndroidOptions {
jvmTarget = BuildConst.JDK_VERSION.toString()
}
dependencies {
add("detektPlugins", libs.findLibrary("detekt.formatting").get())
}
}
}
internal fun CommonExtension<*, *, *, *, *, *>.configureAndroidOptions(
block: KotlinJvmOptions.() -> Unit,
) {
(this as ExtensionAware).extensions.configure("kotlinOptions", block)
}