-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
57 lines (48 loc) · 1.39 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
//import org.jlleitschuh.gradle.ktlint.reporter.ReporterType
plugins {
java
kotlin("jvm")
id("io.hkhc.jarbird")
}
repositories {
mavenCentral()
jcenter()
google()
}
/*
It is needed to make sure every version of java compiler to generate same kind of bytecode.
Without it and build this with java 8+ compiler, then the project build with java 8
will get error like this:
> Unable to find a matching variant of <your-artifact>:
- Variant 'apiElements' capability <your-artifact>:
- Incompatible attributes:
- Required org.gradle.jvm.version '8' and found incompatible value '13'.
- Required org.gradle.usage 'java-runtime' and found incompatible value 'java-api'.
...
*/
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
tasks {
/*
Without this Kotlin generates java 6 bytecode, which is hardly fatal.
*/
withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
// dokka {
// outputFormat = "html"
// outputDirectory = "$buildDir/dokka"
// }
}
jarbird {
mavenCentral()
}
dependencies {
implementation(Kotlin.stdlib.jdk8)
implementation("io.hkhc.log:ihlog:_")
testImplementation(Testing.junit4)
testImplementation("org.assertj:assertj-core:_")
}