-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
89 lines (73 loc) · 3.03 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
val ktor_version: String by project
val kotlin_version: String by project
val logback_version: String by project
plugins {
kotlin("jvm") version "1.9.0"
id("org.jetbrains.kotlin.plugin.serialization") version "1.9.0"
application
`maven-publish`
}
group = "id.walt"
version = "0.1.1"
application {
mainClass.set("io.ktor.server.cio.EngineMain")
val isDevelopment: Boolean = project.ext.has("development")
applicationDefaultJvmArgs = listOf("-Dio.ktor.development=$isDevelopment")
}
repositories {
mavenCentral()
}
dependencies {
// Ethereum
implementation("org.web3j:core:4.10.2") // 5.0.0 is not a current version, it was wrongly released
implementation("org.web3j:crypto:4.10.2") // https://github.com/web3j/web3j/issues/1849
// Ktor
implementation("io.ktor:ktor-server-core-jvm:$ktor_version")
implementation("io.ktor:ktor-server-sessions-jvm:$ktor_version")
implementation("io.ktor:ktor-server-content-negotiation-jvm:$ktor_version")
implementation("io.ktor:ktor-serialization-kotlinx-json-jvm:$ktor_version")
implementation("io.ktor:ktor-server-call-logging-jvm:$ktor_version")
implementation("io.ktor:ktor-server-call-id-jvm:$ktor_version")
implementation("io.ktor:ktor-server-cors-jvm:$ktor_version")
implementation("io.ktor:ktor-server-double-receive-jvm:$ktor_version")
implementation("io.ktor:ktor-server-cio-jvm:$ktor_version")
implementation("io.ktor:ktor-server-auto-head-response:$ktor_version")
// Logging
implementation("ch.qos.logback:logback-classic:$logback_version")
// Testing
testImplementation("org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version")
testImplementation("io.kotest:kotest-runner-junit5:5.5.5")
testImplementation("io.kotest:kotest-assertions-core:5.5.5 ")
}
tasks.withType<Test>().configureEach {
useJUnitPlatform()
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
pom {
name.set("SIWE by walt.id")
description.set("Kotlin/Java library for SIWE - EIP-4361 Sign In With Ethereum.")
url.set("https://walt.id")
}
from(components["java"])
}
}
repositories {
maven {
url = uri("https://maven.walt.id/repository/waltid/")
val usernameFile = File("secret_maven_username.txt")
val passwordFile = File("secret_maven_password.txt")
val secretMavenUsername = System.getenv()["MAVEN_USERNAME"] ?: if (usernameFile.isFile) { usernameFile.readLines()[0] } else { "" }
println("Deploy username length: ${secretMavenUsername.length}")
val secretMavenPassword = System.getenv()["MAVEN_PASSWORD"] ?: if (passwordFile.isFile) { passwordFile.readLines()[0] } else { "" }
if (secretMavenPassword.isBlank()) {
println("WARNING: Password is blank!")
}
credentials {
username = secretMavenUsername
password = secretMavenPassword
}
}
}
}