|
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 | id("com.android.library") |
6 | 9 | id("org.jetbrains.kotlin.android") version "1.6.10" |
| 10 | + |
| 11 | + id("maven-publish") |
| 12 | + id("signing") |
7 | 13 | } |
8 | 14 |
|
9 | 15 | repositories { |
@@ -49,3 +55,79 @@ dependencies { |
49 | 55 | androidTestImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.1") |
50 | 56 | androidTestImplementation("org.jetbrains.kotlin:kotlin-test-junit") |
51 | 57 | } |
| 58 | + |
| 59 | +afterEvaluate { |
| 60 | + publishing { |
| 61 | + publications { |
| 62 | + create<MavenPublication>("maven") { |
| 63 | + groupId = "org.lightningdevkit" |
| 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 | + "LDK Node, a ready-to-go node implementation built using LDK." |
| 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/lightningdevkit/ldk-node.git") |
| 98 | + developerConnection.set("scm:git:ssh://github.com/lightningdevkit/ldk-node.git") |
| 99 | + url.set("https://github.com/lightningdevkit/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 | + |
| 115 | +//tasks.named<Test>("test") { |
| 116 | +// // Use JUnit Platform for unit tests. |
| 117 | +// useJUnitPlatform() |
| 118 | +// |
| 119 | +// testLogging { |
| 120 | +// events(PASSED, SKIPPED, FAILED, STANDARD_OUT, STANDARD_ERROR) |
| 121 | +// exceptionFormat = FULL |
| 122 | +// showExceptions = true |
| 123 | +// showCauses = true |
| 124 | +// showStackTraces = true |
| 125 | +// showStandardStreams = true |
| 126 | +// } |
| 127 | +//} |
| 128 | + |
| 129 | +//// This task dependency ensures that we build the bindings |
| 130 | +//// binaries before running the tests |
| 131 | +//tasks.withType<KotlinCompile> { |
| 132 | +// dependsOn("buildAndroidLib") |
| 133 | +//} |
0 commit comments