Skip to content

Commit 9292908

Browse files
author
Jurvis Tan
committed
Maven publishing
1 parent a491ede commit 9292908

2 files changed

Lines changed: 81 additions & 0 deletions

File tree

bindings/kotlin/ldk-node-android/build.gradle.kts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,23 @@ plugins {
1414
// library version is defined in gradle.properties
1515
val libraryVersion: String by project
1616

17+
// These properties are required here so that the nexus publish-plugin
18+
// finds a staging profile with the correct group (group is otherwise set as "")
19+
// and knows whether to publish to a SNAPSHOT repository or not
20+
// https://github.com/gradle-nexus/publish-plugin#applying-the-plugin
21+
group = "org.lightningdevkit"
1722
version = libraryVersion
23+
24+
nexusPublishing {
25+
repositories {
26+
create("sonatype") {
27+
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
28+
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
29+
30+
val ossrhUsername: String? by project
31+
val ossrhPassword: String? by project
32+
username.set(ossrhUsername)
33+
password.set(ossrhPassword)
34+
}
35+
}
36+
}

bindings/kotlin/ldk-node-android/lib/build.gradle.kts

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
import org.gradle.api.tasks.testing.logging.TestExceptionFormat.*
22
import org.gradle.api.tasks.testing.logging.TestLogEvent.*
33

4+
// library version is defined in gradle.properties
5+
val libraryVersion: String by project
6+
47
plugins {
58
id("com.android.library")
69
id("org.jetbrains.kotlin.android") version "1.6.10"
10+
11+
id("maven-publish")
12+
id("signing")
713
}
814

915
repositories {
@@ -50,6 +56,62 @@ dependencies {
5056
androidTestImplementation("org.jetbrains.kotlin:kotlin-test-junit")
5157
}
5258

59+
afterEvaluate {
60+
publishing {
61+
publications {
62+
create<MavenPublication>("maven") {
63+
groupId = "co.jurvis"
64+
artifactId = "ldk-node-android"
65+
version = libraryVersion
66+
67+
from(components["release"])
68+
pom {
69+
name.set("ldk-node-android")
70+
description.set(
71+
"Kotlin language bindings for LdkNode, a ready-to-go LDK node implementation"
72+
)
73+
url.set("https://lightningdevkit.org")
74+
licenses {
75+
license {
76+
name.set("APACHE 2.0")
77+
url.set("https://github.com/lightningdevkit/ldk-node/blob/main/LICENSE-APACHE")
78+
}
79+
license {
80+
name.set("MIT")
81+
url.set("https://github.com/lightningdevkit/ldk-node/blob/main/LICENSE-MIT")
82+
}
83+
}
84+
developers {
85+
developer {
86+
id.set("tnull")
87+
name.set("Elias Rohrer")
88+
email.set("tnull@noreply.github.org")
89+
}
90+
developer {
91+
id.set("jurvis")
92+
name.set("Jurvis Tan")
93+
email.set("jurvis@noreply.github.org")
94+
}
95+
}
96+
scm {
97+
connection.set("scm:git:github.com/jurvis/ldk-node.git")
98+
developerConnection.set("scm:git:ssh://github.com/jurvis/ldk-node.git")
99+
url.set("https://github.com/jurvis/ldk-node/tree/main")
100+
}
101+
}
102+
}
103+
}
104+
}
105+
}
106+
107+
signing {
108+
val signingKeyId: String? by project
109+
val signingKey: String? by project
110+
val signingPassword: String? by project
111+
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
112+
sign(publishing.publications)
113+
}
114+
53115
//tasks.named<Test>("test") {
54116
// // Use JUnit Platform for unit tests.
55117
// useJUnitPlatform()

0 commit comments

Comments
 (0)