-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
112 lines (92 loc) · 3.19 KB
/
build.gradle.kts
File metadata and controls
112 lines (92 loc) · 3.19 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
plugins {
kotlin("jvm") version "2.1.10"
`maven-publish`
signing
id("io.github.gradle-nexus.publish-plugin") version "2.0.0" // nexus publish/close/release
}
group = "io.github.openprojectx.tools"
version = "0.1.0"
repositories {
mavenCentral()
}
dependencies {
testImplementation(kotlin("test"))
}
tasks.test {
useJUnitPlatform()
}
kotlin {
jvmToolchain(17)
}
java {
withSourcesJar()
withJavadocJar()
}
publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
pom {
name.set("security")
description.set("Awesome library that does X")
url.set("https://github.com/openprojectx/utils")
licenses {
license {
name.set("Apache License, Version 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0")
}
}
developers {
developer {
id.set("openprojectx")
name.set("OpenProjectX")
email.set("admin@openprojectx.org")
}
}
scm {
url.set("https://github.com/openprojectx/utils")
connection.set("scm:git:https://github.com/openprojectx/utils.git")
developerConnection.set("scm:git:ssh://git@github.com/openprojectx/utils.git")
}
}
}
}
// repositories {
// maven {
// name = "OSSRH"
// val releasesUrl = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
// val snapshotsUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
// url = if (version.toString().endsWith("SNAPSHOT")) snapshotsUrl else releasesUrl
// credentials {
// username = System.getenv("OSSRH_USERNAME")
// logger.info("using username: $username")
// password = System.getenv("OSSRH_PASSWORD")
// logger.info("using password: $password")
//
// }
// }
// }
}
signing {
val keyText = file(System.getenv("SIGNING_KEY_FILE")).readText()
val keyPass = System.getenv("SIGNING_KEY_PASSWORD")
useInMemoryPgpKeys(keyText, keyPass)
sign(publishing.publications["maven"])
}
nexusPublishing {
// repositories {
// sonatype()
// }
repositories {
sonatype {
// nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
// snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
username.set(System.getenv("OSSRH_USERNAME"))
logger.info("using username: ${System.getenv("OSSRH_USERNAME")}")
password.set(System.getenv("OSSRH_PASSWORD"))
logger.info("using password: ${System.getenv("OSSRH_PASSWORD")}")
}
}
}