forked from infiniticio/infinitic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish.gradle.kts
109 lines (92 loc) · 3.26 KB
/
publish.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
/**
* "Commons Clause" License Condition v1.0
*
* The Software is provided to you by the Licensor under the License, as defined below, subject to
* the following condition.
*
* Without limiting other conditions in the License, the grant of rights under the License will not
* include, and the License does not grant to you, the right to Sell the Software.
*
* For purposes of the foregoing, “Sell” means practicing any or all of the rights granted to you
* under the License to provide to third parties, for a fee or other consideration (including
* without limitation fees for hosting or consulting/ support services related to the Software), a
* product or service whose value derives, entirely or substantially, from the functionality of the
* Software. Any license notice or attribution required by the License must also include this
* Commons Clause License Condition notice.
*
* Software: Infinitic
*
* License: MIT License (https://opensource.org/licenses/MIT)
*
* Licensor: infinitic.io
*/
apply(plugin = "java")
apply(plugin = "java-library")
apply(plugin = "maven-publish")
apply(plugin = "signing")
buildscript {
repositories {
mavenCentral()
maven(url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
maven(url = uri("https://plugins.gradle.org/m2/"))
}
}
repositories { mavenCentral() }
fun Project.publishing(action: PublishingExtension.() -> Unit) = configure(action)
fun Project.signing(configure: SigningExtension.() -> Unit): Unit = configure(configure)
fun Project.java(configure: JavaPluginExtension.() -> Unit): Unit = configure(configure)
val publications: PublicationContainer =
(extensions.getByName("publishing") as PublishingExtension).publications
signing {
if (Ci.isRelease) {
sign(publications)
}
}
java {
withJavadocJar()
withSourcesJar()
}
val ossSonatypeOrgUsername: String? by project
val ossSonatypeOrgPassword: String? by project
publishing {
repositories {
val releasesRepoUrl = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
val snapshotsRepoUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
maven {
name = "deploy"
url = if (Ci.isRelease) releasesRepoUrl else snapshotsRepoUrl
credentials {
username = System.getenv("OSSRH_USERNAME") ?: ossSonatypeOrgUsername
password = System.getenv("OSSRH_PASSWORD") ?: ossSonatypeOrgPassword
}
}
}
publications {
register("mavenJava", MavenPublication::class) {
from(components["java"])
pom {
name.set("Infinitic")
description.set("Infinitic Orchestration Framework")
url.set("https://infinitic.io")
scm {
connection.set("scm:git:https://github.com/infiniticio/infinitic/")
developerConnection.set("scm:git:https://github.com/infiniticio/infinitic/")
url.set("https://github.com/infiniticio/infinitic/")
}
licenses {
license {
name.set("Commons Clause (MIT License)")
url.set("https://commonsclause.com")
}
}
developers {
developer {
id.set("geomagilles")
name.set("Gilles Barbier")
email.set("[email protected]")
}
}
}
}
}
}