|
| 1 | +val ktor_version: String by project |
| 2 | +val kotlin_version: String by project |
| 3 | +val logback_version: String by project |
| 4 | + |
| 5 | +plugins { |
| 6 | + kotlin("jvm") version "1.9.22" |
| 7 | + id("io.ktor.plugin") version "2.3.7" |
| 8 | +} |
| 9 | + |
| 10 | +group = "com.ably.java" |
| 11 | +version = "0.0.1" |
| 12 | + |
| 13 | +application { |
| 14 | + mainClass.set("com.ably.java.ApplicationKt") |
| 15 | +} |
| 16 | + |
| 17 | +tasks { |
| 18 | + val fatJar = register<Jar>("fatJar") { |
| 19 | + dependsOn.addAll(listOf("compileJava", "compileKotlin", "processResources")) // We need this for Gradle optimization to work |
| 20 | + archiveClassifier.set("standalone") // Naming the jar |
| 21 | + duplicatesStrategy = DuplicatesStrategy.EXCLUDE |
| 22 | + manifest { attributes(mapOf("Main-Class" to application.mainClass)) } // Provided we set it up in the application plugin configuration |
| 23 | + val sourcesMain = sourceSets.main.get() |
| 24 | + val contents = configurations.runtimeClasspath.get() |
| 25 | + .map { if (it.isDirectory) it else zipTree(it) } + |
| 26 | + sourcesMain.output |
| 27 | + from(contents) |
| 28 | + } |
| 29 | + build { |
| 30 | + dependsOn(fatJar) |
| 31 | + } |
| 32 | +} |
| 33 | + |
| 34 | +repositories { |
| 35 | + mavenCentral() |
| 36 | +} |
| 37 | + |
| 38 | +dependencies { |
| 39 | + implementation("io.ably:ably-java:1.2.38") |
| 40 | + implementation("com.benasher44:uuid:0.8.2") |
| 41 | + implementation("io.ktor:ktor-client-core") |
| 42 | + implementation("io.ktor:ktor-client-cio") |
| 43 | + implementation("io.ktor:ktor-client-logging") |
| 44 | + implementation("io.ktor:ktor-client-websockets") |
| 45 | + implementation("io.ktor:ktor-serialization-kotlinx-json") |
| 46 | + implementation("io.ktor:ktor-client-content-negotiation") |
| 47 | + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4") |
| 48 | + implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.5.1") |
| 49 | + implementation("com.google.code.gson:gson:2.9.0") |
| 50 | + implementation("ch.qos.logback:logback-classic:$logback_version") |
| 51 | +} |
0 commit comments