-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
112 lines (100 loc) · 4.01 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
require(hasProperty("project-group"))
require(hasProperty("project-version"))
require(hasProperty("project-name"))
require(hasProperty("jvm-target"))
group = gradleProperty("project-group")
version = gradleProperty("project-version")
val projectName = gradleProperty("project-name")
val jvmTarget = gradleProperty("jvm-target")
plugins {
kotlin("jvm") version "1.3.61"
id("org.jlleitschuh.gradle.ktlint") version "9.2.1"
`maven-publish`
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
subprojects {
// Gradle plugin that automatically creates check and format tasks for project Kotlin sources, supports different kotlin plugins and Gradle build caching.
apply(plugin = "org.jlleitschuh.gradle.ktlint")
ktlint {
debug.set(true)
}
}
repositories {
mavenCentral()
jcenter()
maven("https://plugins.gradle.org/m2/")
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation(kotlin("reflect"))
api("io.github.microutils:kotlin-logging:${gradleProperty("kotlin-logging-version")}")
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:${gradleProperty("coroutines-version")}")
api("org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:${gradleProperty("coroutines-version")}")
api("org.koin:koin-core:${gradleProperty("koin-version")}")
api("com.squareup.retrofit2:retrofit:${gradleProperty("retrofit-version")}")
api("com.fasterxml.jackson.core:jackson-databind:${gradleProperty("jackson-version")}")
implementation("com.squareup.okhttp3:okhttp:${gradleProperty("okhttp-version")}")
implementation("com.fasterxml.jackson.core:jackson-core:${gradleProperty("jackson-version")}")
implementation("com.fasterxml.jackson.core:jackson-annotations:${gradleProperty("jackson-version")}")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:${gradleProperty("jackson-version")}")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:${gradleProperty("jackson-version")}")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${gradleProperty("jackson-version")}")
implementation("com.squareup.retrofit2:converter-jackson:${gradleProperty("retrofit-version")}")
implementation("org.slf4j:slf4j-simple:${gradleProperty("sl4j-simple-version")}")
implementation("com.github.ben-manes.caffeine:caffeine:${gradleProperty("caffeine-version")}")
testImplementation("org.junit.jupiter:junit-jupiter:${gradleProperty("junit-jupiter-version")}")
}
tasks {
compileKotlin {
kotlinOptions.jvmTarget = gradleProperty("jvm-target")
kotlinOptions.freeCompilerArgs = listOf("-Xjsr305=strict")
incremental = true
}
compileTestKotlin {
kotlinOptions.jvmTarget = gradleProperty("jvm-target")
kotlinOptions.freeCompilerArgs = listOf("-Xjsr305=strict")
incremental = true
}
compileJava {
options.isIncremental = true
options.isFork = true
sourceCompatibility = gradleProperty("jvm-target")
targetCompatibility = gradleProperty("jvm-target")
}
test {
useJUnitPlatform()
testLogging {
showStandardStreams = true; // Also show regular printed stuff
events("passed", "skipped", "failed")
}
}
}
publishing {
repositories {
maven {
/** We publish here */
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/jofairden/discord.kt")
/** Coming from Github */
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
publications {
create<MavenPublication>("discord.kt") {
from(components["java"])
}
}
/** See gradle.properties for group and version */
}
/**
* Get a property from the gradle.properties
*/
fun gradleProperty(key: String): String {
return gradle.rootProject.extra[key]?.toString() ?: return "NULL"
}