-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle.kts
140 lines (122 loc) · 3.59 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
import com.jfrog.bintray.gradle.BintrayExtension.PackageConfig
import com.jfrog.bintray.gradle.BintrayExtension.VersionConfig
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.util.*
plugins {
kotlin("jvm") version "1.3.70"
id("io.gitlab.arturbosch.detekt").version("1.6.0")
id("org.jetbrains.dokka").version("0.10.1")
id("com.jfrog.bintray").version("1.8.5")
`maven-publish`
jacoco
}
group = "dev.fakek"
version = System.getenv("CIRCLE_TAG") ?: "0.0.1"
repositories {
jcenter()
mavenCentral()
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
api("com.github.javafaker:javafaker:1.0.2")
testImplementation("org.junit.jupiter:junit-jupiter:5.6.0")
testImplementation("io.mockk:mockk:1.9")
testImplementation("io.strikt:strikt-core:0.24.0")
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
tasks.withType<Test> {
useJUnitPlatform()
}
tasks.withType<DokkaTask> {
outputFormat = "html"
outputDirectory = "build/output/documentation"
}
detekt {
input = files("src/main/kotlin")
parallel = false
config = files("detekt/config.yml")
buildUponDefaultConfig = false
baseline = file("detekt/baseline.xml")
disableDefaultRuleSets = false
debug = false
ignoreFailures = false
reports {
xml {
enabled = true
destination = file("build/reports/detekt/detekt.xml")
}
html {
enabled = true
destination = file("build/reports/detekt/detekt.html")
}
txt {
enabled = true
destination = file("build/reports/detekt/detekt.txt")
}
}
}
tasks.jacocoTestReport {
reports {
xml.isEnabled = true
xml.destination = file("build/reports/jacoco/xml/report.xml")
html.isEnabled = true
html.destination = file("build/reports/jacoco/html")
csv.isEnabled = false
}
}
val codeCoverage by tasks.registering {
group = "verification"
description = "Runs unit test suite with coverage."
dependsOn(":test", ":jacocoTestReport", ":jacocoTestCoverageVerification")
val jacocoTestReport = tasks.findByName("jacocoTestReport")
jacocoTestReport?.mustRunAfter(tasks.findByName("test"))
}
val dokkaJar by tasks.creating(Jar::class) {
group = JavaBasePlugin.DOCUMENTATION_GROUP
description = "Assembles Kotlin docs with Dokka"
classifier = "javadoc"
from(tasks.dokka)
}
val sourcesJar by tasks.creating(Jar::class) {
classifier = "sources"
from(tasks.kotlinSourcesJar)
}
publishing {
publications {
create<MavenPublication>("default") {
from(components["java"])
artifact(sourcesJar)
artifact(dokkaJar)
}
}
repositories {
maven {
url = uri("$buildDir/repository")
}
}
}
bintray {
user = System.getenv("BINTRAY_USER")
key = System.getenv("BINTRAY_KEY")
setPublications("default")
pkg(delegateClosureOf<PackageConfig> {
repo = "FakeK"
name = "fakek"
userOrg = "codyengel"
websiteUrl = "https://fakek.dev"
githubRepo = "CodyEngel/fakek"
vcsUrl = "https://github.com/CodyEngel/fakek.git"
description = "A faker library for Kotlin."
desc = description
setLicenses("Apache-2.0")
setLabels("kotlin")
version(delegateClosureOf<VersionConfig> {
name = System.getenv("CIRCLE_TAG") ?: "0.0.1"
desc = "Pre-release version of FakeK"
released = Date().toString()
})
})
}