-
Notifications
You must be signed in to change notification settings - Fork 13
/
build.gradle.kts
97 lines (83 loc) · 2.93 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
import pl.touk.krush.gradle.signPublicationIfKeyPresent
plugins {
kotlin("jvm") apply true
kotlin("kapt") apply true
kotlin("plugin.serialization") version "1.8.10"
id("pl.allegro.tech.build.axion-release") version "1.15.0"
`maven-publish`
}
scmVersion {
useHighestVersion.set(true)
tag {
prefix.set("krush-")
}
}
group = "pl.touk.krush"
project.version = scmVersion.version
val rootVersion = scmVersion.version
allprojects {
repositories {
mavenCentral()
}
}
val snapshot = scmVersion.version.endsWith("SNAPSHOT")
configure(listOf(project(":annotation-processor"), project(":runtime"), project(":runtime-postgresql"))) {
apply(plugin = "java")
apply(plugin = "maven-publish")
apply(plugin = "signing")
tasks.withType(Sign::class.java) {
onlyIf { snapshot.not() }
}
java {
withSourcesJar()
withJavadocJar()
}
publishing {
publications {
create<MavenPublication>("maven") {
groupId = "pl.touk.krush"
artifactId = "krush-${project.name}"
version = rootVersion
from(components["java"])
pom {
name.set("krush-${project.name}")
description.set("Krush, idiomatic persistence layer for Kotlin")
url.set("https://github.com/TouK/krush")
scm {
url.set("scm:[email protected]:TouK/krush.git")
connection.set("scm:[email protected]:TouK/krush.git")
developerConnection.set("scm:[email protected]:TouK/krush.git")
}
licenses {
license {
name.set("The Apache Software License, Version 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("mateusz_sledz")
name.set("Mateusz Śledź")
}
developer {
id.set("piotr_jagielski")
name.set("Piotr Jagielski")
}
}
}
signPublicationIfKeyPresent(project)
}
}
repositories {
maven {
credentials {
username = System.getenv("SONATYPE_USERNAME")
password = System.getenv("SONATYPE_PASSWORD")
}
val releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
val snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
url = uri(if (snapshot) snapshotsRepoUrl else releasesRepoUrl)
}
}
}
}