Skip to content

Commit 120b444

Browse files
author
Jurvis Tan
committed
Maven Publish for ldk-node-jvm
1 parent fd7f190 commit 120b444

3 files changed

Lines changed: 101 additions & 1 deletion

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
buildscript {
2+
repositories {
3+
google()
4+
}
5+
dependencies {
6+
classpath("com.android.tools.build:gradle:7.1.2")
7+
}
8+
}
9+
10+
plugins {
11+
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
12+
}
13+
14+
// library version is defined in gradle.properties
15+
val libraryVersion: String by project
16+
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"
22+
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+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
org.gradle.jvmargs=-Xmx1536m
2+
kotlin.code.style=official
3+
libraryVersion=0.0.1-SNAPSHOT

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

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
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
// Apply the org.jetbrains.kotlin.jvm Plugin to add support for Kotlin.
69
id("org.jetbrains.kotlin.jvm") version "1.7.10"
710

811
// Apply the java-library plugin for API and implementation separation.
9-
`java-library`
12+
id("java-library")
13+
id("maven-publish")
14+
id("signing")
1015
}
1116

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

0 commit comments

Comments
 (0)