-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
117 lines (105 loc) · 3.68 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
117
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.SonatypeHost
import org.jetbrains.dokka.DokkaConfiguration.Visibility
import org.jetbrains.dokka.gradle.DokkaMultiModuleTask
import org.jetbrains.dokka.gradle.DokkaTaskPartial
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
import java.net.URI
buildscript {
extra["kotlin_plugin_id"] = "dev.nemecec.kotlinlogging.compile-time-plugin"
}
plugins {
kotlin("jvm").version(libs.versions.kotlinversion).apply(false)
alias(libs.plugins.dokka)
alias(libs.plugins.maven.publish)
}
allprojects {
group = "dev.nemecec.kotlinlogging.compiletimeplugin"
version = "1.0.0"
}
tasks.named("dokkaHtmlMultiModule", DokkaMultiModuleTask::class.java).configure {
moduleName.set("Kotlin-logging compile-time plugin")
}
allprojects {
tasks.withType<DokkaTaskPartial>().configureEach {
dokkaSourceSets.configureEach {
documentedVisibilities.set(
setOf(
Visibility.PUBLIC,
Visibility.PROTECTED
)
)
reportUndocumented.set(false)
jdkVersion.set(8)
perPackageOption {
matchingRegex.set("dev\\.nemecec\\.kotlinlogging\\.compiletimeplugin\\.internal\\..*")
suppress.set(true)
}
sourceLink {
localDirectory.set(rootProject.projectDir)
remoteUrl.set(URI("https://github.com/nemecec/kotlin-logging-compile-time-plugin/tree/main/").toURL())
remoteLineSuffix.set("#L")
}
}
}
// Don't attempt to sign anything if we don't have an in-memory key. Otherwise, the 'build' task
// triggers 'signJsPublication' even when we aren't publishing (and so don't have signing keys).
tasks.withType<Sign>().configureEach {
enabled = project.findProperty("signingInMemoryKey") != null
}
val javaVersion = JavaVersion.VERSION_1_8
tasks.withType(JavaCompile::class.java).configureEach {
sourceCompatibility = javaVersion.toString()
targetCompatibility = javaVersion.toString()
}
tasks.withType(KotlinJvmCompile::class.java).configureEach {
compilerOptions {
jvmTarget.set(JvmTarget.fromTarget(javaVersion.toString()))
}
}
plugins.withId("com.vanniktech.maven.publish.base") {
configure<PublishingExtension> {
repositories {
maven {
name = "testMaven"
url = rootProject.layout.buildDirectory.dir("testMaven").get().asFile.toURI()
}
}
}
configure<MavenPublishBaseExtension> {
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, automaticRelease = true)
signAllPublications()
coordinates(group.toString(), name, version.toString())
pom {
description.set("Kotlin compile-time plugin for kotlin-logging library")
name.set(project.name)
url.set("https://github.com/nemecec/kotlin-logging-compile-time-plugin")
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("nemecec")
name.set("Neeme Praks")
url.set("https://github.com/nemecec/")
}
}
scm {
url.set("https://github.com/nemecec/kotlin-logging-compile-time-plugin")
connection.set("scm:git:https://github.com/nemecec/kotlin-logging-compile-time-plugin.git")
developerConnection.set("scm:git:ssh://[email protected]/nemecec/kotlin-logging-compile-time-plugin.git")
}
}
}
}
}
tasks {
wrapper {
distributionType = Wrapper.DistributionType.ALL
}
}