-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
44 lines (36 loc) · 1.01 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
subprojects {
val groupId: String by project
val version: String by project
apply {
plugin("java-library")
plugin("maven-publish")
}
repositories {
mavenCentral()
}
val sourcesJar by tasks.registering(Jar::class) {
archiveClassifier.set("sources")
from(project.the<SourceSetContainer>()["main"].allSource)
}
artifacts {
add("archives", sourcesJar)
}
publishing {
repositories {
maven {
url = uri("$rootDir/maven-repo")
}
}
publications {
publications.create<MavenPublication>("maven") {
artifactId = project.name
setGroupId(groupId)
setVersion(version)
from(components["java"])
artifact(sourcesJar.get())
}
}
}
}
fun Project.publishing(configure: Action<PublishingExtension>): Unit =
(this as ExtensionAware).extensions.configure("publishing", configure)