-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
68 lines (59 loc) · 1.67 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.konan.properties.Properties
plugins {
kotlin("jvm") version "1.6.21"
`maven-publish`
}
group = "dev.virefire.yok"
version = "1.0.4"
repositories {
mavenCentral()
maven {
url = uri("https://maven.rikonardo.com/releases")
}
}
dependencies {
implementation("dev.virefire.kson:KSON:1.3.1")
implementation("org.apache.httpcomponents:httpmime:4.5.13")
implementation("io.ktor:ktor-client-cio:2.0.1")
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(8))
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
tasks.register("createProperties") {
doLast {
val f = File("$buildDir/resources/main/dev/virefire/yok/version.properties")
File(f.parent).mkdirs()
val p = Properties()
p["version"] = project.version.toString()
p.store(f.outputStream(), null)
}
}
tasks.getByName("jar") {
dependsOn("createProperties")
}
publishing {
publications {
register("mavenJava", MavenPublication::class) {
from(components["java"])
pom {
name.set("Yok")
description.set("Kotlin HTTP request library")
}
}
}
repositories {
maven {
val properties = Properties()
properties.load(rootProject.file("publish.properties").inputStream())
url = uri(properties["deployRepoUrl"].toString())
credentials {
username = properties["deployRepoUsername"].toString()
password = properties["deployRepoPassword"].toString()
}
}
}
}