-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle.kts
94 lines (80 loc) · 2.47 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven { url = uri("https://plugins.gradle.org/m2/") }
}
}
plugins {
kotlin("jvm") version "1.6.10"
`maven-publish`
jacoco
id("org.jetbrains.dokka") version "1.6.10" apply false
}
// Conditionally enable dokka only when dokkaEnabled=true property is set.
// Latest version 1.6.10 depends on vulnerable versions of jackson/jsoup/etc.
val dokkaEnabled = (project.properties["dokkaEnabled"]?.toString()?.toBoolean()) ?: false
project.logger.lifecycle("dokkaEnabled = $dokkaEnabled")
if (dokkaEnabled) {
apply(plugin = "org.jetbrains.dokka")
}
group = "com.target"
java.sourceCompatibility = JavaVersion.VERSION_11
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation("io.github.microutils:kotlin-logging:2.1.21")
implementation("org.objenesis:objenesis:3.2")
implementation("io.micrometer:micrometer-core:1.8.1")
api("com.github.ben-manes.caffeine:caffeine:3.0.5")
testImplementation("org.spekframework.spek2:spek-dsl-jvm:2.0.17")
testImplementation("org.spekframework.spek2:spek-runner-junit5:2.0.17")
testImplementation("io.mockk:mockk:1.12.2")
testImplementation(platform("org.junit:junit-bom:5.8.2"))
testImplementation("org.junit.jupiter:junit-jupiter")
testImplementation("ch.qos.logback:logback-classic:1.2.10")
testImplementation("com.google.guava:guava-testlib:31.0.1-jre")
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "11"
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
java {
withSourcesJar()
}
jacoco {
toolVersion = "0.8.7"
}
tasks.jacocoTestReport {
reports {
xml.isEnabled = true
csv.isEnabled = false
html.destination = file("${buildDir}/jacocoHtml")
}
}
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/target/native_memory_allocator")
credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") as String? ?: System.getenv("TOKEN")
}
}
}
publications {
register<MavenPublication>("gpr") {
from(components["java"])
}
}
}