-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
139 lines (129 loc) · 5.2 KB
/
build.gradle.kts
File metadata and controls
139 lines (129 loc) · 5.2 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
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.SonatypeHost
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.time.Year
plugins {
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.kotlin.plugin.spring) apply false
alias(libs.plugins.gradle.mavenCentral.publish) apply false
alias(libs.plugins.kotlinx.kover)
java
signing
`maven-publish`
}
group = extra["project.group"] as String
version = extra["project.version.id"] as String
val publicModulePathSet = setOf(
rootProject.projects.documentifyProject.documentifyCore.identityPath.path,
rootProject.projects.documentifyProject.documentifyGradlePlugin.identityPath.path,
rootProject.projects.documentifyProject.documentifyMvc.identityPath.path,
rootProject.projects.documentifyProject.documentifyReactive.identityPath.path,
rootProject.projects.documentifyStarters.documentifyStarterMvc.identityPath.path,
rootProject.projects.documentifyStarters.documentifyStarterReactive.identityPath.path
)
repositories {
mavenCentral()
}
subprojects {
group = rootProject.group
version = rootProject.version
with(pluginManager) {
apply(rootProject.libs.plugins.kotlin.jvm.get().pluginId)
apply(rootProject.libs.plugins.kotlin.plugin.spring.get().pluginId)
}
repositories {
mavenCentral()
}
tasks {
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
withType<KotlinCompile> {
compilerOptions {
freeCompilerArgs.add("-Xjsr305=strict")
jvmTarget.set(JvmTarget.JVM_21)
}
}
test {
useJUnitPlatform()
}
}
if (publicModulePathSet.contains(project.path)) {
with(pluginManager) {
apply(rootProject.libs.plugins.gradle.mavenCentral.publish.get().pluginId)
apply(plugin = "signing")
apply(plugin = "maven-publish")
}
configure<SigningExtension> {
val gpgSecret = project.findProperty("gpg.secret").toString()
val gpgPassphrase = project.findProperty("gpg.passphrase").toString()
useInMemoryPgpKeys(gpgSecret, gpgPassphrase)
sign(publishing.publications)
}
configure<MavenPublishBaseExtension> {
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, true)
val projectGroup = property("project.group").toString()
val projectArtifactId = name.replace("-gradle-plugin", ".gradle.plugin")
val projectName = property("project.name").toString()
val projectVersion = property("project.version.id").toString()
val projectDescription = property("project.description").toString()
val projectUrl = property("project.url").toString()
val projectUrlScm = property("project.url.scm").toString()
val projectLicense = property("project.license").toString()
val projectLicenseUrl = property("project.license.url").toString()
val projectDeveloperId = property("project.developer.id").toString()
val projectDeveloperName = property("project.developer.name").toString()
val projectDeveloperEmail = property("project.developer.email").toString()
val projectDeveloperUrl = property("project.developer.url").toString()
coordinates(
groupId = projectGroup,
artifactId = projectArtifactId,
version = projectVersion
)
pom {
name = projectName
description = projectDescription
inceptionYear = "${Year.now().value}"
url = projectUrl
licenses {
license {
name = projectLicense
url = projectLicenseUrl
distribution = projectUrl
}
}
developers {
developer {
id = projectDeveloperId
name = projectDeveloperName
email = projectDeveloperEmail
url = projectDeveloperUrl
}
}
scm {
url = projectUrlScm
connection = "scm:git:git://github.com/${projectDeveloperId}"
developerConnection = "scm:git:ssh://git@github.com/${projectDeveloperId}"
}
}
}
}
}
kover {
merge {
projects(
rootProject.projects.documentifyProject.documentifyCore.identityPath.path,
rootProject.projects.documentifyProject.documentifyMvc.identityPath.path,
rootProject.projects.documentifyProject.documentifyReactive.identityPath.path,
rootProject.projects.documentifySample.mvcSample.identityPath.path,
rootProject.projects.documentifySample.reactiveSample.identityPath.path
)
}
reports {
filters {
excludes.classes.add("**.sample.**")
}
}
}