-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle.kts
74 lines (64 loc) · 2.48 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
plugins {
id("org.jetbrains.kotlin.jvm") version "1.5.30"
id("org.jmailen.kotlinter") version "3.3.0"
//TODO: https://github.com/mike-neck/graalvm-native-image-plugin
//id("org.mikeneck.graalvm-native-image") version "1.3.0"
application
maven
}
configurations.all {
resolutionStrategy.cacheDynamicVersionsFor(0, "seconds")
resolutionStrategy.cacheChangingModulesFor(0, "seconds")
}
repositories {
jcenter()
mavenCentral()
maven("https://oss.sonatype.org/content/repositories/snapshots")
}
dependencies {
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
implementation(platform("com.squareup.okhttp3:okhttp-bom:4.9.1"))
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("com.google.code.gson:gson:2.8.6")
implementation("com.squareup.okhttp3:okhttp")
implementation("com.squareup.okhttp3:logging-interceptor")
implementation("io.github.clightning4j:jrpclightning:0.2.5-SNAPSHOT")
implementation("io.github.clightning4j:lite-bitcoin-rpc:0.0.1-rc2-SNAPSHOT")
//Developing library
/*api(fileTree("${project.projectDir}/devlibs") {
include("jrpclightning-0.1.9-SNAPSHOT-with-dependencies.jar")
}) */
testImplementation("org.jetbrains.kotlin:kotlin-test")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
}
application {
mainClass.set("io.vincenzopalazzo.btcli4j.AppKt")
}
tasks {
register("fatJar", Jar::class.java) {
archiveClassifier.set("all")
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
attributes("Main-Class" to application.mainClass)
}
from(
configurations.runtimeClasspath.get()
.onEach { println("add from dependencies: ${it.name}") }
.map { if (it.isDirectory) it else zipTree(it) }
)
val sourcesMain = sourceSets.main.get()
sourcesMain.allSource.forEach { println("add from sources: ${it.name}") }
from(sourcesMain.output)
}
register("createRunnableScript") {
dependsOn("fatJar")
file("$projectDir/${project.name}-gen.sh").createNewFile()
file("$projectDir/${project.name}-gen.sh").writeText(
"""
#!/bin/bash
# Script generated from gradle! By clightning4j
${System.getProperties().getProperty("java.home")}/bin/java -jar ${project.buildDir.absolutePath}/libs/${project.name}-all.jar
""".trimIndent()
)
}
}