-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
180 lines (153 loc) · 5.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
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
import com.jfrog.bintray.gradle.BintrayExtension
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
val coroutineVersion = "1.2.1"
val slf4jApiVersion = "1.7.26"
val funKommandVersion = "1.2.1"
val jUnitVersion = "5.4.2"
val spekVersion = "2.0.2"
val kluentVersion = "1.49"
val easyRandomVersion = "4.0.0.RC1"
val logbackVersion = "1.2.3"
val mockKVersion = "1.9.3"
fun findProperty(s: String) = project.findProperty(s) as String?
val binaryVersion = findProperty("version")
val bintrayUser = System.getenv("BINTRAY_USER") ?: findProperty("bintrayUser")
val bintrayApiKey = System.getenv("BINTRAY_API_KEY") ?: findProperty("bintrayApiKey")
plugins {
`maven-publish`
jacoco
kotlin("jvm") version "1.3.31"
id("io.gitlab.arturbosch.detekt").version("1.0.0.RC9")
id("com.jfrog.bintray") version "1.8.4"
}
repositories {
mavenLocal()
mavenCentral()
jcenter()
}
group = "id.jasoet"
dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutineVersion")
implementation("org.slf4j:slf4j-api:$slf4jApiVersion")
implementation("id.jasoet:fun-kommand:$funKommandVersion")
testImplementation(kotlin("test"))
testImplementation(kotlin("test-junit"))
testImplementation("org.junit.jupiter:junit-jupiter-api:$jUnitVersion")
testImplementation("ch.qos.logback:logback-classic:$logbackVersion")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$jUnitVersion")
testImplementation("org.amshove.kluent:kluent:$kluentVersion")
testImplementation("io.mockk:mockk:$mockKVersion")
testImplementation("org.jeasy:easy-random-core:$easyRandomVersion")
testImplementation("org.spekframework.spek2:spek-dsl-jvm:$spekVersion")
testRuntimeOnly("org.spekframework.spek2:spek-runner-junit5:$spekVersion")
}
jacoco {
toolVersion = "0.8.3"
}
tasks.jacocoTestReport {
group = "Reporting"
reports {
xml.isEnabled = true
html.isEnabled = true
csv.isEnabled = false
}
}
detekt {
toolVersion = "1.0.0-RC14"
config = files("$rootDir/detekt.yml")
filters = ".*test.*,.*/resources/.*,.*/tmp/.*"
}
tasks.test {
finalizedBy(tasks.detekt, tasks.jacocoTestReport)
useJUnitPlatform {
includeEngines("junit-jupiter", "spek2")
}
testLogging {
exceptionFormat = TestExceptionFormat.FULL
events("passed", "failed", "skipped")
}
}
tasks.withType<KotlinCompile> {
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
kotlinOptions {
jvmTarget = "1.8"
apiVersion = "1.3"
languageVersion = "1.3"
allWarningsAsErrors = true
}
}
val sourceJar by tasks.creating(Jar::class) {
archiveClassifier.set("source")
from(sourceSets.main.get().allSource)
dependsOn(tasks.classes)
}
val javadocJar by tasks.creating(Jar::class) {
archiveClassifier.set("javadoc")
from(tasks.javadoc.get().destinationDir)
dependsOn(tasks.javadoc)
}
artifacts {
archives(sourceJar)
archives(javadocJar)
}
publishing {
publications {
create<MavenPublication>("FunPublication") {
from(components["java"])
artifactId = project.name
groupId = "id.jasoet"
version = binaryVersion
artifact(sourceJar)
artifact(javadocJar)
pom {
name.set("script-commons")
description.set("Kotlin Helper for building scripts")
url.set("https://github.com/jasoet/scripts-commons")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("https://github.com/jasoet/scripts-commons")
}
}
developers {
developer {
id.set("jasoet")
name.set("Deny Prasetyo")
email.set("[email protected]")
}
}
scm {
url.set("https://github.com/jasoet/scripts-commons")
}
}
}
}
}
bintray {
user = bintrayUser.toString()
key = bintrayApiKey.toString()
setPublications("FunPublication")
publish = true
override = false
pkg(delegateClosureOf<BintrayExtension.PackageConfig> {
name = project.name
desc = "Kotlin Helper for building scripts"
repo = "fun"
setLicenses("Apache-2.0")
vcsUrl = "https://github.com/jasoet/scripts-commons"
issueTrackerUrl = "https://github.com/jasoet/scripts-commons/issues"
setLabels("kotlin", "fun", "dsl")
publicDownloadNumbers = true
version(delegateClosureOf<BintrayExtension.VersionConfig> {
name = "${project.version}"
vcsTag = "${project.version}"
desc = "Script Commons version ${project.version}."
})
})
}
tasks.wrapper {
gradleVersion = "5.3.1"
}