-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathbuild.gradle.kts
116 lines (111 loc) · 3.63 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
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
import com.diffplug.gradle.spotless.SpotlessExtension
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.SonatypeHost
import org.jetbrains.kotlin.gradle.dsl.KotlinAndroidProjectExtension
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
plugins {
alias(libs.plugins.mavenPublish) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.android.application) apply false
alias(libs.plugins.spotless) apply false
}
allprojects {
group = "app.cash.paging"
version = "${rootProject.libs.versions.androidx.paging.get()}-0.6.0-SNAPSHOT"
plugins.withId("org.jetbrains.kotlin.multiplatform") {
configure<KotlinMultiplatformExtension> {
jvmToolchain(11)
compilerOptions {
freeCompilerArgs.add("-Xexpect-actual-classes")
}
}
}
plugins.withId("org.jetbrains.kotlin.jvm") {
configure<KotlinJvmProjectExtension> {
jvmToolchain(11)
compilerOptions {
freeCompilerArgs.add("-Xexpect-actual-classes")
}
}
}
plugins.withId("org.jetbrains.kotlin.android") {
configure<KotlinAndroidProjectExtension> {
jvmToolchain(11)
compilerOptions {
freeCompilerArgs.add("-Xexpect-actual-classes")
}
}
}
apply(
plugin =
rootProject.libs.plugins.spotless
.get()
.pluginId,
)
configure<SpotlessExtension> {
kotlin {
target("**/*.kt")
targetExclude("upstreams/**/*.kt")
ktlint(libs.ktlint.get().version)
.customRuleSets(
listOf(
libs.ktlintComposeRules.get().toString(),
),
).editorConfigOverride(
mapOf(
// Disabled because paging-* filenames should be identical to that of AndroidX Paging.
"ktlint_standard_filename" to "disabled",
// Do not impose standard Kotlin function naming onto Compose functions.
"ktlint_function_naming_ignore_when_annotated_with" to "Composable",
),
)
}
kotlinGradle {
target("**/*.kts")
targetExclude("upstreams/**/*.kts")
ktlint(libs.ktlint.get().version)
}
}
plugins.withId("com.vanniktech.maven.publish.base") {
configure<PublishingExtension> {
repositories {
maven {
name = "testMaven"
url = file("${rootProject.buildDir}/testMaven").toURI()
}
}
}
@Suppress("UnstableApiUsage")
configure<MavenPublishBaseExtension> {
publishToMavenCentral(SonatypeHost.DEFAULT, automaticRelease = true)
signAllPublications()
pom {
description.set("Packages AndroidX's Paging library for Kotlin/Multiplatform.")
name.set(project.name)
url.set("https://github.com/cashapp/multiplatform-paging/")
licenses {
license {
name.set("The Apache Software License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
distribution.set("repo")
}
}
developers {
developer {
id.set("cashapp")
name.set("Cash App")
}
}
scm {
url.set("https://github.com/cashapp/multiplatform-paging/")
connection.set("scm:git:https://github.com/cashapp/multiplatform-paging.git")
developerConnection.set("scm:git:ssh://[email protected]/cashapp/multiplatform-paging.git")
}
}
}
}
}