-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
116 lines (100 loc) 路 3.01 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
116 lines (100 loc) 路 3.01 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
111
112
113
114
115
116
import java.net.URI
plugins {
alias(libs.plugins.kgp)
alias(libs.plugins.spotless)
id("java-gradle-plugin")
id("maven-publish")
id("signing")
}
val pluginDescription = "Plugin that helps you publish to the Central Portal (https://central.sonatype.org/)"
gradlePlugin {
plugins {
create("nmcp") {
id = "com.gradleup.nmcp"
implementationClass = "nmcp.NmcpPlugin"
this.description = pluginDescription
this.displayName = "nmcp"
}
}
}
group = "com.gradleup.nmcp"
version = "0.0.8"
publishing {
repositories {
repositories {
maven {
name = "OssStaging"
url = URI("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = System.getenv("OSSRH_USER")
password = System.getenv("OSSRH_PASSWORD")
}
}
}
}
publications.configureEach {
this as MavenPublication
if (name == "pluginMaven") {
artifact(
tasks.register("emptySources", Jar::class.java) {
archiveClassifier = "sources"
},
)
artifact(
tasks.register("emptyDocs", Jar::class.java) {
archiveClassifier = "javadoc"
},
)
groupId = project.rootProject.group.toString()
version = project.rootProject.version.toString()
artifactId = project.name
}
pom {
name.set(project.name)
description.set(pluginDescription)
url.set("https://github.com/gradleup/nmcp")
scm {
url.set("https://github.com/gradleup/nmcp")
connection.set("https://github.com/gradleup/nmcp")
developerConnection.set("https://github.com/gradleup/nmcp")
}
licenses {
license {
name.set("MIT License")
url.set("https://github.com/gradleup/nmcp/blob/master/LICENSE")
}
}
developers {
developer {
id.set("GradleUp developers")
name.set("GradleUp developers")
}
}
}
}
}
signing {
sign(publishing.publications)
useInMemoryPgpKeys(System.getenv("GPG_KEY"), System.getenv("GPG_KEY_PASSWORD"))
}
spotless {
kotlin {
ktlint(libs.ktlint.get().version)
}
kotlinGradle {
ktlint(libs.ktlint.get().version)
}
}
dependencies {
implementation(libs.json)
implementation(libs.okio)
implementation(libs.okhttp)
implementation(libs.okhttp.logging.interceptor)
}
tasks.withType<AbstractPublishToMaven>().configureEach {
val signingTasks = tasks.withType<Sign>()
mustRunAfter(signingTasks)
}
tasks.withType(Sign::class.java).configureEach {
isEnabled = System.getenv("GPG_KEY").isNullOrBlank().not()
}