|
1 | 1 | import org.gradle.api.tasks.testing.logging.TestExceptionFormat.* |
2 | 2 | import org.gradle.api.tasks.testing.logging.TestLogEvent.* |
3 | 3 |
|
| 4 | +// library version is defined in gradle.properties |
| 5 | +val libraryVersion: String by project |
| 6 | + |
4 | 7 | plugins { |
5 | 8 | // Apply the org.jetbrains.kotlin.jvm Plugin to add support for Kotlin. |
6 | 9 | id("org.jetbrains.kotlin.jvm") version "1.7.10" |
7 | 10 |
|
8 | 11 | // Apply the java-library plugin for API and implementation separation. |
9 | | - `java-library` |
| 12 | + id("java-library") |
| 13 | + id("maven-publish") |
| 14 | + id("signing") |
10 | 15 | } |
11 | 16 |
|
12 | 17 | repositories { |
@@ -48,3 +53,59 @@ tasks.named<Test>("test") { |
48 | 53 | showStandardStreams = true |
49 | 54 | } |
50 | 55 | } |
| 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