forked from ZacSweers/redacted-compiler-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
95 lines (84 loc) · 2.76 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
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.SonatypeHost
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
buildscript {
dependencies {
// Include our included build
classpath("dev.zacsweers.redacted:redacted-compiler-plugin-gradle")
}
}
plugins {
kotlin("jvm") version "1.6.10" apply false
id("org.jetbrains.dokka") version "1.6.0" apply false
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.8.0"
id("com.google.devtools.ksp") version "1.6.10-1.0.2" apply false
id("com.vanniktech.maven.publish") version "0.18.0" apply false
id("com.diffplug.spotless") version "6.1.0"
}
plugins.withType<NodeJsRootPlugin>().configureEach {
// 16+ required for Apple Silicon support
// https://youtrack.jetbrains.com/issue/KT-49109#focus=Comments-27-5259190.0-0
the<NodeJsRootExtension>().nodeVersion = "17.0.0"
}
apiValidation { ignoredProjects += listOf("sample") }
spotless {
format("misc") {
target("*.gradle", "*.md", ".gitignore")
trimTrailingWhitespace()
indentWithSpaces(2)
endWithNewline()
}
kotlin {
target("**/*.kt")
ktfmt("0.30")
trimTrailingWhitespace()
endWithNewline()
licenseHeaderFile("spotless/spotless.kt")
targetExclude("**/spotless.kt", "**/build/**")
}
kotlinGradle {
target("**/*.kts")
ktfmt("0.30")
trimTrailingWhitespace()
endWithNewline()
}
}
allprojects {
group = project.property("GROUP") as String
version = project.property("VERSION_NAME") as String
repositories {
google()
mavenCentral()
}
pluginManager.withPlugin("java") {
configure<JavaPluginExtension> { toolchain { languageVersion.set(JavaLanguageVersion.of(17)) } }
tasks.withType<JavaCompile>().configureEach { options.release.set(8) }
}
pluginManager.withPlugin("org.jetbrains.kotlin.jvm") {
project.tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
if (project.name != "sample") {
jvmTarget = "1.8"
}
@Suppress("SuspiciousCollectionReassignment")
freeCompilerArgs += listOf("-progressive", "-Xjvm-default=all")
}
}
}
pluginManager.withPlugin("org.jetbrains.dokka") {
tasks.named<DokkaTask>("dokkaHtml") {
outputDirectory.set(rootProject.file("docs/0.x"))
dokkaSourceSets.configureEach { skipDeprecated.set(true) }
}
}
plugins.withId("com.vanniktech.maven.publish.base") {
configure<MavenPublishBaseExtension> {
publishToMavenCentral(SonatypeHost.DEFAULT)
signAllPublications()
pomFromGradleProperties()
}
}
}