-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
69 lines (66 loc) · 2.44 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
plugins {
`maven-publish`
signing
}
group = "org.rationalityfrontline.workaround"
version = "1.54.0"
val NAME = project.name
val DESC = "Merged grpc-api and grpc-context into a single jar"
val GITHUB_REPO = "RationalityFrontline/grpc-api"
publishing {
publications {
create<MavenPublication>("maven") {
artifact(file("libs/grpc-api-$version-sources.jar")) {
classifier = "sources"
}
artifact(file("libs/grpc-api-$version-javadoc.jar")) {
classifier = "javadoc"
}
artifact(file("libs/grpc-api-$version.jar"))
pom {
name.set(NAME)
description.set(DESC)
packaging = "jar"
url.set("https://github.com/$GITHUB_REPO")
licenses {
license {
name.set("The Apache Software License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
name.set("RationalityFrontline")
email.set("[email protected]")
organization.set("RationalityFrontline")
organizationUrl.set("https://github.com/RationalityFrontline")
}
}
scm {
connection.set("scm:git:git://github.com/$GITHUB_REPO.git")
developerConnection.set("scm:git:ssh://github.com:$GITHUB_REPO.git")
url.set("https://github.com/$GITHUB_REPO/tree/master")
}
}
}
}
repositories {
fun env(propertyName: String): String {
return if (project.hasProperty(propertyName)) {
project.property(propertyName) as String
} else "Unknown"
}
maven {
val releasesRepoUrl = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
val snapshotsRepoUrl = uri("https://oss.sonatype.org/content/repositories/snapshots/")
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
credentials {
username = env("ossrhUsername")
password = env("ossrhPassword")
}
}
}
}
signing {
sign(publishing.publications["maven"])
}