Build a jvm application (#7)
Application is build and packaged with the `application plugin`, which will create a .zip file that includes all runtime dependencies and a starter script. --------- Co-authored-by: pm47 <pm.padiou@gmail.com>
This commit is contained in:
parent
f3251e78e5
commit
613610eb14
13
README.md
13
README.md
@ -10,18 +10,25 @@ It is written in [Kotlin Multiplatform](https://kotlinlang.org/docs/multiplatfor
|
||||
|
||||
## Build
|
||||
|
||||
### Linux/WSL
|
||||
### Native Linux/WSL
|
||||
|
||||
Requires `libsqlite-dev` and `libcurl4-gnutls-dev`, both compiled against `glibc 2.19`.
|
||||
|
||||
```shell
|
||||
./gradlew packageLinuxX64
|
||||
```
|
||||
|
||||
### MacOS x64
|
||||
### Native MacOS x64
|
||||
```shell
|
||||
./gradlew packageMacOSX64
|
||||
```
|
||||
|
||||
### MacOS arm64
|
||||
### Native MacOS arm64
|
||||
```shell
|
||||
./gradlew packageMacOSArm64
|
||||
```
|
||||
|
||||
### JVM
|
||||
```shell
|
||||
./gradlew distZip
|
||||
```
|
@ -1,5 +1,6 @@
|
||||
import Versions.ktor
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTargetWithHostTests
|
||||
import org.jetbrains.kotlin.ir.util.dumpKotlinLike
|
||||
import java.io.ByteArrayOutputStream
|
||||
|
||||
buildscript {
|
||||
@ -16,6 +17,7 @@ plugins {
|
||||
kotlin("multiplatform") version Versions.kotlin
|
||||
kotlin("plugin.serialization") version Versions.kotlin
|
||||
id("app.cash.sqldelight") version Versions.sqlDelight
|
||||
application
|
||||
}
|
||||
|
||||
allprojects {
|
||||
@ -69,7 +71,9 @@ val buildVersionsTask by tasks.registering(Sync::class) {
|
||||
}
|
||||
|
||||
kotlin {
|
||||
jvm()
|
||||
jvm {
|
||||
withJava()
|
||||
}
|
||||
|
||||
fun KotlinNativeTargetWithHostTests.phoenixBinaries() {
|
||||
binaries {
|
||||
@ -129,6 +133,7 @@ kotlin {
|
||||
dependencies {
|
||||
implementation("app.cash.sqldelight:sqlite-driver:${Versions.sqlDelight}")
|
||||
implementation(ktor("client-okhttp"))
|
||||
implementation("ch.qos.logback:logback-classic:1.2.3")
|
||||
}
|
||||
}
|
||||
nativeMain {
|
||||
@ -188,6 +193,17 @@ kotlin {
|
||||
}
|
||||
}
|
||||
|
||||
application {
|
||||
mainClass = "fr.acinq.lightning.bin.MainKt"
|
||||
}
|
||||
|
||||
distributions {
|
||||
main {
|
||||
distributionBaseName = "phoenix"
|
||||
distributionClassifier = "jvm"
|
||||
}
|
||||
}
|
||||
|
||||
// forward std input when app is run via gradle (otherwise keyboard input will return EOF)
|
||||
tasks.withType<JavaExec> {
|
||||
standardInput = System.`in`
|
||||
|
4
src/jvmMain/resources/logback.xml
Normal file
4
src/jvmMain/resources/logback.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<root level="OFF" />
|
||||
</configuration>
|
Loading…
x
Reference in New Issue
Block a user