-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
93 lines (79 loc) · 2.48 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
allprojects {
group = "it.neckar.open"
}
subprojects {
if (isIntermediate) {
return@subprojects
}
val projectsToSkip = setOf(
Projects.open_unit_unit,
Projects.web_fonts,
)
val project = this
if (true) {
//Relevant for publishing to Maven Central
apply(plugin = "maven-publish")
apply(plugin = "signing")
extensions.configure<PublishingExtension>("publishing") {
configureMavenReposForPublish(project)
if (projectsToSkip.contains(path)) {
//No configuration for unit necessary.
} else {
publications {
create<MavenPublication>("maven") {
val javaComponent = components.findByName("java")
if (javaComponent != null) {
from(javaComponent)
artifact(tasks["sourcesJar"])
artifact(tasks["javadocJar"])
} else {
from(components["kotlin"])
}
repositories {
}
pom {
name.set("${project.name}")
description.set("Path: ${project.path}")
url.set("http://cedarsoft.com")
licenses {
license {
name.set("GPLv3 with Classpath Exception")
url.set("https://www.cedarsoft.org/gpl3ce")
}
}
developers {
developer {
id.set("jschneider")
name.set("Johannes Schneider")
email.set("js@cedarsoft.com")
}
}
scm {
connection.set("scm:git:git@github.com:jschneider/com.cedarsoft.monorepo.git")
developerConnection.set("scm:git:git@github.com:jschneider/com.cedarsoft.monorepo.git")
url.set("https://github.com/jschneider/com.cedarsoft.monorepo")
}
versionMapping {
usage("java-api") {
fromResolutionResult()
}
usage("java-runtime") {
fromResolutionResult()
}
}
}
}
}
//Signing must be called after publication
extensions.configure<SigningExtension>("signing") {
useGpgCmd()
//Only sign if *not* snapshot
if (!isSnapshot) {
sign(extensions.getByName<PublishingExtension>("publishing").publications["maven"])
}
isRequired = !isSnapshot
}
}
}
}
}