forked from ePages-de/restdocs-api-spec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
executable file
·67 lines (50 loc) · 1.94 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.serialization.js.DynamicTypeDeserializer.id
repositories {
mavenCentral()
jcenter()
maven { url = uri("https://jitpack.io") }
}
plugins {
kotlin("jvm")
`java-gradle-plugin`
`kotlin-dsl`
}
gradlePlugin {
plugins {
register("com.epages.restdocs-api-spec") {
id = "com.epages.restdocs-api-spec"
implementationClass = "com.epages.restdocs.apispec.gradle.RestdocsApiSpecPlugin"
}
}
}
val jacksonVersion: String by extra
val junitVersion: String by extra
val jacocoRuntime by configurations.creating
dependencies {
compileOnly(gradleKotlinDsl())
compile(kotlin("gradle-plugin"))
compile(kotlin("stdlib-jdk8"))
implementation(project(":restdocs-api-spec-openapi-generator"))
implementation(project(":restdocs-api-spec-openapi3-generator"))
implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:$jacksonVersion")
testImplementation("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
testImplementation("org.junit-pioneer:junit-pioneer:0.2.2")
testImplementation("org.assertj:assertj-core:3.10.0")
testImplementation("com.jayway.jsonpath:json-path:2.4.0")
testCompile(gradleTestKit())
jacocoRuntime("org.jacoco:org.jacoco.agent:0.8.2:runtime")
}
// generate gradle properties file with jacoco agent configured
// see https://discuss.gradle.org/t/testkit-jacoco-coverage/18792
val createTestKitFiles by tasks.creating {
val outputDir = project.file("$buildDir/testkit")
inputs.files(jacocoRuntime)
outputs.dir(outputDir)
doLast {
outputDir.mkdirs()
file("$outputDir/testkit-gradle.properties").writeText("org.gradle.jvmargs=-javaagent:${jacocoRuntime.asPath}=destfile=$buildDir/jacoco/test.exec")
}
}
tasks["test"].dependsOn(createTestKitFiles)