-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle.kts
91 lines (83 loc) · 2.54 KB
/
build.gradle.kts
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
import com.android.build.gradle.LibraryExtension
import com.android.build.gradle.internal.dsl.BaseAppModuleExtension
import com.diffplug.gradle.spotless.SpotlessExtension
import org.jetbrains.kotlin.gradle.dsl.KotlinTopLevelExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
buildscript {
dependencies {
classpath("app.cash.paraphrase:plugin")
}
}
plugins {
alias(libs.plugins.androidApplication) apply false
alias(libs.plugins.androidLibrary) apply false
alias(libs.plugins.androidTest) apply false
alias(libs.plugins.kotlinAndroid) apply false
alias(libs.plugins.kotlinJvm) apply false
alias(libs.plugins.poko) apply false
alias(libs.plugins.kotlinApiDump) apply false
alias(libs.plugins.dokka)
alias(libs.plugins.mavenPublish)
alias(libs.plugins.spotless)
}
configure<SpotlessExtension> {
kotlin {
target("**/*.kt")
ktlint(libs.versions.ktlint.get())
licenseHeaderFile(file("gradle/license-header.txt"))
}
kotlinGradle {
ktlint(libs.versions.ktlint.get())
}
}
subprojects {
version = extra["VERSION_NAME"]!!
plugins.withId("com.vanniktech.maven.publish") {
// All published libraries must use API tracking to help maintain compatibility.
plugins.apply(libs.plugins.kotlinApiDump.get().pluginId)
val kotlin = extensions.getByName("kotlin") as KotlinTopLevelExtension
kotlin.explicitApi()
publishing {
repositories {
/**
* Want to push to an internal repository for testing?
* Set the following properties in ~/.gradle/gradle.properties.
*
* internalUrl=YOUR_INTERNAL_URL
* internalUsername=YOUR_USERNAME
* internalPassword=YOUR_PASSWORD
*/
val internalUrl = providers.gradleProperty("internalUrl")
if (internalUrl.isPresent()) {
maven {
name = "internal"
setUrl(internalUrl)
credentials(PasswordCredentials::class)
}
}
}
}
}
val javaVersion = JavaVersion.VERSION_1_8.toString()
tasks.withType<KotlinJvmCompile> {
kotlinOptions {
jvmTarget = javaVersion
}
}
plugins.withId("com.android.library") {
with(extensions.getByType<LibraryExtension>()) {
compileOptions {
sourceCompatibility(javaVersion)
targetCompatibility(javaVersion)
}
}
}
plugins.withId("com.android.application") {
with(extensions.getByType<BaseAppModuleExtension>()) {
compileOptions {
sourceCompatibility(javaVersion)
targetCompatibility(javaVersion)
}
}
}
}